/* Importar fuentes personalizadas */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* Tipografías personalizadas */
.geom-graphic, h1, h2, h3.main-title, .section-title h2, .logo-text h1, #modal-product-name {
    font-family: 'Montserrat', 'Geom Graphic', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.organetto-regular, p, span, .product-name, .product-price, .cart-text, .category-item span, .cart-item-name, .form-control, button {
    font-family: 'Inter', 'Organetto Regular', Arial, sans-serif;
    font-weight: 400;
}

/* Mejoras tipográficas específicas */
.logo-text h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-title h2 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.product-name {
    font-weight: 500;
}

.product-price {
    font-weight: 600;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4F4F4D, #7AD31C);
    background: url('../assets/navbar/banner1-1.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.logo img {
    /* width: 50px; */
    height: 50px;
    /* border-radius: 50%;
    border: 2px solid white; */
    transition: all 0.3s ease;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}

.logo-text span {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-container {
    min-width: 300px;
    max-width: 400px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.search-container .form-control {
    border: none;
    font-size: 14px;
    padding: 12px 20px 12px 45px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: white;
    transition: all 0.3s ease;
    width: 100%;
}

.search-container .form-control:focus {
    box-shadow: 0 2px 15px rgba(122, 211, 28, 0.3);
    border-color: transparent;
    outline: none;
}

.search-container .form-control:focus + .search-icon,
.search-container .form-control:not(:placeholder-shown) + .search-icon {
    color: #7AD31C;
}

.search-container .form-control::placeholder {
    color: #999;
    font-style: italic;
}

/* Banner Principal */
.main-banner {
    margin: 20px 0;
    padding: 0 15px; /* Padding adicional para móviles */
}

.banner-swiper {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 100%;
}

.banner-swiper img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.swiper-pagination-bullet {
    background: #7AD31C;
}

.swiper-button-next,
.swiper-button-prev {
    color: #7AD31C;
}

/* Categorías */
.categories {
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.categories-swiper .swiper-slide {
    width: auto;
    padding-top: 5px;
    padding-bottom: 5px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 12px;
    min-width: 120px;
}

.category-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.category-item.active {
    background: linear-gradient(135deg, #4F4F4D, #7AD31C);
    color: white;
}

.category-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 20px;
    color: #7AD31C;
}

.category-item.active .category-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.category-item span {
    font-size: 12px;
    text-align: center;
    font-weight: 500;
}

/* Título de sección */
.section-title {
    padding: 20px 0 20px;
}

.section-title h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0px;
}

/* Productos */
.products {
    padding-bottom: 120px; /* Espacio extra para el footer del carrito */
}

/* Estilos del grid de productos ahora manejados por Bootstrap 5 */

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-images {
    position: relative;
    height: 250px;
    text-align: center;
}

.product-main-image {
    object-fit: cover;
}

.product-secondary-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-secondary-image {
    opacity: 1;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    
    /* Forzar siempre 2 líneas de texto */
    height: 2.6em; /* Altura fija para 2 líneas (1.3em por línea) */
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Propiedad estándar */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #7AD31C;
}

/* Botón flotante del carrito */
.floating-cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 2px solid #7AD31C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 .1rem .5rem rgba(0,0,0,.9)!important;
    transition: all 0.3s ease;
    z-index: 1030;
    color: #7AD31C;
    font-size: 1.5rem;
}

.floating-cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    background: #f8f9fa;
    border-color: #5fa517;
    color: #5fa517;
}

.floating-cart-button .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

.floating-cart-button .cart-count:empty,
.floating-cart-button .cart-count[data-count="0"] {
    display: none;
}

/* Ajustes responsivos para el botón flotante */
@media (max-width: 576px) {
    .floating-cart-button {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
        font-size: 1.3rem;
        border-width: 2px;
    }
    
    .floating-cart-button .cart-count {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -4px;
        right: -4px;
    }

    .product-modal-content {
        width: 98vw;
        max-width: 98vw;
        min-height: 90vh;
        padding: 0;
        border-radius: 12px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
    .product-modal-body {
        flex-direction: column;
        gap: 0;
        padding: 0;
        height: 100%;
        min-height: 90vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
    .product-image-modal {
        width: 100%;
        height: 220px;
        min-height: 180px;
        max-height: 220px;
        margin: 0 auto;
        border-radius: 0;
    }
    .product-info.p-3 {
        width: 100%;
        padding: 1rem !important;
        box-sizing: border-box;
        min-height: 100px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
    
    .add-to-cart-btn {
        width: 100%;
        margin-top: 1rem;
        font-size: 1.1rem;
        padding: 0.75rem;
        position: relative;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 8px;
    }

    .close-modal {
        top: 12px;
        right: 12px;
        font-size: 2rem;
        z-index: 10;
        position: absolute;
    }

    #modal-product-name {
        flex-shrink: 0; /* Evita que el título se encoja */
    }

    .product-description {
        flex-grow: 1; /* Permite que la descripción ocupe el espacio vertical disponible */
        overflow-y: auto; /* Agrega la barra de scroll SOLO cuando es necesario */
        padding-right: 10px; /* Espacio para que la barra de scroll no tape el texto */
    }

    .product-options {
        flex-shrink: 0; /* Evita que las opciones se encojan */
    }

    .quantity-selector {
        margin-bottom: 0px !important;
    }
    
    .quantity-controls {
        justify-content: center !important;
    }
}

/* Modal del carrito */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.cart-modal.show {
    display: flex;
}

.cart-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: bold;
    color: #7AD31C;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.quantity-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 5px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #7AD31C;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.qty-btn:hover {
    background: #5fa015;
}

#quantity {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: bold;
}

.remove-item {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    font-size: 12px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total-section {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #4F4F4D, #7AD31C);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(122, 211, 28, 0.3);
}

/* Estado deshabilitado del botón checkout */
.checkout-btn:disabled,
.checkout-btn.disabled {
    background: #6c757d !important; /* Color gris de Bootstrap */
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none; /* Evita cualquier interacción */
    border: 1px solid #6c757d !important;
    position: relative;
}

/* Asegurar que no haya efectos hover cuando está deshabilitado */
.checkout-btn:disabled:hover,
.checkout-btn.disabled:hover,
.checkout-btn:disabled:focus,
.checkout-btn.disabled:focus,
.checkout-btn:disabled:active,
.checkout-btn.disabled:active {
    transform: none !important;
    box-shadow: none !important;
    background: #6c757d !important;
    cursor: not-allowed !important;
    border: 1px solid #6c757d !important;
}

/* Modal de detalle del producto */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.product-modal.show {
    display: flex !important;
}

.product-modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.product-image-modal {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.product-main-image-modal {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Modal de detalle del producto - Bootstrap 5 */
/* #product-modal .modal-dialog {
    max-width: 900px;
} */

#product-modal .modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    overflow: visible;
}

#product-modal .modal-header {
    position: relative;
    z-index: 999;
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: none !important;
    background: transparent !important;
}

#product-modal .btn-close {
    background: rgba(255, 255, 255, 0.9) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.293.293l.707-.707l7 7l7-7l.707.707l-7 7l7 7l-.707.707l-7-7l-7 7l-.707-.707l7-7l-7-7z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 16px 16px !important;
    border: 2px solid rgba(0,0,0,0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    opacity: 0.8 !important;
    transition: all 0.3s ease !important;
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    display: block !important;
    filter: none !important;
}

#product-modal .btn-close:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(0,0,0,0.2) !important;
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

#product-modal .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(122, 211, 28, 0.25) !important;
}

/* Forzar la visibilidad del botón cerrar */
#product-modal .modal-header .btn-close {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.293.293l.707-.707l7 7l7-7l.707.707l-7 7l7 7l-.707.707l-7-7l-7 7l-.707-.707l7-7l-7-7z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 16px 16px !important;
}

