/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
   :root {
    /* --- COLORES CORPORATIVOS --- */
    --color-primary: #0038E3;       /* Azul Rey */
    --color-primary-dark: #0028a3;  /* Azul Oscuro (Hover) */
    --color-secondary: #00D4FF;     /* Celeste Brillante */
    
    /* --- COLORES DE TEXTO Y FONDO --- */
    --color-text: #5f6c72;
    --color-heading: #253D4E;
    --color-border: #ececec;
    --color-white: #ffffff;
    --bg-light: #f7f8fd;

    /* --- ALERTAS Y ESTADOS --- */
    --color-danger: #ff4d4d;
    --color-warning: #ff9800;
    --color-success: #3bb77e;

    /* --- FUENTES --- */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Quicksand', sans-serif;
}

/* --- RESET BÁSICO --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: var(--font-primary); 
    color: var(--color-text); 
    font-size: 15px; 
    line-height: 1.6; 
    background-color: var(--color-white);
    overflow-x: hidden; 
    width: 100%;
}

/* --- TIPOGRAFÍA --- */
h1, h2, h3, h4, h5, h6 { 
    font-family: var(--font-heading); 
    color: var(--color-heading); 
    font-weight: 800; 
    margin-bottom: 10px; 
    letter-spacing: -0.03em; 
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; }

/* --- CONTENEDOR MAESTRO --- */
.container { 
    max-width: 1320px; 
    margin: 0 auto; 
    padding: 0 15px; 
    width: 100%;
}

/* --- UTILIDADES --- */
.d-flex-between { display: flex; justify-content: space-between; align-items: center; }
.d-flex-center { display: flex; align-items: center; justify-content: center; }
.pb-80 { padding-bottom: 80px; }


/* ==========================================================================
   2. HEADER & NAVEGACIÓN
   ========================================================================== */

