/*
 * ===================================================================
 *   MI-CATALOGO - HOJA DE ESTILOS PRINCIPAL (FRONTEND PÚBLICO)
 *   Versión: Final, Completa y Depurada
 * ===================================================================
*/

/* -------------------------------------------------------------------
 * 1. VARIABLES GLOBALES Y ESTILOS BASE
 * ------------------------------------------------------------------- */
:root {
    /* Estas variables son inyectadas por PHP desde la configuración */
    --primary-color: #d63384;
    --secondary-color: #e74c98;
    --accent-color: #f8b4d9;
    --danger-color: #dc3545;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --text-on-primary: #ffffff;
    --text-on-accent: #212529;
    --light-gray: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --footer-bg-start: var(--secondary-color);
    --footer-bg-end: var(--primary-color);
}

@view-transition {
    navigation: auto;
}

::view-transition-group(*){
    animation-duration: 0.7s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex-grow: 1;
}
a {
    color: var(--text-dark);
    text-decoration: none;
}
a:hover {
    color: var(--secondary-color);
}

/* -------------------------------------------------------------------
 * 2. LAYOUT Y COMPONENTES PRINCIPALES
 * ------------------------------------------------------------------- */
.hero-section {
    background-color: var(--primary-color);
    background-size: cover;
    background-position: center;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.hero-section .logo {
    max-width: 250px;
    max-height: 150px;
    object-fit: contain;
}

.product-detail-nav {
    background: linear-gradient(135deg, var(--footer-bg-start), var(--footer-bg-end));
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.product-detail-nav .navbar-brand,
.product-detail-nav .nav-link {
    color: var(--text-on-primary) !important;
}

.filters-bar {
    background-color: var(--card-bg);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    z-index: 1020;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.filters-bar .container {
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filters-bar .container::-webkit-scrollbar { display: none; }

.filter-btn-group {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 5px;
}
.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-bar-container .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.site-footer {
    background: linear-gradient(135deg, var(--footer-bg-start), var(--footer-bg-end));
    color: var(--text-on-primary);
    padding: 3rem 1rem 1.5rem;
    margin-top: auto;
}
.footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-on-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}
.footer-links {
    list-style: none;
    padding-left: 0;
}
.footer-links li {
    margin-bottom: 0.75rem;
}
.footer-links a {
    color: var(--text-on-primary);
    opacity: 0.8;
    transition: opacity 0.2s ease, padding-left 0.2s ease;
}
.footer-links a:hover {
    opacity: 1;
    padding-left: 5px;
}
.footer-social-icons {
    display: flex;
    gap: 1.25rem;
}
.footer-social-icons a {
    font-size: 1.5rem;
    color: var(--text-on-primary);
    transition: transform 0.2s ease;
}
.footer-social-icons a:hover {
    transform: translateY(-3px);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.8;
}
.faro-separator{
    display: block;
}
.faro-branding a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-on-primary);
    opacity: 1;
}

.modalclass h1, .modalclass h2, .modalclass h3, .modalclass h4, .modalclass h5
{
    font-size: 1.2rem;
    color: black;
}
.modalclass p
{
    font-size: 0.8rem;
    margin-top: 0.1rem !important;
    margin-bottom: 0.10rem !important;
    color: black
}

.modalclass .modal-title
{
    color: var(--text-on-primary);
}

.modalclass .modal-content {
    border-radius: 10px;
    border: none;
    background-color: var(--light-gray);
}

.modalclass .modal-header {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: none;
}
.modalclass .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modalclass .modal-body {
    padding: 0.5rem 1rem;
}

/* -------------------------------------------------------------------
 * 3. ESTILOS PARA LAS TARJETAS DE PRODUCTO
 * ------------------------------------------------------------------- */

/* --- 3.1 VISTA DE CUADRÍCULA (GRID) --- */
.product-card-grid {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    transition: all 0.2s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.product-card-grid:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.product-image-wrapper {
    padding-top: 100%;
    position: relative;
    background-color: var(--light-gray);
    overflow: hidden;
}

.product-image-wrapper .badges-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    pointer-events: none; /* Para que no interfieran con el clic en la imagen */
    
    /* ¡La clave de la solución! */
    display: flex;
    flex-direction: column; /* Apila los badges verticalmente */
    align-items: flex-start; /* Los alinea a la izquierda */
    gap: 0.3rem; /* Espacio entre los badges */
}

.product-image {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card-grid:hover .product-image {
    transform: scale(1.05);
}

.product-info-grid {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-name-grid {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.product-price-grid {
    margin-top: auto;
    padding-top: 0.5rem;
}
.product-price-grid .price-sale { font-size: 1rem; }
.product-price-grid .price-original { font-size: 0.85em; }

.product-action-button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}
.btn-quick-add-floating {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    border-radius: 50%;
    width: 38px; height: 38px;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.15s ease;
}
.btn-quick-add-floating:hover {
    transform: scale(1.1);
    background-color: var(--secondary-color);
}
.quantity-in-grid-indicator {
    background-color: var(--accent-color);
    color: var(--text-on-accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    width: 38px; height: 38px;
}

/* --- 3.2 VISTA DE LISTA (LIST) --- */
#productListContainer.view-mode-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.product-list-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.list-image-wrapper {
    position: relative;
    width: 120px; height: 120px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.list-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.list-info-container { padding-right: 1rem; }
.list-product-name { font-size: 1.1rem; font-weight: 600; }
.list-product-price { font-size: 1.1rem; margin-top: 0.5rem; }

.list-actions-container-desktop { display: flex; justify-content: flex-end; }
.product-action-button-mobile { display: none; }

.btn-theme-add {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn-theme-add:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-on-primary);
}

.quantity-in-list-selector-desktop {
    display: inline-flex; align-items: center; border: 1px solid var(--border-color);
    border-radius: 50px; padding: 2px;
}
.quantity-in-list-selector-desktop .btn {
    width: 32px; height: 32px; border-radius: 50%; border: none; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--light-gray); color: var(--text-dark); flex-shrink: 0;
}
.quantity-in-list-selector-desktop .btn:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}
.quantity-in-list-selector-desktop .quantity-in-list-display {
    font-size: 1rem; font-weight: 600; min-width: 25px; text-align: center; padding: 0 0.5rem;
}

.list-product-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    /* Truco para limitar el texto a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 3.3 ELEMENTOS COMUNES DE TARJETAS --- */
.price-sale { color: var(--danger-color); font-weight: 700; }
.price-original { text-decoration: line-through; color: var(--text-muted); font-size: 0.9em; }

.product-list-item.out-of-stock, .product-card-grid.out-of-stock {
    opacity: 0.7;
}
.out-of-stock-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex; align-items: center; justify-content: center; z-index: 2;
}
.out-of-stock-overlay .badge { font-size: 1rem; padding: 0.5em 1em; }