#product-modal .product-image-modal {
    /* height: 400px; */
    background: #f8f9fa;
    border-radius: 15px 0 0 15px;
    overflow: hidden;
}

#product-modal .product-price {
    color: #7AD31C !important;
}

#product-modal .quantity-controls .btn {
    border-color: #7AD31C;
}

#product-modal .quantity-controls .btn:hover {
    background-color: #7AD31C;
    border-color: #7AD31C;
    color: white;
}

#product-modal .quantity-controls input {
    border-left: none;
    border-right: none;
    border-color: #7AD31C;
}

#product-modal .quantity-controls input:focus {
    border-color: #7AD31C;
    box-shadow: none;
}

#product-modal .availability-info {
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #e9ecef;
}

#product-modal .availability-info.available {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

#product-modal .availability-info.low-stock {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

#product-modal .availability-info.one-low-stock {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

#product-modal .availability-info.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

#product-modal #add-to-cart-modal {
    background: linear-gradient(135deg, #4F4F4D, #7AD31C);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#product-modal #add-to-cart-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(122, 211, 28, 0.3);
}

.product-info {
    /* Padding manejado por Bootstrap clase p-3 - mantener overflow para modal */
    overflow-y: auto;
}

#modal-product-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    width: 90%;
}

#modal-product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #7AD31C;
    margin-bottom: 15px;
}