/* --- TOP BAR --- */
.header-top { background-color: #f3f3f3; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--color-border); }
.top-left span b { color: var(--color-primary); font-weight: 700; }
.top-list { display: flex; gap: 20px; }
.top-list a:hover { color: var(--color-primary); }

/* --- MIDDLE HEADER --- */
.header-middle { padding: 30px 0; }

.brand-logo { display: flex; align-items: center; max-width: 200px; }
.brand-logo img { height: auto; width: 100%; max-height: 80px; }

/* Buscador */
.search-area { flex-grow: 1; max-width: 600px; margin: 0 40px; position: relative; }
.search-form { display: flex; position: relative; }
.search-form input { width: 100%; padding: 15px 20px; border: 1px solid var(--color-border); border-radius: 5px; background: #f3f3f3; outline: none; font-family: var(--font-heading); font-weight: 600; }
.search-form button { position: absolute; right: 0; top: 0; height: 100%; width: 60px; background: var(--color-primary); color: white; border: none; border-radius: 0 5px 5px 0; cursor: pointer; font-size: 1.2rem; }

/* Resultados Búsqueda en Vivo */
.search-results-dropdown { position: absolute; top: 100%; left: 0; width: 100%; background: white; border-radius: 0 0 8px 8px; box-shadow: 0 10px 20px rgba(0,0,0,0.15); z-index: 1001; display: none; overflow: hidden; border: 1px solid #eee; }
.search-results-dropdown.active { display: block; }
.search-item { display: flex; align-items: center; padding: 10px 15px; border-bottom: 1px solid #f5f5f5; text-decoration: none; color: #333; transition: background 0.2s; cursor: pointer; }
.search-item:hover { background-color: #f0f7ff; }
.search-item:last-child { border-bottom: none; }
.search-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; border: 1px solid #eee; margin-right: 12px; background: white; }
.search-item-info h4 { margin: 0; font-size: 14px; font-weight: 600; font-family: var(--font-heading); color: var(--color-heading); }
.search-item-info span { font-size: 12px; color: var(--color-primary); font-weight: 700; }

/* Acciones de Usuario (Perfil, Carrito) */
.header-actions { display: flex; align-items: center; gap: 30px; }
.actions-icons { display: flex; gap: 15px; align-items: center; }

.user-profile-widget { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: 10px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-primary); }
.user-name { font-family: var(--font-heading); font-weight: 700; color: var(--color-heading); font-size: 14px; }
.user-name small { display: block; font-size: 11px; color: #888; font-weight: 500; }

.icon-btn { font-size: 1.5rem; color: var(--color-heading); position: relative; transition: 0.3s; }
.icon-btn:hover { color: var(--color-primary); transform: translateY(-2px); }
.icon-btn .count { position: absolute; top: -5px; right: -8px; background: var(--color-secondary); color: white; font-size: 11px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; border: 2px solid #fff; }
.cart-btn { display: flex; align-items: center; gap: 10px; }
.total-price { font-size: 15px; font-weight: 800; color: var(--color-text); margin-left: 5px; font-family: var(--font-heading); }

/* --- BOTTOM HEADER (NAV) --- */
.header-bottom { border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); background: white; }

/* Botón Categorías */
.categories-btn { background: var(--color-primary); color: white; border: none; padding: 15px 25px; font-weight: 800; font-family: var(--font-heading); font-size: 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: 5px 5px 0 0; position: relative; transition: 0.3s; }
.categories-btn:hover { background: var(--color-primary-dark); }
.categories-dropdown-wrap { position: relative; }
.categories-list { position: absolute; top: 100%; left: 0; width: 100%; background: white; border: 1px solid var(--color-border); display: none; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.1); min-width: 250px; }
.categories-dropdown-wrap:hover .categories-list { display: block; }
.categories-list li a { display: block; padding: 12px 20px; border-bottom: 1px solid #f5f5f5; font-weight: 600; font-family: var(--font-heading); color: var(--color-heading); }
.categories-list li a:hover { color: var(--color-primary); padding-left: 25px; }

/* Menú Principal */
.main-nav ul { display: flex; gap: 40px; }
.main-nav a { font-weight: 800; font-family: var(--font-heading); color: var(--color-heading); font-size: 16px; display: block; padding: 15px 0; letter-spacing: 0.3px; }
.main-nav a:hover, .main-nav a.active { color: var(--color-primary); }

.header-offer-link a { color: var(--color-primary); font-weight: 800; font-family: var(--font-heading); }
.badge-hot { background: var(--color-secondary); color: white; padding: 2px 6px; border-radius: 3px; font-size: 10px; vertical-align: top; margin-left: 3px; font-weight: 800; }


/* ==========================================================================
   3. COMPONENTES DE INTERFAZ (BOTONES, BADGES)
   ========================================================================== */

/* Botón Primario */
.btn-primary { background: var(--color-primary); color: white; padding: 16px 45px; border-radius: 30px; font-weight: 800; font-family: var(--font-heading); display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; border: 2px solid var(--color-primary); transition: 0.3s; cursor: pointer; }
.btn-primary:hover { background: transparent; color: var(--color-primary); transform: translateY(-3px); border-color: var(--color-primary); }

/* Badges (Etiquetas) */
.badge-discount { position: absolute; top: 20px; left: 20px; background: #f74b81; color: white; padding: 5px 12px; border-radius: 5px; font-size: 12px; font-weight: 800; z-index: 2; font-family: var(--font-heading); }
.badge-new { position: absolute; top: 10px; left: 10px; background: var(--color-secondary); color: white; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; z-index: 10; text-transform: uppercase; }
.badge-agotado { position: absolute; top: 10px; left: 10px; background: var(--color-danger); color: white; padding: 4px 8px; font-size: 11px; font-weight: 800; border-radius: 4px; z-index: 10; text-transform: uppercase; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.badge-low-stock { position: absolute; top: 10px; left: 10px; background: var(--color-warning); color: white; padding: 4px 8px; font-size: 11px; font-weight: 800; border-radius: 4px; z-index: 10; text-transform: uppercase; box-shadow: 0 2px 5px rgba(0,0,0,0.2); animation: pulse 2s infinite; }
.badge-offer { position: absolute; top: 10px; right: 10px; background: var(--color-danger); color: white; padding: 4px 8px; font-size: 11px; font-weight: 800; border-radius: 4px; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* Animaciones */
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }


/* ==========================================================================
   4. HOME PAGE (HERO, FEATURES)
   ========================================================================== */

/* Hero Section */
.hero-wrapper { height: 500px; background-size: cover; background-position: center; display: flex; align-items: center; border-radius: 10px; margin-top: 20px; position: relative; overflow: hidden; }
.hero-content { padding-left: 80px; max-width: 600px; }
.hero-content .subtitle { color: var(--color-primary); font-weight: 800; font-family: var(--font-heading); letter-spacing: 1.5px; display: block; margin-bottom: 15px; text-transform: uppercase; font-size: 0.9rem; }
.hero-content h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 20px; color: var(--color-heading); font-weight: 900; }
.hero-content p { font-size: 1.2rem; color: #7e7e7e; margin-bottom: 30px; font-weight: 500; }
.hero-content .price-tag { font-size: 1.8rem; font-weight: 800; color: var(--color-heading); margin-bottom: 30px; font-family: var(--font-heading); }
.hero-content .price-tag span { color: var(--color-primary); font-size: 2.2rem; }

/* Features */
.features-section { padding: 50px 0; }
.features-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.feature-item { display: flex; align-items: center; gap: 20px; background: var(--bg-light); padding: 25px; border-radius: 10px; flex: 1; min-width: 200px; transition: 0.3s; border: 1px solid transparent; }
.feature-item:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.05); border-color: #eef1f8; background: white; }
.feature-item img { width: 50px; height: 50px; }
.feature-item h3 { font-size: 18px; margin-bottom: 5px; font-weight: 800; }
.feature-item p { margin: 0; font-size: 13px; color: #7e7e7e; font-weight: 500; }

/* Promo Banners */
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.promo-item { height: 280px; background-size: cover; background-position: center; border-radius: 10px; display: flex; align-items: center; padding: 50px; position: relative; overflow: hidden; transition: 0.3s; }
.promo-item:hover { transform: scale(1.02); }
.promo-item .content { position: relative; z-index: 2; }
.promo-item .content span { color: var(--color-secondary); font-weight: 800; font-family: var(--font-heading); font-size: 1rem; margin-bottom: 10px; display: block; }
.promo-item .content h3 { font-size: 32px; margin: 10px 0 20px; font-weight: 800; line-height: 1.2; }
.btn-underline { text-decoration: none; font-weight: 800; color: var(--color-heading); font-family: var(--font-heading); border-bottom: 2px solid var(--color-heading); padding-bottom: 2px; transition: 0.3s; }
.btn-underline:hover { color: var(--color-primary); border-color: var(--color-primary); }


/* ==========================================================================
   5. CATÁLOGO & PRODUCTOS
   ========================================================================== */

/* Breadcrumb */
.breadcrumb-area { background-color: var(--bg-light); padding: 20px 0; margin-bottom: 50px; }
.breadcrumb-content ul { display: flex; align-items: center; gap: 10px; }
.breadcrumb-content a { font-weight: 600; color: var(--color-heading); font-family: var(--font-heading); }
.breadcrumb-content a:hover { color: var(--color-primary); }
.breadcrumb-content .divider { color: #ccc; font-size: 12px; }
.breadcrumb-content .active { color: var(--color-text); font-weight: 500; }

/* Layout y Sidebar */
.shop-section { padding-bottom: 80px; }
.shop-layout { display: flex; gap: 30px; align-items: flex-start; } /* Flex para estructura */
.shop-sidebar { width: 25%; flex-shrink: 0; }
.shop-content { width: 75%; flex-grow: 1; }

/* Widgets */
.widget { margin-bottom: 40px; border: 1px solid var(--color-border); border-radius: 10px; padding: 25px; background: white; }
.widget-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; position: relative; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.widget-title::after { content:''; position: absolute; bottom: -1px; left: 0; width: 50px; height: 2px; background: var(--color-primary); }

.price-slider-wrapper input[type=range] { width: 100%; margin-bottom: 15px; accent-color: var(--color-primary); }
.price-info { font-size: 14px; font-weight: 600; margin-bottom: 15px; color: var(--color-heading); }
.btn-filter { background: var(--color-heading); color: white; border: none; padding: 8px 20px; border-radius: 30px; font-weight: 700; cursor: pointer; transition: 0.3s; font-size: 13px; }
.btn-filter:hover { background: var(--color-primary); }

.alphabet-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.alpha-btn { width: 30px; height: 30px; border: 1px solid var(--color-border); background: #fff; color: var(--color-text); border-radius: 4px; font-weight: 600; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.alpha-btn:hover, .alpha-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.alpha-btn:first-child { width: auto; padding: 0 10px; }

/* Form Elements */
.form-select { width: 100%; padding: 12px 15px; border: 1px solid var(--color-border); border-radius: 5px; font-family: var(--font-primary); color: var(--color-text); background-color: #fff; cursor: pointer; outline: none; font-size: 14px; appearance: none; }
.form-select:focus { border-color: var(--color-primary); }

/* Banner Widget */
.widget-banner { padding: 0; border: none; overflow: hidden; }
.banner-img { height: 300px; background-size: cover; background-position: center; border-radius: 10px; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; }
.banner-img::before { content:''; position: absolute; inset:0; background: rgba(0,0,0,0.3); border-radius: 10px; }
.banner-content { position: relative; z-index: 2; color: white; }
.banner-content span { font-family: var(--font-heading); font-weight: 700; color: var(--color-secondary); }
.banner-content h4 { font-size: 24px; color: white; margin: 10px 0; font-weight: 800; }
.banner-content a { color: white; text-decoration: underline; font-weight: 700; }

/* Botón Filtro Móvil */
.btn-mobile-filter { display: none; width: 100%; background-color: #f8f9fa; border: 1px solid #ddd; padding: 12px; text-align: left; font-weight: 700; color: var(--color-heading); margin-bottom: 20px; cursor: pointer; border-radius: 5px; font-family: var(--font-heading); }
.btn-mobile-filter i { margin-right: 8px; color: var(--color-primary); }

/* --- PRODUCT CARD (DISEÑO PRINCIPAL) --- */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 30px; width: 100%; }

.product-card { 
    border: 1px solid var(--color-border); 
    border-radius: 15px; 
    padding: 20px; 
    position: relative; 
    transition: 0.3s; 
    background: white; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}
.product-card:hover { border-color: var(--color-primary); box-shadow: 0 10px 20px rgba(0,0,0,0.08); transform: translateY(-5px); }

/* Imagen del Producto */
.product-thumb { position: relative; margin-bottom: 20px; overflow: hidden; border-radius: 10px; height: 220px; background-color: #fff; padding: 10px; }
.product-thumb > a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; transition: 0.3s; mix-blend-mode: multiply; }
.product-card:hover .product-thumb img { transform: scale(1.05); }

/* Botones de Acción (Hover) */
.product-thumb .actions { position: absolute; bottom: -50px; left: 0; width: 100%; display: flex; justify-content: center; gap: 10px; transition: 0.3s; z-index: 3; pointer-events: none; opacity: 0; }
.product-card:hover .product-thumb .actions { bottom: 10px; opacity: 1; }
.product-thumb .actions button { pointer-events: auto; width: 45px; height: 45px; border-radius: 50%; border: none; background: white; color: var(--color-heading); font-size: 18px; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.product-thumb .actions button:hover { background: var(--color-primary); color: white; transform: scale(1.1); }

/* Info del Producto */
.rating { color: #FFB41B; font-size: 12px; margin-bottom: 10px; font-weight: 700; text-transform: uppercase; }
.product-info h3 { font-size: 17px; margin-bottom: 10px; font-weight: 800; line-height: 1.4; }
.product-info h3 a { color: var(--color-heading); }
.product-info h3 a:hover { color: var(--color-primary); }

/* Precios */
.product-info .price { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); margin-top: auto; }
.product-info .price del, .price-old { color: #adadad; font-size: 15px; font-weight: 600; text-decoration: line-through; }
.product-info .price ins, .price-new { color: var(--color-primary); font-size: 20px; font-weight: 800; text-decoration: none; }
.price-new { color: var(--color-danger) !important; } /* Rojo para ofertas */

/* Producto Agotado */
.product-card.agotado { opacity: 0.7; filter: grayscale(100%); pointer-events: none; }
.product-card.agotado .actions button { pointer-events: auto; } /* Permitir ver detalle */
.product-card.agotado .btn-disabled { background-color: #ccc !important; cursor: not-allowed; color: #666; }

/* Vista de Lista */
.products-grid.list-view { display: flex; flex-direction: column; gap: 20px; }
.products-grid.list-view .product-card { flex-direction: row; align-items: center; text-align: left; max-width: 100%; }
.products-grid.list-view .product-thumb { width: 200px; flex-shrink: 0; margin-right: 30px; margin-bottom: 0; }
.products-grid.list-view .product-info { align-items: flex-start; }

/* Toolbar & Paginación */
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; background: var(--bg-light); padding: 15px 20px; border-radius: 10px; margin-bottom: 30px; border: 1px solid #eef1f8; }
.result-count { font-size: 14px; color: var(--color-text); font-weight: 500; margin: 0; }
.toolbar-right { display: flex; gap: 15px; align-items: center; }
.orderby { border: 1px solid var(--color-border); padding: 8px 15px; border-radius: 5px; color: var(--color-heading); font-weight: 600; outline: none; cursor: pointer; font-family: var(--font-primary); font-size: 14px; }
.view-switcher button { background: white; border: 1px solid var(--color-border); width: 35px; height: 35px; border-radius: 5px; cursor: pointer; color: #adadad; transition: 0.3s; }
.view-switcher button.active, .view-switcher button:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.shop-pagination { display: flex; justify-content: center; gap: 10px; margin-top: 50px; }
.shop-pagination ul { display: flex; gap: 10px; }
.shop-pagination ul li a { width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--color-border); border-radius: 50%; color: var(--color-heading); font-weight: 700; font-family: var(--font-heading); transition: all 0.3s ease; background: #fff; font-size: 16px; }
.shop-pagination ul li a:hover, .shop-pagination ul li a.active { background: var(--color-primary); color: #ffffff; border-color: var(--color-primary); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 56, 227, 0.2); }


/* ==========================================================================
   6. PÁGINA DE OFERTAS
   ========================================================================== */
.offers-header { background: linear-gradient(135deg, #ff5722 0%, #ff9800 100%); padding: 60px 0; text-align: center; color: white; margin-bottom: 40px; position: relative; overflow: hidden; border-radius: 0 0 20px 20px; }
.offers-header h1 { font-size: 3rem; margin-bottom: 10px; text-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.offers-header p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

.countdown-timer { background-color: #fff0f0; color: #d32f2f; border: 1px solid #ffcdd2; padding: 5px 10px; border-radius: 6px; margin: 10px 15px 0; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; animation: fadeIn 0.5s ease; }
.countdown-timer i { animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }


/* ==========================================================================
   7. BLOG (ESTILOS AGREGADOS Y CORREGIDOS)
   ========================================================================== */
.blog-hero { background: linear-gradient(rgba(0, 56, 227, 0.8), rgba(0, 56, 227, 0.6)), url('https://img.freepik.com/foto-gratis/vista-superior-surtido-medicamentos_23-2148529759.jpg'); background-size: cover; background-position: center; padding: 80px 20px; text-align: center; color: white; margin-bottom: 50px; border-radius: 0 0 30px 30px; }
.blog-hero h1 { font-family: var(--font-heading); font-size: 3rem; font-weight: 800; margin-bottom: 15px; animation: fadeInDown 0.8s ease; }
.blog-hero p { font-size: 1.2rem; max-width: 700px; margin: 0 auto; opacity: 0.9; animation: fadeInUp 0.8s ease 0.2s backwards; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; padding-bottom: 80px; }

.blog-card { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: all 0.4s ease; display: flex; flex-direction: column; border: 1px solid #f0f0f0; animation: fadeInUp 0.6s ease backwards; }
.blog-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 56, 227, 0.15); }

.blog-thumb { height: 220px; overflow: hidden; position: relative; }
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.blog-card:hover .blog-thumb img { transform: scale(1.1); }

.blog-category { position: absolute; top: 15px; left: 15px; background: var(--color-primary); color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.blog-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.blog-date { color: #999; font-size: 0.85rem; margin-bottom: 10px; display: block; }
.blog-date i { color: var(--color-primary); margin-right: 5px; }
.blog-content h3 { font-family: var(--font-heading); font-size: 1.4rem; margin-bottom: 15px; line-height: 1.3; color: var(--color-heading); transition: color 0.3s; }
.blog-card:hover .blog-content h3 { color: var(--color-primary); }
.blog-content p { color: #666; font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.btn-read-more { margin-top: auto; align-self: flex-start; color: var(--color-primary); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: gap 0.3s; }
.btn-read-more:hover { gap: 10px; text-decoration: underline; }


/* ==========================================================================
   8. CARRITO (MODAL)
   ========================================================================== */
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9998; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-sidebar { position: fixed; top: 0; right: -400px; width: 400px; max-width: 100%; height: 100%; background: #fff; z-index: 9999; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: right 0.3s ease; display: flex; flex-direction: column; }
.cart-sidebar.active { right: 0; }

.cart-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; background: var(--color-primary); color: white; }
.cart-header h3 { margin: 0; font-size: 1.2rem; display: flex; gap: 10px; align-items: center; color: white; }
.btn-close-cart { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

.cart-body { flex: 1; padding: 20px; overflow-y: auto; }
.empty-cart-msg { text-align: center; padding: 40px 20px; color: #777; }
.empty-cart-msg i { font-size: 3rem; color: #ccc; margin-bottom: 15px; display: block; }

.cart-item { display: flex; gap: 15px; padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.cart-item img { width: 70px; height: 70px; object-fit: contain; border-radius: 5px; border: 1px solid #eee; }
.cart-item-details { flex: 1; }
.cart-item-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 5px; color: var(--color-heading); display: block; }
.cart-item-price { color: var(--color-primary); font-weight: 700; }

.cart-item-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.qty-control { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 4px; }
.qty-btn { background: #f9f9f9; border: none; width: 25px; height: 25px; cursor: pointer; font-weight: bold; }
.qty-input { width: 30px; text-align: center; border: none; font-size: 12px; }
.btn-remove { color: var(--color-danger); background: rgba(255,77,77,0.1); border: none; cursor: pointer; font-size: 1rem; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-remove:hover { background: var(--color-danger); color: white; }

.cart-footer { padding: 20px; border-top: 1px solid #eee; background: #f9f9f9; }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 1.1rem; font-weight: 800; color: var(--color-heading); }
.btn-checkout { width: 100%; background: var(--color-primary); color: white; border: none; padding: 15px; border-radius: 30px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-checkout:hover { background: var(--color-primary-dark); transform: translateY(-2px); }


/* ==========================================================================
   9. MODAL DETALLE (SWEETALERT)
   ========================================================================== */
.swal2-popup { font-family: 'Quicksand', sans-serif !important; border-radius: 15px !important; }
.modal-product-img { width: 100%; max-height: 350px; object-fit: contain; border-radius: 10px; background-color: #fff; padding: 10px; border: 1px solid #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.btn-modal-add {
    background: linear-gradient(45deg, var(--color-primary), #0056b3) !important;
    color: white !important; border: none !important; padding: 12px 35px !important; font-size: 1rem !important; font-weight: 700 !important; border-radius: 50px !important; 
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.4) !important; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.3s ease !important; outline: none !important; display: inline-flex; align-items: center; gap: 10px;
}
.btn-modal-add:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 86, 179, 0.6) !important; filter: brightness(1.1); }
.btn-modal-add:active { transform: translateY(1px); box-shadow: 0 2px 10px rgba(0, 86, 179, 0.4) !important; }


/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.footer-section { background-color: var(--color-heading); color: #fff; padding-top: 80px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 50px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-widget h3 { color: white; margin-bottom: 25px; font-size: 1.5rem; font-weight: 800; }
.footer-widget p { color: #b6b6b6; margin-bottom: 20px; font-size: 15px; }
.footer-widget ul li { margin-bottom: 15px; }
.footer-widget ul li a { color: #b6b6b6; display: flex; align-items: center; gap: 10px; transition: 0.2s; }
.footer-widget ul li a:hover { color: var(--color-secondary); padding-left: 5px; }
.socials a { width: 45px; height: 45px; background: var(--color-primary); color: white; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; margin-right: 10px; transition: 0.3s; font-size: 1.2rem; }
.socials a:hover { background: var(--color-secondary); transform: translateY(-3px); }
.footer-bottom { padding: 30px 0; display: flex; justify-content: space-between; align-items: center; color: #b6b6b6; font-size: 14px; }


/* ==========================================================================
   11. RESPONSIVE GLOBAL
   ========================================================================== */

/* Tablet & Mobile Header */
@media (max-width: 991px) {
    .header-middle .container { flex-direction: column; gap: 10px; padding: 15px; }
    .search-area { width: 100%; order: 3; margin-top: 10px; }
    .search-form { width: 100%; display: flex; }
    .header-actions {order: 2;width: 100%;display: flex;justify-content: space-between;align-items: center;flex-direction: column-reverse;}
    .brand-logo { order: 1; align-self: center; margin-bottom: 10px; }
    
    /* Menú Scroll Horizontal */
    .header-bottom { background: #fff; }
    .header-bottom .container { flex-direction: row; align-items: center; padding: 0; width: 100%; overflow: hidden; }
    .categories-dropdown-wrap, .header-offer-link { display: none; }
    .main-nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .main-nav::-webkit-scrollbar { display: none; }
    .main-nav ul { display: flex; flex-wrap: nowrap; gap: 15px; padding: 15px; margin: 0; white-space: nowrap; }
    .main-nav ul li a {display: inline-block;padding: 8px 15px;background-color: #f4f6f8;border-radius: 20px;color: var(--color-heading);font-weight: 600;font-size: 14px;}
    .main-nav ul li a.active {background-color: var(--color-primary);color: white;}
    
    /* Layouts Generales en Móvil */
    .shop-layout { grid-template-columns: 1fr; display: flex; flex-direction: column; }
    .shop-sidebar { display: none; width: 100%; margin-bottom: 30px; animation: fadeIn 0.3s ease; }
    .shop-sidebar.active { display: block; }
    .shop-content { width: 100%; }
    .btn-mobile-filter { display: block; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .hero-wrapper { height: auto; padding: 60px 20px; text-align: center; }
    .hero-content { padding: 0; margin: 0 auto; }
    .hero-content h1 { font-size: 2.5rem; }
    .features-grid, .promo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Grids de Productos */
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .products-grid.offers-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    /* Blog Responsive */
    .blog-hero h1 { font-size: 2rem; }
    .blog-grid { grid-template-columns: 1fr; }
    
    /* Modal y Headers */
    .modal-product-detail { flex-direction: column !important; align-items: center !important; }
    .modal-img, .modal-info { width: 100% !important; text-align: center !important; }
    .modal-product-img { max-height: 250px; }
    .offers-header h1 { font-size: 2rem; }
}

@media (max-width: 480px) {
    /* Ajustes Finos Móvil Pequeño */
    .cart-sidebar { width: 100%; right: -100%; }
    .cart-sidebar.active { right: 0; }
    .product-card { min-height: auto; }
    .product-thumb img { height: 150px; }
    .user-name { display: none; }
    .products-grid.list-view .product-card { display: block; text-align: center; }
    .products-grid.list-view .product-thumb { width: 100%; margin-right: 0; }
    .products-grid.offers-grid { grid-template-columns: 1fr; }
}

/* =========================================
   DISEÑO HEADER DE SECCIÓN (MODERNO)
   ========================================= */

.section-header {
    display: flex;
    justify-content: space-between; /* Título a la izquierda, tabs a la derecha */
    align-items: flex-end; /* Alineados a la línea de base */
    margin-bottom: 40px;
    border-bottom: 1px solid var(--color-border); /* Línea gris sutil en todo el ancho */
    padding-bottom: 15px;
    position: relative;
    flex-wrap: wrap; /* Para que se adapte en móviles */
    gap: 20px;
}

/* Estilo del Título H2 */
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-heading);
    margin: 0;
    position: relative;
    line-height: 1;
}

/* La línea azul decorativa debajo del título */
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -16px; /* Justo sobre el borde gris del contenedor */
    left: 0;
    width: 80px; /* Ancho de la línea decorativa */
    height: 3px;
    background-color: var(--color-primary); /* Azul Rey */
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 56, 227, 0.3); /* Sombra suave azul */
}

/* Estilo de la lista de pestañas (Tabs) */
.nav-tabs {
    display: flex;
    list-style: none;
    gap: 30px; /* Espacio entre opciones */
    margin: 0;
    padding: 0;
}

.nav-tabs li {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #adadad; /* Gris claro por defecto */
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs li a {
    text-decoration: none;
    color: inherit; /* Hereda el color del li */
    display: block;
}

/* Efectos Hover y Activo */
.nav-tabs li:hover {
    color: var(--color-heading); /* Se oscurece al pasar el mouse */
    transform: translateY(-2px);
}

.nav-tabs li.active {
    color: var(--color-primary); /* Azul para el activo */
}

/* Pequeño punto debajo del activo (Opcional, detalle elegante) */
.nav-tabs li.active::after {
    content: '';
    position: absolute;
    bottom: -17px; /* A la misma altura que la línea del título */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

/* --- RESPONSIVE (MÓVIL) --- */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column; /* Uno debajo del otro */
        align-items: flex-start;
        gap: 15px;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .nav-tabs {
        gap: 20px;
        font-size: 1rem;
    }
}

/* =========================================
   ESTILOS CARRUSEL HERO (SWIPER)
   ========================================= */

/* Ajuste del contenedor del slide */
.hero-wrapper {
    position: relative;
    width: 100%;
    height: 500px; /* Altura fija para consistencia */
    background-size: cover;
    background-position: center;
    border-radius: 15px; /* Bordes redondeados modernos */
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Capa oscura suave para asegurar que el texto se lea siempre */
.hero-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    z-index: 1;
}

/* El contenido debe estar encima de la capa */
.hero-content {
    position: relative;
    z-index: 2;
    padding-left: 80px;
    max-width: 650px;
}

/* Personalización de los controles de Swiper (Flechas y Puntos) */
.heroSwiper {
    border-radius: 15px;
    overflow: hidden;
}

.swiper-button-next, .swiper-button-prev {
    color: var(--color-primary); /* Tu azul */
    background: rgba(255, 255, 255, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 20px;
    font-weight: bold;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.swiper-pagination-bullet-active {
    background: var(--color-primary) !important;
    width: 30px;
    border-radius: 5px;
}

/* --- ANIMACIONES DE TEXTO DENTRO DEL SLIDE --- */
/* Estado inicial (oculto) */
.swiper-slide [data-animate] {
    opacity: 0;
    transition: all 0.8s ease-out;
}

/* Animación fadeInDown */
.swiper-slide [data-animate="fadeInDown"] {
    transform: translateY(-30px);
}

/* Animación fadeInUp */
.swiper-slide [data-animate="fadeInUp"] {
    transform: translateY(30px);
}

/* Estado final (visible cuando el slide está activo) */
.swiper-slide-active [data-animate] {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-wrapper {
        height: 400px; /* Más pequeño en celular */
        background-position: right center;
    }
    .hero-wrapper::before {
        background: rgba(255,255,255,0.85); /* Más opaco en móvil para leer mejor */
    }
    .hero-content {
        padding-left: 30px;
        padding-right: 30px;
        text-align: center; /* Centrado en móvil */
        margin: 0 auto;
    }
    .swiper-button-next, .swiper-button-prev {
        display: none; /* Ocultar flechas en móvil, usar swipe */
    }
}

/* =========================================
   ESTILOS LOGO CON TEXTO
   ========================================= */

/* 1. El contenedor del enlace (imagen + texto) */
.brand-logo {
    display: flex;           /* Activa Flexbox para alinear horizontalmente */
    align-items: center;     /* Centra verticalmente la imagen con el texto */
    text-decoration: none;   /* Quita el subrayado del enlace */
    gap: 12px;               /* Espacio entre la imagen y el texto */
}

/* 2. Ajuste de la imagen del logo (opcional, para asegurar tamaño) */
.brand-logo img {
    max-height: 50px; /* Ajusta esto según el tamaño real de tu imagen */
    width: auto;      /* Mantiene la proporción */
}

/* 3. Estilos del texto "Sialab Medic" */
.brand-text {
    color: var(--color-primary); /* Usa tu variable de azul principal. Si no te funciona, usa un código hex como #004aad */
    font-family: var(--font-heading, sans-serif); /* Usa tu tipografía de títulos */
    font-weight: 800;        /* Texto bien grueso (negrita) */
    font-size: 1.6rem;       /* Tamaño del texto */
    line-height: 1;          /* Altura de línea compacta */
    white-space: nowrap;     /* Evita que el texto se rompa en dos líneas */
    letter-spacing: -0.5px;  /* Un poquito más junto para que se vea compacto */
}

/* (Opcional) Ajuste para móviles si el nombre es muy largo */
@media (max-width: 480px) {
    .brand-text {
        font-size: 1.3rem; /* Texto un poco más pequeño en celulares */
        display: none; /* Opcional: Si quieres ocultar el texto en pantallas MUY pequeñas y dejar solo el icono, descomenta esta línea */
    }
    .brand-logo {
        gap: 0;
    }
}