.product-card-badge {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    padding: 0.3em 0.8em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.product-card-badge.sale-badge {
    background-color: var(--danger-color);
}


/* -------------------------------------------------------------------
 * 4. PÁGINA DE DETALLE DEL PRODUCTO
 * ------------------------------------------------------------------- */
.main-image-container {
    position: relative;
    width: 100%; padding-top: 100%;
    background-color: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.main-product-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}
.main-image-container:hover .main-product-image { transform: scale(1.05); }
.main-image-container .sale-badge {
    position: absolute; top: 15px; left: 15px;
    background-color: var(--danger-color); color: #fff;
    padding: 0.4em 0.8em; border-radius: 25px;
    font-size: 0.9rem; font-weight: 600; z-index: 3;
}
.thumbnails-column {
    display: flex; flex-direction: column; gap: 8px;
    max-height: 500px; overflow-y: auto;
}
.thumbnail-image {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: 6px; border: 2px solid transparent;
    cursor: pointer; transition: border-color 0.2s ease;
}
.thumbnail-image:hover, .thumbnail-image.active {
    border-color: var(--primary-color);
}

.thumbnails-row {
    display: flex;
    gap: 8px;
    overflow-x: auto; /* Permite scroll horizontal si hay muchas imágenes */
    padding-bottom: 8px; /* Espacio para la barra de scroll */
    /* Ocultar la barra de scroll visualmente */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.thumbnails-row::-webkit-scrollbar {
    display: none;
}
.thumbnails-row .thumbnail-image {
    width: 60px; /* Tamaño fijo para las miniaturas horizontales */
    height: 60px;
    flex-shrink: 0; /* Evitar que las imágenes se encojan */
}

.product-detail-info .product-name { font-size: 1.75rem; font-weight: 600; }
.product-detail-info .product-price { font-size: 1.8rem; margin-bottom: 1.5rem; }
.description-content, .modal-body { line-height: 1.7; }

/* Controles de cantidad en la página de detalle */
#addToCartBtn {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
    font-weight: 500;
    margin-top: 1.5rem;
}
.divisor-btn-container{
    width: 100%;
    height: 3px;
    border-top: 1px solid;
    border-color: var(--border-color);
}
.btncontainer{
}
#addToCartBtn:hover:not(:disabled) {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
#addToCartBtn:disabled {
    background-color: #a0a0a0;
    border-color: #a0a0a0;
    cursor: not-allowed;
}
.quantity-in-list-selector {
    display: inline-flex; align-items: center; border: 1px solid var(--border-color);
    border-radius: 50px; padding: 4px;
}
.quantity-in-list-selector .btn {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
}
.quantity-in-list-selector .btn:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    filter: brightness(105%);
}
.quantity-in-list-selector .btn:disabled { color: #ccc; cursor: not-allowed; }
.quantity-in-list-selector .quantity-in-list-display {
    font-size: 1.2rem; font-weight: 600; min-width: 40px; text-align: center;
}

/* --- SECCIÓN DE PRODUCTOS RELACIONADOS --- */
.related-products-section {
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}
.related-products-section h3 {
    font-weight: 500;
    color: var(--text-muted);
}
.related-product-card {
    /* <<< CORRECCIÓN CLAVE: Usar flexbox en lugar de block >>> */
    display: flex;
    flex-direction: column;
    height: 100%; /* Asegura que todas las tarjetas en una fila tengan la misma altura */
    text-decoration: none;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease-out;
}
.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.related-product-image-wrapper {
    width: 100%;
    padding-top: 100%; /* Aspect ratio 1:1 */
    position: relative;
    background-color: var(--light-gray);
}
.related-product-image {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
}
.related-product-info {
    padding: 0.75rem;
    flex-grow: 1; /* Permite que este div ocupe el espacio restante */
    display: flex;
    flex-direction: column;
}
.related-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}
.related-product-price {
    font-size: 0.85rem;
    margin-top: auto; /* Empuja el precio al fondo de la tarjeta */
}