.product-description {
    line-height: 1.6;
    color: #666;
}

.product-description p {
    white-space: pre-line; /* Respeta saltos de línea \n y \r */
}

.options-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.quantity-selector {
    flex: 1;
    margin-bottom: 20px;
}

.availability-selector {
    flex: 1;
    margin-bottom: 20px;
}

.quantity-selector label,
.availability-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.availability-info {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

.availability-info.available {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.availability-info.low-stock {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.availability-info.one-low-stock {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.availability-info.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, #4F4F4D, #7AD31C);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1500;
}

.overlay.show {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .product-modal-body {
        grid-template-columns: 1fr;
    }
    
    /* Modal Bootstrap 5 - Responsive */
    #product-modal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    #product-modal .row {
        flex-direction: column;
    }
    
    #product-modal .product-image-modal {
        height: 250px;
        border-radius: 15px 15px 0 0;
    }
    
    #product-modal .col-7,
    #product-modal .col-5 {
        flex: 0 0 auto;
        width: 100%;
    }
    
    #product-modal .row.g-3 {
        flex-direction: row !important;
    }
    
    #product-modal .col-7 {
        width: 60% !important;
    }
    
    #product-modal .col-5 {
        width: 40% !important;
    }
    
    /* Ajustes del botón cerrar en móvil */
    #product-modal .btn-close {
        top: 10px !important;
        right: 10px !important;
        width: 35px !important;
        height: 35px !important;
        background-size: 14px 14px !important;
        display: block !important;
        opacity: 1 !important;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        min-width: auto;
        max-width: 100%;
        width: 100%;
    }
    
    .search-input-wrapper {
        /* max-width: 280px; */
        margin: 0 auto;
    }
    
    .search-container .form-control {
        padding: 10px 15px 10px 40px;
        font-size: 14px;
    }
    
    .search-icon {
        left: 12px;
        font-size: 14px;
    }
    
    .main-banner {
        margin: 15px 0;
        padding: 0 10px;
    }

    
}

/* Media query específica para tablets */
@media (max-width: 768px) and (min-width: 577px) {
    .search-input-wrapper {
        max-width: 90%;
    }
}

