/*
========================================
** ARCHIVO CSS MEJORADO Y OPTIMIZADO **
========================================

==== MEJORAS REALIZADAS ====
1.  VARIABLES: Se definen variables para colores, fuentes, sombras y radios para consistencia.
2.  OPTIMIZACIÓN: Se reemplaza 'transition: all' por transiciones específicas para mejor rendimiento.
3.  REFACTORIZACIÓN: Se unifican estilos repetidos en clases reutilizables (ej. .feature-icon).
4.  BUENAS PRÁCTICAS: Se elimina el uso de '!important' en el nav-link.
5.  DISEÑO PREMIUM: Se añaden animaciones sutiles (dropdown), mejores sombras y efectos hover.
*/

:root {
    /* Paleta de Colores */
    --color-primario: #0d2d52;      /* Azul Marino Oscuro */
    --color-secundario: #d93644;    /* Rojo para acentos */
    --color-acento: #00aaff;        /* Azul brillante para CTAs */
    --dark-color: #212529;
    --text-color: #555;
    --light-bg-color: #f8f9fa;
    
    /* Variables de UI */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;
    --shadow-light: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-medium: 0 10px 20px rgba(0,0,0,0.1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--light-bg-color);
    color: var(--text-color);
}


/* ========================================
   ** ENCABEZADO UNIFICADO
   ======================================== */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: var(--shadow-light);
}
.navbar {
    padding: 1rem 0;
}
.navbar-brand {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 28px;
    color: var(--color-primario);
}
.navbar-brand span {
    color: var(--color-secundario);
}

/* Menú de Navegación */
.nav-link {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-bottom: 3px solid transparent; /* Espacio para la animación */
    transition: color 0.3s ease, border-color 0.3s ease;
}
.nav-link:hover, .nav-link.active {
    color: var(--color-primario);
    border-bottom-color: var(--color-secundario);
}

/* Dropdown con Animación */
.dropdown-menu {
    border: 1px solid #eee;
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius-md);
    padding: 0.5rem 0;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    display: block;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.nav-item.dropdown:hover > .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}
.dropdown-item {
    padding: 0.6rem 1.2rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.dropdown-item:hover, .dropdown-item:focus {
    color: var(--color-primario);
    background-color: rgba(13, 45, 82, 0.05);
}

/* Grupo de Acciones (Derecha) */
.navbar-actions {
    gap: 1rem;
}
.action-icon {
    font-size: 1.6rem;
    color: var(--text-color);
    transition: color 0.2s ease, transform 0.2s ease;
}
.action-icon:hover {
    color: var(--color-primario);
    transform: scale(1.1);
}
.action-icon .badge {
    position: absolute;
    top: -2px;
    right: -8px;
    font-size: 10px;
    background-color: var(--color-secundario);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    padding: 2px 5px;
}

/* Formulario de Búsqueda */
.search-form {
    position: relative;
}
.search-form .form-control {
    border-radius: 30px;
    border: 1px solid #ddd;
    padding-right: 40px; /* Espacio para el icono */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.search-form .form-control:focus {
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(13, 45, 82, 0.15);
}
.search-form .btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
}
.navbar-toggler {
    border: none;
    font-size: 1.8rem;
    color: var(--color-primario);
}
.navbar-toggler:focus {
    box-shadow: none;
}


/* ========================================
   ** COMPONENTES REUTILIZABLES
   ======================================== */

/* REFACTORIZACIÓN: Clase única para iconos destacados */
/* En tu HTML, reemplaza la clase .icon-circle por .feature-icon */
.feature-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(13, 45, 82, 0.08);
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--color-primario);
}

/* Tarjetas de Producto */
.product-card {
    border-radius: var(--border-radius-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}


/* ========================================
   ** FOOTER
   ======================================== */
.main-footer {
    background-color: var(--dark-color);
    color: rgba(255, 255, 255, 0.7);
}
.footer-title {
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--color-secundario);
}
.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}
.footer-bottom-bar {
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}
.social-icon {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    margin-left: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}
.social-icon:hover {
    color: var(--color-secundario);
    transform: scale(1.1);
}