/* --- ESTILOS PARA DETALLE DE PRODUCTO ADICIONALES --- */

/* Contenedor de Badges de Confianza */
.trust-badges-container {
    display: flex;
    justify-content: space-around; /* Distribuye el espacio sobrante entre los badges */
    align-items: flex-start; /* Alinea los items al inicio si tienen alturas diferentes */
    flex-wrap: nowrap; /* ¡Clave! Evita que los badges salten a la siguiente línea */
    
    /* border-top: 1px solid var(--border-color); */
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.trust-badge {
    /* Cada badge será un contenedor flex para alinear su icono y texto */
    display: flex;
    flex-direction: column; /* Apila el icono sobre el texto */
    align-items: center;    /* Centra el icono y el texto horizontalmente */
    text-align: center;
    gap: 0.3rem;            /* Pequeño espacio entre el icono y el texto */
    
    /* Le damos un tamaño base para que se distribuyan bien */
    flex-basis: 30%; 
    
    font-size: 0.75rem;     /* Letra más pequeña, ideal para móviles */
    color: var(--text-muted);
}

.trust-badge i {
    color: var(--primary-color); /* Usamos el color primario para los iconos */
    font-size: 1.5rem;          /* Iconos un poco más grandes y visibles */
    margin-bottom: 0.1rem;      /* Pequeño ajuste de espacio */
    
    /* Damos un tamaño fijo al contenedor del icono para consistencia */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-info-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    text-align: center;
    background-color: #f0f2f5;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-align: left;
    margin-bottom: 0.75rem;
}

.payment-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.payment-logos img {
    height: 100px; 
    max-width: 100px;
    object-fit: contain;
}

/* ===================================================================
 *   NUEVOS ESTILOS PARA LA PÁGINA DE DETALLE DEL PRODUCTO
 * =================================================================== */

.product-info-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.product-info-panel .product-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.product-block.action-block {
    margin-top: auto; /* Empuja este bloque hacia abajo */
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.product-price {
    font-size: 2.2rem;
    font-weight: 300;
}
.product-price .price-sale {
    font-weight: 600;
    color: var(--danger-color);
}
.product-price .price-original {
    font-size: 1.5rem;
    margin-left: 0.75rem;
}


/* Info de Medios de Pago */
.payment-info-container {
    background-color: transparent;
    border: none;
    padding: 0;
}

.payment-logos {
    justify-content: flex-start; /* Alinear a la izquierda */
}

/* Descripción Detallada */
.product-description-container {
    padding: 2rem 0;
}
.description-title {
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Se mueve el breadcrumb a la columna de información */
.product-detail-section .breadcrumb {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.selectoption{
    font-size: 1rem;
    font-weight: 600;
}

/* --- SECCIÓN DE PRODUCTOS RELACIONADOS --- */
.related-products-section {
    padding-top: 3rem;
    margin-top: 3rem !important; /* Usar !important si es necesario para sobreescribir */
    border-top: 1px solid var(--border-color);
}
.related-products-title {
    text-align: center;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 1.75rem;
}
.related-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease-out;
}
.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.related-product-image-wrapper {
    width: 100%;
    padding-top: 100%; /* Aspect ratio 1:1 */
    position: relative;
    background-color: var(--light-gray);
}
.related-product-image {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
}
.related-product-info {
    padding: 0.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.related-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    /* Limitar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-product-price {
    font-size: 0.95rem;
    margin-top: auto;
    font-weight: 600;
}

#productPrice .price-normal{
    font-size: 2rem !important; 
    font-weight: 500 !important;
    line-height: 1.2;
}

/* --- Estilos para las Promociones de Pago Destacadas --- */
.payment-promos-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-weight: 500;
    padding-bottom: 1rem;
}

.payment-promo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.payment-promo-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}


/* -------------------------------------------------------------------
 * 5. COMPONENTES GLOBALES (CARRITO, MODALES)
 * ------------------------------------------------------------------- */
.floating-cart-button {
    position: fixed; bottom: 25px; right: 25px;
    background: var(--primary-color); color: var(--text-on-primary);
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 1050; cursor: pointer; transition: all 0.2s ease-out;
}
.floating-cart-button:hover { transform: scale(1.08); }
.cart-count {
    position: absolute; top: -5px; right: -5px;
    background-color: var(--danger-color); color: var(--text-on-primary);
    border-radius: 50%; padding: 3px 7px;
    font-size: 0.75rem; font-weight: bold;
    border: 2px solid var(--card-bg); line-height: 1;
}

#customerDataModal .modal-content {
    border-radius: 10px;
    border: none;
    background-color: var(--light-gray);
}
#customerDataModal .modal-header {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: none;
}
#customerDataModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#customerDataModal .modal-body {
    padding: 0.5rem 1rem;
}

