/* Estilos específicos para la tienda */

/* Header con carrito */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    position: relative;
    background: #4a7c59;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.cart-btn:hover {
    background: #2c5530;
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Hero Tienda */
.tienda-hero {
    padding: 150px 20px 80px;
    background: linear-gradient(135deg, #4a7c59 0%, #2c5530 100%);
    color: white;
    text-align: center;
}

.tienda-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tienda-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Filtros */
.filtros-section {
    padding: 40px 20px;
    background: white;
    border-bottom: 1px solid #eee;
}

.filtros-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #4a7c59;
}

.filtros {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filtros select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filtros select:focus {
    outline: none;
    border-color: #4a7c59;
}

/* Productos Grid */
.productos-tienda {
    padding: 60px 20px;
    background: #f8f9fa;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.producto-card-tienda {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.producto-card-tienda:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.producto-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.producto-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.producto-card-tienda:hover .producto-image img {
    transform: scale(1.1);
}

.producto-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4a7c59;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.producto-info {
    padding: 1.5rem;
}

.producto-categoria {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.producto-nombre {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.producto-descripcion {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.producto-precio {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4a7c59;
    margin-bottom: 1rem;
}

.producto-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-add-cart {
    flex: 1;
    padding: 10px;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background: #2c5530;
}

.btn-quick-view {
    padding: 10px 15px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-quick-view:hover {
    background: #e9ecef;
    color: #333;
}

/* Estados de carga */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #4a7c59;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-products i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

/* Carrito Lateral */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    color: #333;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.cart-item-price {
    color: #4a7c59;
    font-weight: 600;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.quantity-display {
    padding: 0 0.5rem;
    font-weight: 500;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
}

/* Modal de Producto */
.product-modal-content {
    max-width: 900px;
    width: 90%;
}

.product-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-image-container {
    text-align: center;
}

.product-image-container img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-gallery {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.gallery-thumb.active {
    border-color: #4a7c59;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.product-category {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.product-price .price {
    font-size: 2rem;
    font-weight: 700;
    color: #4a7c59;
}

.product-description {
    color: #666;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.product-options {
    margin: 2rem 0;
}

.quantity-selector {
    margin-bottom: 1rem;
}

.quantity-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    width: 35px;
    height: 35px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.quantity-controls input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.stock-info {
    color: #28a745;
    font-size: 0.9rem;
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    flex: 1;
}

.btn-whatsapp:hover {
    background: #128c7e;
}

/* Modal de Checkout */
.checkout-modal-content {
    max-width: 1000px;
    width: 95%;
}

.checkout-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.checkout-form h4,
.order-summary h4 {
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a7c59;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.delivery-options {
    margin-top: 1.5rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #4a7c59;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #4a7c59;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #4a7c59;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.order-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    height: fit-content;
}

.summary-items {
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-totals {
    border-top: 2px solid #ddd;
    padding-top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4a7c59;
    border-top: 1px solid #ddd;
    padding-top: 0.5rem;
    margin-top: 1rem;
}

.btn-place-order {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filtros-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filtros {
        justify-content: center;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .product-modal-grid {
        grid-template-columns: 1fr;
    }
    
    .checkout-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .tienda-hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
    
    .cart-btn {
        padding: 8px 12px;
        font-size: 1rem;
    }
}