/* Botón de WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-medium);
    color: #FFF;
}


/* ========================================
   ** BARRA SUPERIOR (REINTEGRADA)
   ======================================== */
.top-bar {
    background-color: var(--color-primario);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========================================
   ** AJUSTES FINALES PARA HEADER
   ======================================== */

/* Para el mensaje en la barra superior */
.top-bar-message {
    /* Esta clase es opcional si necesitas ajustar el texto */
    /* Por ejemplo: text-overflow: ellipsis; overflow: hidden; white-space: nowrap; */
}

/* Para el icono de usuario en la barra superior */
.top-bar-user-icon {
    color: #fff;
    font-size: 1.4rem; /* Tamaño del icono */
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.top-bar-user-icon:hover {
    color: #fff;
    opacity: 1;
}

/* En el menú principal, separamos las acciones del menú hamburguesa */
/* y las centramos en móvil */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem; /* Espacio entre los iconos y el menú colapsado */
    }
    .navbar-nav {
        text-align: center; /* Centra los links del menú en móvil */
    }
}



/*
========================================
** ESTILOS MEJORADOS PARA INDEX.PHP **
========================================
*/

/* === MEJORAS GENERALES Y TÍTULOS DE SECCIÓN === */
main .display-5 {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--color-primario);
}

main .container-fluid {
    padding-top: 5rem;
    padding-bottom: 5rem;
}
main .container {
     padding-top: 5rem;
     padding-bottom: 5rem;
}

/* === 1. SECCIÓN HERO === */
.hero-header {
    background-color: #fff; /* Fondo limpio para empezar */
}
.hero-header .text-secondary {
    font-weight: 600;
    color: var(--color-secundario) !important; /* Resaltar con el color de acento */
}
.hero-header .text-primary {
    color: var(--color-primario) !important;
}
.hero-header .btn-primary {
    padding: 1rem 2.5rem;
    font-weight: 600;
    border-radius: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-header .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}
.hero-header .img-fluid {
    border-radius: var(--border-radius-md) !important;
    box-shadow: var(--shadow-medium);
}

/* === 2. SECCIÓN DE REELS Y QUIÉNES SOMOS === */
#reels .card, #quienes-somos .img-fluid {
    border-radius: var(--border-radius-md) !important;
    border: none;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#reels .card:hover, #quienes-somos .img-fluid:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}
#reels video {
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
}


/* === 3. PROCESO "COMPRAR ES FÁCIL" (MEJORA CLAVE) === */
.process-item {
    position: relative; /* Necesario para los conectores */
}

/* Estilo mejorado para los círculos de iconos */
/* En tu HTML aún usas .icon-circle, así que lo estilizamos aquí */
.process-item .icon-circle {
    width: 90px;
    height: 90px;
    background-color: #fff;
    border: 2px solid var(--color-primario);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: var(--color-primario);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.process-item:hover .icon-circle {
    background-color: var(--color-primario);
    color: #fff;
}
.process-item h4 {
    margin-top: 1.5rem;
    color: var(--dark-color);
    font-family: var(--font-secondary);
}

/* Conectores visuales entre los pasos (solo para escritorio) */
@media (min-width: 768px) {
    .process-item:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 45px; /* A la mitad de la altura del círculo */
        right: -50%;
        transform: translateX(-50%);
        width: calc(100% - 90px); /* Ancho del 100% menos el icono */
        height: 2px;
        background-image: linear-gradient(to right, var(--color-primario) 50%, transparent 50%);
        background-size: 10px 2px;
        background-repeat: repeat-x;
        z-index: -1;
    }
}