#customerDataModal .modal-footer #confirmAndSendOrderBtn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    font-weight: 500;
}

#btnready{
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    font-weight: 500;    
}
#btnready:hover{
    filter: brightness(120%);
}


#cartModal .modal-content {
    border-radius: 10px;
    border: none;
    background-color: var(--light-gray);
}
#cartModal .modal-header {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: none;
}
#cartModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#cartModal .modal-body {
    padding: 0.5rem 1rem;
}
#cartModal .cart-item {
    display: grid;
    /* Layout: [Imagen] [Info/Precio] [Acciones] */
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
#cartModal .cart-item:last-child {
    border-bottom: none;
}
.cart-item-image-container img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}
.cart-item-info {
    display: flex;
    flex-direction: column;
}
.cart-item-name {
    font-weight: 600;
}
.cart-item-options {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
}
.cart-item-unit-price {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* <<< NUEVO: Contenedor para acciones (selector y eliminar) >>> */
.cart-item-actions-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* <<< NUEVO: Estilos para el selector de cantidad DENTRO del carrito >>> */
.cart-item-actions-panel .quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50px;
}
.cart-item-actions-panel .quantity-selector .btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--primary-color);
    font-weight: bold;
    display: flex; /* Convierte el botón en un contenedor flex */
    justify-content: center; /* Centra horizontalmente */
    align-items: center; /* Centra verticalmente */
}
.cart-item-actions-panel .quantity-selector .btn:hover {
    color: var(--text-on-primary);
    background: var(--primary-color);
}
.cart-item-actions-panel .quantity-selector .btn:disabled {
    color: #ccc;
}
.cart-item-actions-panel .quantity-selector .quantity-display {
    font-weight: 600;
    padding: 0 0.75rem;
}
/* <<< NUEVO: Estilo para el botón de eliminar >>> */
.cart-item-actions-panel .btn-remove-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.cart-item-actions-panel .btn-remove-item:hover {
    opacity: 1;
    color: var(--danger-color);
}