/* Asegurar comportamiento normal en desktop */
@media (min-width: 769px) {
    .search-container {
        min-width: 300px;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .main-banner {
        padding: 0 5px;
    }
    
    /* Grid de productos manejado por Bootstrap 5 */
    .product-card {
        border-radius: 10px;
    }
    
    .product-images {
        height: 200px;
    }
    
    .floating-cart {
        padding: 12px 15px;
    }
    
    .cart-summary {
        gap: 10px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* Estados de carga */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #7AD31C;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estado "No se encontraron productos" mejorado */
.no-products-found {
    grid-column: 1 / -1; /* Utiliza todo el ancho del grid */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.no-products-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.no-products-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(122, 211, 28, 0.3);
}

/* Responsive para el estado no-products */
@media (max-width: 768px) {
    .no-products-found {
        min-height: 300px;
        margin: 15px 0;
        border-radius: 15px;
    }
    
    .no-products-content {
        padding: 30px 20px;
    }
    
    .no-products-content i {
        font-size: 3rem !important;
    }
    
    .no-products-content h3 {
        font-size: 1.3rem !important;
    }
    
    .no-products-content p {
        font-size: 0.9rem !important;
    }
}

/* Estilos para indicadores de stock */
.product-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stock-info {
    display: flex;
    justify-content: flex-end;
}

.stock-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.stock-status.in-stock {
    background-color: #d4edda;
    color: #155724;
}

.stock-status.low-stock {
    background-color: #fff3cd;
    color: #856404;
}

.stock-status.one-low-stock {
    background-color: #fff3cd;
    color: #856404;
}

.stock-status.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
}

.product-card.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 8px 0 0;
}

.out-of-stock-badge {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===============================================
   ESTILOS PARA FORMULARIO DE COTIZACIÓN
   =============================================== */

/* Modal de cotización */
#quotation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#quotation-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.quotation-form {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

#quotation-modal.show .quotation-form {
    transform: translateY(0);
}

.quotation-form .modal-header {
    background: linear-gradient(135deg, #4F4F4D, #7AD31C);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quotation-form .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.quotation-form .close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.quotation-form .close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.quotation-form .modal-body {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4F4F4D;
    font-size: 0.95rem;
}

.required {
    color: #dc3545;
    margin-left: 2px;
}

/* Inputs con iconos */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: #7AD31C;
    font-size: 1rem;
    z-index: 2;
}

.input-with-icon input,
.input-with-icon select,
.input-with-icon textarea {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-with-icon input:focus,
.input-with-icon select:focus,
.input-with-icon textarea:focus {
    outline: none;
    border-color: #7AD31C;
    background: white;
    box-shadow: 0 0 0 3px rgba(122, 211, 28, 0.1);
}

/* Contenedor mejorado para WhatsApp - Estilo similar al email */
.whatsapp-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.whatsapp-input-container:focus-within {
    border-color: #7AD31C;
    background: white;
    box-shadow: 0 0 0 3px rgba(122, 211, 28, 0.1);
}

.whatsapp-input-container .input-help {
    margin-top: 6px;
}

.whatsapp-input-container .input-help small {
    color: #6c757d;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.whatsapp-icon {
    position: absolute;
    left: 15px;
    color: #7AD31C;
    font-size: 1rem;
    z-index: 2;
}

.country-selector {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 15px 8px 15px 45px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.country-code {
    background: transparent;
    border: none;
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0;
    cursor: pointer;
    outline: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
}

.country-code:focus {
    outline: none;
}

.whatsapp-input-container input[type="tel"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 15px 15px 0;
    font-size: 1rem;
    background: transparent;
    transition: all 0.3s ease;
}



/* Estilos para validación de WhatsApp */
.whatsapp-input-container.valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.whatsapp-input-container.invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.whatsapp-input-container.valid:focus-within {
    border-color: #28a745;
    background: white;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.whatsapp-input-container.invalid:focus-within {
    border-color: #dc3545;
    background: white;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Mensajes de validación */
.whatsapp-validation {
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.whatsapp-validation.valid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.whatsapp-validation.invalid {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animación para los mensajes de validación */
.whatsapp-validation {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input con prefijo (legacy - mantenido para compatibilidad) */
.input-with-prefix {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Textarea específico */
textarea {
    resize: vertical;
    min-height: 80px;
}

/* Inputs con error */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc3545;
    background: #fff5f5;
}

/* Botón de WhatsApp */
.whatsapp-btn {
    width: 100%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-transform: capitalize;
    margin-top: 20px;
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn i {
    font-size: 1.3rem;
}

/* Botón de WhatsApp en el carrito */
.whatsapp-order-btn {
    width: 100%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-top: 10px;
}

.whatsapp-order-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #128C7E, #0ea572);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.whatsapp-order-btn.disabled {
    background: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.whatsapp-order-btn i {
    font-size: 1.2rem;
}

/* Acciones del carrito */
.cart-actions {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

/* Responsive para formulario */
@media (max-width: 768px) {
    .quotation-form {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh 0;
    }
    
    .quotation-form .modal-header {
        padding: 15px;
    }
    
    .quotation-form .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .quotation-form .modal-body {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .input-with-icon input,
    .input-with-icon select,
    .input-with-icon textarea {
        padding: 12px 12px 12px 40px;
        font-size: 0.95rem;
    }
    
    .country-code {
        padding: 12px 10px;
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .whatsapp-btn {
        padding: 15px 25px;
        font-size: 1rem;
    }
    
    /* Ajustes optimizados para WhatsApp input en móvil */
    .whatsapp-input-container {
        flex-direction: row;
        align-items: stretch;
        max-width: 100%;
    }
    
    .country-selector {
        padding: 12px 6px 12px 35px;
        min-width: 100px;
        max-width: 110px;
        flex-shrink: 0;
        margin-bottom: 0;
        border-bottom: none;
        border-right: 1px solid #dee2e6;
    }
    
    .country-code {
        font-size: 0.8rem;
        padding: 0;
        min-width: auto;
        width: 100%;
        gap: 2px;
    }
    
    .whatsapp-input-container input[type="tel"] {
        padding: 12px 12px 12px 10px;
        font-size: 0.9rem;
        flex: 1;
        border-left: none;
    }
    
    .whatsapp-icon {
        left: 10px;
        font-size: 0.9rem;
        z-index: 3;
    }
    
    .whatsapp-order-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .whatsapp-order-btn i {
        font-size: 1.1rem;
    }
}

/* Optimizaciones adicionales para móviles - mejor aprovechamiento del espacio */
@media (max-width: 576px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .products {
        padding-bottom: 100px; /* Reducir padding inferior */
    }
    
    .product-card {
        border-radius: 12px; /* Bordes más pequeños */
        box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Sombra más sutil */
    }
    
    .product-images {
        height: 140px; /* Altura mucho más compacta para aprovechar espacio */
    }
    
    .product-info {
        padding: 8px 12px 12px 12px !important; /* Padding superior muy reducido, lateral y inferior normales */
    }
    
    .product-name {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    /* WhatsApp field optimizations for 576px screens */
    .whatsapp-input-container {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }
    
    .country-selector {
        min-width: 100px;
        max-width: 105px;
        font-size: 0.85rem;
    }
    
    .country-code {
        font-size: 0.85rem;
        padding: 4px 6px;
    }
    
    .whatsapp-input {
        font-size: 0.9rem;
        padding: 6px 10px;
        margin-bottom: 2px !important; /* Margen muy reducido entre nombre y precio */
        height: 2.4em; /* Altura ajustada para 2 líneas con line-height 1.2 */
    }
    
    .product-price {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .availability-info {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Optimizaciones para pantallas muy pequeñas */
@media (max-width: 400px) {
    .container {
        padding-left: 6px;
        padding-right: 6px;
    }
    
    /* Optimizaciones específicas para WhatsApp en pantallas muy pequeñas */
    .whatsapp-input-container {
        border-radius: 8px;
    }
    
    .country-selector {
        padding: 10px 4px 10px 30px;
        min-width: 85px;
        max-width: 95px;
    }
    
    .country-code {
        font-size: 0.75rem;
        gap: 1px;
    }
    
    .whatsapp-input-container input[type="tel"] {
        padding: 10px 8px 10px 8px;
        font-size: 0.85rem;
    }
    
    .whatsapp-icon {
        left: 8px;
        font-size: 0.8rem;
    }
    
    .product-images {
        height: 130px; /* Aún más compacto en pantallas muy pequeñas */
    }
    
    .product-info {
        padding: 6px 10px 10px 10px !important; /* Padding superior mínimo */
    }
    
    .product-name {
        font-size: 0.85rem;
        margin-bottom: 1px !important; /* Margen mínimo */
        height: 2.4em; /* Altura ajustada para 2 líneas */
        line-height: 1.2; /* Line-height explícito para consistencia */
    }
    
    .product-price {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .availability-info {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}