/* === 4. TARJETAS DE PRODUCTO "NUESTRA MERCADERÍA" === */
.product-card {
    border-radius: var(--border-radius-md);
    border: 1px solid #eee;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex; /* ✨ MEJORA: Flexbox para alinear el footer */
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: transparent;
}
.product-card .card-img-top {
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
}
.product-card .card-body {
    padding: 1.25rem;
    flex-grow: 1; /* ✨ MEJORA: El cuerpo crece para empujar el footer hacia abajo */
}
.product-card .card-title a {
    text-decoration: none;
    color: var(--dark-color);
    transition: color 0.2s ease;
}
.product-card .card-title a:hover {
    color: var(--color-primario);
}
.product-card .card-footer {
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

/* === ESTILOS MEJORADOS PARA LOS BOTONES DE LA TARJETA === */
.product-card .btn {
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease; /* Transición suave para todos los botones */
}

/* Estilo mejorado para el botón primario (Añadir) */
.product-card .btn-primary {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
}
.product-card .btn-primary:hover {
    background-color: var(--color-secundario); /* Cambia al color de acento */
    border-color: var(--color-secundario);
    transform: scale(1.05);
}

/* Estilo mejorado para el botón secundario (Detalles) */
.product-card .btn-outline-secondary {
    border-color: #ddd;
    color: var(--text-color);
}
.product-card .btn-outline-secondary:hover {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
    color: #fff;
}

/* Botones de la tarjeta: Acción Primaria vs. Secundaria */
.product-card .btn-primary {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
}
.product-card .btn-outline-secondary {
    border-color: #ccc;
    color: #555;
}
.product-card .btn-outline-secondary:hover {
    background-color: #eee;
    border-color: #ccc;
    color: #333;
}


/* === 5. BOTÓN FINAL "VER TODO EL CATÁLOGO" === */
#productos .btn-primary {
    padding: 1rem 2.5rem;
    font-weight: 600;
    border-radius: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#productos .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}



/*
=========================================================
** MEJORAS UI/UX PARA EL FLUJO DE COMPRA COMPLETO **
=========================================================
*/

/* === 1. PÁGINA DE CATÁLOGO Y BÚSQUEDA === */
/* Asegura que los títulos de estas páginas sean consistentes */
.catalogo-header, .busqueda-header {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--color-primario);
}


/* === 2. PÁGINA DE PRODUCTO DETALLADO (producto.php) === */
.producto-titulo {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--color-primario);
}
.producto-precio {
    color: var(--color-secundario);
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-secondary);
}

/* Indicador de Stock Mejorado */
.stock-badge {
    padding: 0.5em 1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.stock-badge.bg-success {
    background-color: rgba(25, 135, 84, 0.1) !important;
    color: #198754 !important;
}
.stock-badge.bg-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

/* Selector de Cantidad Mejorado */
.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 30px;
    max-width: 150px;
}
.quantity-selector .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    background: transparent;
    border: none;
    color: var(--text-color);
}
.quantity-selector .btn:hover {
    background-color: rgba(0,0,0,0.05);
}
.quantity-selector .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    width: 50px;
}