#cartModal .totals-section {
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-top: 1rem;
}
/* <<< CORRECCIÓN: Estilo del total >>> */
#cartModal .totals-section h5 {
    color: var(--text-dark); /* Texto oscuro, no verde */
}

#cartModal .modal-footer {
    background-color: var(--card-bg);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

#cartModal .modal-footer #proceedToConfirmationBtn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    font-weight: 500;
}
#cartModal .modal-footer #proceedToConfirmationBtn:hover {
    filter: brightness(105%);
}

#cartModal .totals-section #cartTotalInCartModal {
    color: var(--text-dark) !important; /* Usar !important como último recurso para asegurar la sobreescritura */
    font-weight: 700; /* Un poco más de peso */
}

.image-lightbox-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 1080; cursor: zoom-out; opacity: 0; transition: opacity 0.3s ease-in-out; }
.image-lightbox-overlay.show { display: flex; opacity: 1; }
.image-lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    /* <<< AÑADIR ESTA LÍNEA >>> */
    transition: opacity 0.3s ease-in-out;
}
.image-lightbox-close { position: absolute; top: 15px; right: 20px; font-size: 2.5rem; color: rgba(255,255,255,0.8); cursor: pointer; background: none; border: none; }
/* --- NUEVOS ESTILOS PARA LA NAVEGACIÓN DEL LIGHTBOX --- */
.image-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1081; /* Por encima del contenido, debajo del botón de cerrar */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.image-lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}
.image-lightbox-nav.prev {
    left: 15px;
}
.image-lightbox-nav.next {
    right: 15px;
}

/* Ocultar flechas si no hay más imágenes en esa dirección */
.image-lightbox-nav.hidden {
    display: none;
}

/* -------------------------------------------------------------------
 * 6. COMPONENTES PEDIDO CONFIRMADO
 * ------------------------------------------------------------------- */

#orderConfirmationModal .modal-content {
    border-radius: 10px;
    border: none;
    background-color: var(--light-gray);
}
#orderConfirmationModal .modal-header {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: none;
}
#orderConfirmationModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#orderConfirmationModal .modal-body {
    padding: 0.5rem 1rem;
}

.confirmation-icon i{
    color: var(--primary-color);
}

#whatsappConfirmBtn {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

#whatsappConfirmBtn:hover {
    filter: brightness(105%);
}

/* --- Estilos para los Nuevos Selectores de Atributos con Botones --- */

.attribute-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attribute-option {
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 25px; /* Píldoras redondeadas */
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.attribute-option.unavailable {
    /* Hacemos el botón semitransparente para indicar que no es la opción principal */
    opacity: 0.6; 
    /* El cursor sigue siendo 'pointer' para que el usuario pueda hacer clic y ver el resultado */
    cursor: pointer; 
}

.attribute-option.unavailable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%; /* Empezamos un poco antes */
    width: 120%; /* Y terminamos un poco después para asegurar que cruce todo */
    height: 2px; /* Grosor de la línea */
    background-color: var(--danger-color); /* Usamos el color de "venta/error" */
    
    /* La magia de la rotación */
    transform: rotate(-15deg); 
    
    transition: all 0.2s ease;
}

.attribute-option.unavailable:hover {
    opacity: 0.8;
}

/* Estado Hover: cuando el cursor está encima */
.attribute-option:hover:not(:disabled) {
    background-color: var(--light-gray);
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Estado Activo: cuando el botón está seleccionado */
.attribute-option.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.attribute-option.active:hover:not(:disabled) {
    color: var(--primary-color);
}

/* Estado Deshabilitado: para combinaciones no disponibles */
.attribute-option:disabled {
    background-color: var(--light-gray);
    color: #adb5bd;
    cursor: not-allowed;
    text-decoration: line-through; /* Tachamos el texto */
    opacity: 0.7;
}

/* --- Estilos para Mejoras en Controles de Cantidad (Detalle de Producto) --- */

/* Separador visual antes del bloque de acción */
.action-separator {
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0 1rem; /* Margen uniforme */
}

/* Contenedor del texto informativo */
.in-cart-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}
.in-cart-info i {
    font-size: 1rem;
}

/* Contenedor del selector de cantidad para centrarlo */
.quantity-selector-wrapper {
    display: flex;
    justify-content: center; /* ¡La clave para centrar! */
}

#quantityControlContainer {
    width: 100%;
}

.quantity-control-wrapper {
    width: 100%;
}

/* Estilos del selector de cantidad (ya los teníamos, pero los refinamos) */
.quantity-selector-wrapper .btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    font-weight: bold;
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    
    background-color: var(--card-bg);
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.quantity-selector-wrapper .btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
}
.quantity-selector-wrapper .btn:disabled {
    background-color: #e9ecef;
    color: #ced4da;
    cursor: not-allowed;
}

.quantity-selector-wrapper .quantity-in-list-display {
    font-size: 1.5rem;
    font-weight: 600;
    min-width: 60px; /* Ancho mínimo para que no salte */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Estilos para la Cabecera de la Página de Categoría --- */

.category-header {
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.category-description {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 700px; /* Evita que la línea sea demasiado larga en pantallas grandes */
    margin: 0 auto; /* Centra el contenedor de la descripción */
    line-height: 1.6;
}

/* Ajuste para el hero title en la página de inicio (si es necesario) */
.hero-section .category-hero-title {
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

/* Ajustes responsivos para el título de la categoría */
@media (max-width: 768px) {
    .category-title {
        font-size: 2rem; /* Título un poco más pequeño en móviles */
    }
    .category-description {
        font-size: 0.9rem;
    }
}

/* -------------------------------------------------------------------
 * 7. MEDIA QUERIES PARA RESPONSIVE DESIGN
 * ------------------------------------------------------------------- */

/* --- Media Query para pantallas muy pequeñas--- */
 @media (max-width: 430px) {
    .trust-badge {
        font-size: 0.7rem; /* Hacemos la letra aún más pequeña si la pantalla es muy estrecha */
        flex-basis: 28%;
    }
    .trust-badge i {
        font-size: 1.3rem; /* Y el icono también */
    }
    .trust-badges-container {
        gap: 0.10rem; /* Reducimos el espacio entre badges */
    }
}

/* MEDIA QUERY PARA HACER EL CARRITO MÁS COMPACTO EN MÓVILES */
@media (max-width: 576px) {
    #cartModal .cart-item {
        grid-template-columns: 50px 1fr auto; /* Imagen más pequeña */
        gap: 0.75rem;
    }
    .cart-item-name { font-size: 0.9rem; }
    #cartModal .modal-body { padding: 0.5rem; }
}

@media (max-width: 768px) {
    /* --- VISTA DE LISTA EN MÓVIL --- */
    .product-list-item {
        display: flex;
        gap: 0.75rem;
    }
    .payment-logos img{
        height: 70px; 
        max-width: 70px;
        object-fit: contain;
    }
    .image-lightbox-nav {
        display: none;
    }
    .product-list-item .list-image-wrapper {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
    .product-list-item .list-info-container {
        flex-grow: 1;
    }
    .product-list-item .list-product-name { font-size: 0.9rem; }
    .product-list-item .list-product-price { font-size: 1rem; }
    
    /* Ocultar acciones de desktop y mostrar las de móvil */
    .product-list-item .list-actions-container-desktop { display: none; }
    .product-list-item .product-action-button-mobile {
        display: block; position: absolute; bottom: 5px; right: 5px; z-index: 3;
    }
    
    /* Estilos para los botones del overlay móvil */
    .product-action-button-mobile .btn-add-list-mobile {
        background-color: var(--primary-color); color: var(--text-on-primary);
        border: none; border-radius: 50%;
        width: 32px; height: 32px; font-size: 0.9rem;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }
    .product-action-button-mobile .quantity-in-list-selector-mobile {
        display: inline-flex; align-items: center; background-color: rgba(255, 255, 255, 0.95);
        border-radius: 50px; padding: 2px; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }
    .product-action-button-mobile .quantity-in-list-selector-mobile .btn {
        background-color: transparent; color: var(--primary-color);
        width: 26px; height: 26px; font-size: 1rem; font-weight: bold;
        padding: 0; line-height: 1;
    }
    .product-action-button-mobile .quantity-in-list-selector-mobile .quantity-display-mobile {
        color: var(--text-dark); font-weight: 600; font-size: 0.9rem; padding: 0 0.5rem;
    }
    .product-action-button-mobile .quantity-in-list-selector-mobile .btn:disabled { color: #ccc; }
}