/* === 3. CARRITO DE COMPRAS (carrito.php) === */
.cart-item {
    border: 1px solid #eee;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}
.cart-item .item-details {
    flex-grow: 1;
}
.cart-item .item-price, .cart-item .item-subtotal {
    font-family: var(--font-secondary);
    font-weight: 600;
}
/* CÓDIGO NUEVO PARA REEMPLAZAR */
.cart-item .btn-remove {
    background-color: #9b200b;
    color: var(--text-color);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 1px solid #861313;
    transition: all 0.2s ease;

    /* ✨ MEJORA: Centrado perfecto con Flexbox ✨ */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Y asegúrate de tener esta regla para el ícono 'i' de adentro */
.cart-item .btn-remove i {
    font-size: 1.6rem; /* Ajusta el tamaño del ícono si es necesario */
    line-height: 1;    /* Previene cualquier altura de línea extra */
}

.order-summary-card {
    border: 1px solid #eee;
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    background: #fff;
    position: sticky;
    top: 120px; /* Ajusta según la altura de tu header */
}

/* === 4. PÁGINA DE CHECKOUT (checkout.php) === */
.checkout-form .card {
    border-radius: var(--border-radius-md);
    border: 1px solid #eee;
    box-shadow: none;
}
.checkout-form .form-control, .checkout-form .form-select {
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
}
.checkout-form .form-control:focus, .checkout-form .form-select:focus {
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(13, 45, 82, 0.15);
}

/* Opciones de envío mejoradas */
.shipping-options .list-group-item {
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    border: 2px solid #eee;
    transition: border-color 0.2s ease;
    cursor: pointer;
}
.shipping-options input[type="radio"] {
    display: none; /* Ocultamos el radio button original */
}
.shipping-options input[type="radio"]:checked + .list-group-item {
    border-color: var(--color-primario);
    background-color: rgba(13, 45, 82, 0.05);
}


/* === 5. PÁGINA DE AGRADECIMIENTO (gracias.php) === */
.thank-you-card {
    background-color: #fff;
    border-radius: var(--border-radius-md);
    padding: 3rem;
    border: 1px solid #eee;
    box-shadow: var(--shadow-light);
}
.thank-you-card .icon-success {
    font-size: 5rem;
    color: #198754;
}


/*
========================================
** ESTILOS MEJORADOS PARA CARRITO.PHP **
========================================
*/

.cart-item {
    background-color: #fff;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid #eee;
    transition: box-shadow 0.3s ease;
}

.cart-item:hover {
    box-shadow: var(--shadow-light);
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.cart-item .item-details {
    flex-grow: 1; /* Empuja el resto de elementos a la derecha */
}

.cart-item .item-name {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-item .item-price,
.cart-item .item-quantity {
    color: var(--text-color);
}

.cart-item .item-subtotal {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 100px;
    text-align: right;
}

.cart-item .btn-remove {
    background-color: #f8f9fa;
    color: var(--text-color);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.8rem;
    line-height: 1;
    padding: 0;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.cart-item .btn-remove:hover {
    background-color: var(--color-secundario);
    color: #fff;
    border-color: var(--color-secundario);
}

.order-summary-card {
    background-color: #fff;
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    border: 1px solid #eee;
    position: sticky;
    top: 120px; /* Se pega debajo del header al hacer scroll */
}

.order-summary-card .list-group-item {
    padding-left: 0;
    padding-right: 0;
    background-color: transparent;
}

/*
==================================================
** AJUSTES RESPONSIVOS PARA CARRITO.PHP (MÓVIL) **
==================================================
*/
@media (max-width: 991.98px) {
    /* En móvil, el resumen de la orden no es pegajoso */
    .order-summary-card {
        position: static;
        margin-bottom: 2rem; /* Espacio entre el resumen y los items */
    }

    /* Cada item del carrito se adapta */
    .cart-item {
        flex-wrap: wrap; /* Permite que los elementos pasen a la siguiente línea */
        gap: 0.75rem 1rem;
        padding: 1rem;
        position: relative; /* <<--- CORRECCIÓN CLAVE: Esto "ancla" el botón de eliminar. */
    }

    .cart-item img {
        width: 60px;
        height: 60px;
    }

    .cart-item .item-details {
        /* Ocupa el espacio restante al lado de la imagen */
        flex-basis: calc(100% - 70px - 1rem); 
        padding-right: 30px; /* Dejamos espacio para el botón X */
    }

    /* La cantidad y el subtotal ahora se alinean abajo */
    .cart-item .item-quantity {
        flex-basis: 50%;
        font-size: 0.9rem;
        color: var(--text-color);
    }

    .cart-item .item-subtotal {
        flex-basis: 50%;
        text-align: right;
        font-weight: 700;
        font-family: var(--font-secondary);
    }
    
    /* SOLUCIÓN: Botón de eliminar ahora posicionado correctamente */
    .cart-item .btn-remove {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        font-size: 1.6rem;
    }
}

/*
==================================================
** ESTILOS MEJORADOS PARA CHECKOUT.PHP **
==================================================
*/
.checkout-card {
    border-radius: var(--border-radius-md);
    padding: 1rem;
    border: 1px solid #eee;
}

/* Selección Principal de Método de Entrega */
.delivery-method-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.delivery-method-selection input[type="radio"] {
    display: none;
}
.delivery-option-card {
    border: 2px solid #eee;
    border-radius: var(--border-radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
}
.delivery-option-card:hover {
    border-color: #ccc;
}
.delivery-method-selection input[type="radio"]:checked + .delivery-option-card {
    border-color: var(--color-primario);
    background-color: rgba(13, 45, 82, 0.05);
    box-shadow: 0 0 0 3px rgba(13, 45, 82, 0.1);
}
.delivery-option-card i {
    font-size: 2rem;
    color: var(--color-primario);
    display: block;
    margin-bottom: 0.5rem;
}
.delivery-option-card span {
    font-weight: 600;
    font-family: var(--font-secondary);
}

/* Opciones de Envío (lista interna) */
.shipping-options .list-group-item {
    padding: 1rem;
    border-radius: var(--border-radius-sm) !important;
    margin-bottom: 0.5rem;
    border: 2px solid #eee;
    transition: border-color 0.2s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}
.shipping-options input[type="radio"] {
    display: none;
}
.shipping-options input[type="radio"]:checked + label {
    border-color: var(--color-primario);
    background-color: rgba(13, 45, 82, 0.05);
}
.shipping-options .badge {
    font-size: 0.9em;
    font-weight: 600;
}


/* REEMPLAZA LAS REGLAS ANTIGUAS DE .shipping-options CON ESTAS */

.shipping-options .list-group-item {
    padding: 1rem;
    border-radius: var(--border-radius-sm) !important;
    margin-bottom: 0.5rem;
    border: 2px solid #eee;
    transition: border-color 0.2s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.shipping-options input[type="radio"] {
    display: none;
}
.shipping-options input[type="radio"]:checked + .shipping-option-text + .shipping-option-cost,
.shipping-options:has(input[type="radio"]:checked) label:hover {
    /* Mantenemos el estilo del contenedor al seleccionar */
}
.list-group-item:has(input[type="radio"]:checked) {
    border-color: var(--color-primario);
    background-color: rgba(13, 45, 82, 0.05);
}

.shipping-option-text {
    flex-grow: 1; /* Ocupa el espacio disponible */
}

.shipping-option-cost {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primario);
    margin-left: 1rem; /* Espacio entre el texto y el costo */
}
.shipping-option-cost.text-secondary {
    font-size: 0.9rem;
    color: var(--text-color);
}


/*
==================================================
** ESTILOS PARA LA PÁGINA DE BÚSQUEDA (buscar.php) **
==================================================
*/
.search-page-form {
    position: relative;
}
.search-page-form .form-control {
    border-radius: 50px;
    padding: 1rem 1.5rem;
    padding-right: 60px; /* Espacio para el botón */
    border: 2px solid #eee;
}
.search-page-form .form-control:focus {
    border-color: var(--color-primario);
    box-shadow: 0 0 0 4px rgba(13, 45, 82, 0.1);
}
.search-page-form .btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 45px;
    height: 45px;
}


/*
============================================================
** ESTILO UNIFICADO PARA BOTONES DE ACCIÓN PRINCIPALES **
============================================================
*/

/* Aplica a cualquier botón que sea grande y primario */
.btn-primary.btn-lg {
    padding: 0.9rem 2.5rem;
    font-weight: 600;
    font-family: var(--font-secondary);
    text-transform: uppercase;
    border-radius: 50px; /* Forma de píldora */
    border-width: 2px;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.btn-primary.btn-lg:hover {
    transform: translateY(-4px); /* Efecto de "elevación" */
    box-shadow: var(--shadow-medium);
}


/*
========================================
** ESTILOS PARA LA SECCIÓN DE PROMOCIONES **
========================================
*/
.promo-card {
    display: block;
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    height: 350px; /* Altura fija para las tarjetas */
}

.promo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}

.promo-card .promo-image {
    width: 100%;
    height: 100%;
}

.promo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra todo el espacio */
    transition: transform 0.4s ease;
}

.promo-card:hover img {
    transform: scale(1.05); /* Sutil efecto de zoom al pasar el ratón */
}

.promo-card .promo-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
}

.promo-card .promo-title {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.promo-card .promo-text {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.promo-card .btn-promo {
    background-color: var(--color-secundario);
    color: #fff;
    font-weight: 600;
    border-radius: 30px;
    padding: 0.5rem 1.5rem;
    transition: background-color 0.2s ease;
}

.promo-card:hover .btn-promo {
    background-color: #fff;
    color: var(--dark-color);
}

/*
==================================================
** DISEÑO FINAL Y PULIDO PARA EL FOOTER **
==================================================
*/

.main-footer {
    background-color: var(--dark-color);
    color: rgba(255, 255, 255, 0.6);
    border-top: 4px solid var(--color-primario);
}

.footer-title {
    font-family: var(--font-secondary);
    color: #fff;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.75rem;
}

/* Línea de acento debajo de los títulos */
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background-color: var(--color-secundario);
}

/* Estilo especial para el logo en el footer */
.footer-title.logo-footer {
    font-size: 28px;
    color: #fff;
}
.footer-title.logo-footer span {
    color: var(--color-secundario);
}
.footer-title.logo-footer::after {
    display: none; /* El logo no necesita la línea de acento */
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.3s ease;
    display: inline-block;
}
.footer-links a:hover {
    color: #fff;
    padding-left: 5px; /* Efecto de desplazamiento */
}
.footer-links i {
    color: var(--color-secundario);
}

/* Barra inferior con derechos de autor y redes sociales */
.footer-bottom-bar {
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    padding: 1rem 0;
}

.social-icon {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    margin-left: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}
.social-icon:hover {
    color: var(--color-secundario);
    transform: translateY(-3px);
}

/*
==================================================
** ESTILOS PARA MAPA RESPONSIVO (CHECKOUT) **
==================================================
*/
.map-responsive {
    overflow: hidden;
    /* Proporción 4:3, puedes cambiar 75% por 56.25% para 16:9 */
    padding-bottom: 75%; 
    position: relative;
    height: 0;
    border-radius: var(--border-radius-sm); /* Bordes redondeados consistentes */
}

.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

/*
========================================
** ESTILOS PARA GALERÍA DE PRODUCTO **
========================================
*/
.product-gallery .main-image {
    border: 1px solid #eee;
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.product-gallery .main-image img {
    width: 100%;
    aspect-ratio: 1 / 1; /* Mantiene la imagen cuadrada */
    object-fit: cover;
}

.product-gallery .thumbnails {
    max-width: 100%;
    overflow-x: auto;
}

.product-gallery .thumbnail-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    border: 2px solid #eee;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.product-gallery .thumbnail-image:hover {
    opacity: 1;
}

.product-gallery .thumbnail-image.active {
    opacity: 1;
    border-color: var(--color-primario);
}


/* ====== Forzar 2x2 en móviles (≤576px) para reels y productos ====== */
@media (max-width: 575.98px) {
  /* Si están dentro de un .row de Bootstrap */
  #reels .row > [class*="col"],
  #productos .row > [class*="col"] {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Asegura buen espaciado vertical entre tarjetas */
  #reels .row > [class*="col"],
  #productos .row > [class*="col"] {
    margin-bottom: 0.75rem;
  }

  /* Videos e imágenes responsivas */
  #reels video,
  #productos .card-img-top {
    width: 100%;
    height: auto;
    display: block;
  }
}

/* Mejora: que las tarjetas llenen alto y el footer quede abajo */
#reels .card,
#productos .product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#reels .card > *:last-child,
#productos .product-card > *:last-child {
  margin-top: auto;
}


/* === INICIO CORRECCIÓN BOTONES DE TARJETA === */

/* Botón Añadir más compacto (APLICA A TODAS LAS TARJETAS) */
.product-card .card-footer .btn-primary {
    background-color: #0d2b52; /* azul oscuro corporativo */
    border: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 50px; /* esquinas redondeadas */
    display: flex;
    align-items: center;
    justify-content: center; /* Centra el contenido */
    gap: 4px;
}

/* Ícono más pequeño y centrado */
.product-card .card-footer .btn-primary i {
    font-size: 1rem;
}

/* Ajustar botón Detalles para que ambos tengan la misma altura */
.product-card .card-footer .btn-outline-secondary {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 50px;
}

/* === FIN CORRECCIÓN BOTONES DE TARJETA === */


/* ==================================================
** AJUSTES FINALES PARA MÓVILES (SOLUCIÓN) **
================================================== */
@media (max-width: 575.98px) {
    /* Oculta el texto "Añadir" en el botón del carrito en móviles */
    .product-card .btn-add-text {
        display: none;
    }

    /* Ajusta el botón para que no quede vacío y centra el icono */
    .product-card .card-footer .btn-primary {
        padding: 6px 10px;
    }
}