/* =========================================
   VARIABLES Y ESTILOS BASE
========================================= */
:root {
    --primary-blue: #0056b3;
    --dark-blue: #001f4d;
    --accent-red: #ff4757;
    --bg-light: #f8f9fa;
    --text-main: #1a1a1a;
    --text-muted: #666;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0; 
    padding: 0; 
    color: var(--text-main); 
    background: #fff;
}

/* =========================================
   HEADER PRINCIPAL (Logo, Buscador, Usuario)
========================================= */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo { 
    height: 60px; 
    width: auto;
    object-fit: contain;
}

.search-container {
    flex: 1;
    max-width: 450px;
    margin: 0 30px;
}

.search-container form {
    display: flex;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    outline: none;
    font-size: 14px;
}

.search-container button {
    padding: 10px 20px;
    background-color: var(--dark-blue);
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-weight: 600;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 14px;
}

.btn-vendor { 
    color: var(--primary-blue) !important; 
    font-weight: 600 !important;
}

.cart-link {
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 20px;
}

.cart-count { 
    background: var(--accent-red); 
    color: white; 
    border-radius: 50%; 
    padding: 2px 6px; 
    font-size: 11px; 
}

/* =========================================
   MEGA MENÚ DESPLEGABLE (CENTRAD0 a 1200px)
========================================= */
.categories-nav {
    background: #fff;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
    position: relative;
    display: flex;
    justify-content: center; /* Centra el menú horizontalmente */
}

/* Contenedor principal que limita el ancho del menú */
.menu-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
}

.categories-nav ul.main-menu {
    display: flex;
    list-style: none;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    width: 100%;
}

.mega-dropdown {
    position: static; 
}

.mega-dropdown > a {
    display: block;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.mega-dropdown:hover > a {
    background-color: var(--accent-red);
    color: #fff;
}

/* El gran panel oculto */
.mega-menu {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%; /* Toma el 100% de los 1200px del contenedor */
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    
    /* Grid layout para columnas limpias */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px; 
    padding: 40px;
    box-sizing: border-box;
    border: 1px solid #eee;
    border-top: none;
    
    /* Efecto de aparición */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
}

.mega-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Columnas internas del Mega Menú */
.mega-column {
    display: flex;
    flex-direction: column;
}

.mega-column:not(:first-child) {
    border-left: 1px solid #f0f0f0;
    padding-left: 30px;
}

.mega-column h4 {
    font-size: 13px;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.mega-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-column ul li {
    margin-bottom: 12px;
}

.mega-column ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    transition: 0.2s;
    display: block;
    text-transform: none;
}

.mega-column ul li a:hover {
    color: var(--primary-blue);
    padding-left: 5px;
}

/* =========================================
   BANNER HERO Y CATEGORÍAS
========================================= */
.hero-banner {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    color: white; 
    text-align: center; 
    padding: 80px 20px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.hero-banner h1 { 
    font-size: 2.5rem; 
    margin: 0 0 15px 0; 
    font-weight: 300; 
    letter-spacing: 2px; 
}

.hero-banner p { 
    font-size: 1.1rem; 
    margin-bottom: 25px; 
    font-weight: 300; 
}

.btn-primary {
    background: #fff; 
    color: var(--dark-blue); 
    padding: 12px 25px; 
    text-decoration: none; 
    font-weight: bold; 
    text-transform: uppercase; 
    border-radius: 4px; 
    transition: 0.3s; 
    font-size: 13px; 
    letter-spacing: 1px;
}

.btn-primary:hover { 
    background: var(--bg-light); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
}

.category-blocks { 
    display: flex; 
    gap: 20px; 
    padding: 0 5%; 
    margin-bottom: 50px; 
}

.cat-block { 
    flex: 1; 
    height: 250px; 
    background: #eee; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    color: white; 
    font-size: 1.5rem; 
    font-weight: bold; 
    background-size: cover; 
    background-position: center; 
    border-radius: 6px; 
    overflow: hidden; 
    transition: 0.3s; 
}

.cat-block::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.3); 
    transition: 0.3s; 
}

.cat-block:hover::before { 
    background: rgba(0,0,0,0.1); 
}

.cat-block:hover { 
    transform: translateY(-3px); 
}

.cat-block span { 
    position: relative; 
    z-index: 2; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 1.2rem;
}

/* =========================================
   CUADRÍCULA DE PRODUCTOS
========================================= */
.section-title { 
    text-align: center; 
    font-size: 1.8rem; 
    font-weight: 300; 
    margin-bottom: 30px; 
    letter-spacing: 1px;
}

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 30px; 
    padding: 0 5% 60px; 
}

.product-card { 
    position: relative; 
    transition: 0.3s; 
    background: #fff; 
    border-radius: 6px; 
    overflow: hidden; 
    border: 1px solid #eee; 
}

.product-card:hover { 
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); 
    transform: translateY(-3px); 
}

.product-img-wrapper { 
    position: relative; 
    overflow: hidden; 
    background: var(--bg-light); 
    aspect-ratio: 3/4;
}

.product-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.badge-new { 
    position: absolute; 
    top: 10px; left: 10px; 
    background: var(--text-main); 
    color: #fff; 
    padding: 4px 8px; 
    font-size: 10px; 
    font-weight: bold; 
    border-radius: 3px;
}

.badge-discount { 
    position: absolute; 
    top: 10px; right: 10px; 
    background: var(--accent-red); 
    color: #fff; 
    padding: 4px 8px; 
    font-size: 10px; 
    font-weight: bold; 
    border-radius: 3px;
}

.product-info { 
    padding: 15px; 
    text-align: left; 
}

.product-brand { 
    font-size: 11px; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-weight: 600; 
    margin-bottom: 5px; 
    letter-spacing: 0.5px;
}

.product-title { 
    font-size: 15px; 
    margin: 0 0 10px 0; 
    font-weight: 400; 
    color: var(--text-main); 
}

.product-prices { 
    display: flex; 
    gap: 10px; 
    align-items: baseline; 
    margin-bottom: 15px;
}

.price-current { 
    color: var(--accent-red); 
    font-size: 17px; 
    font-weight: bold; 
}

.price-old { 
    color: var(--text-muted); 
    text-decoration: line-through; 
    font-size: 13px; 
}

.btn-add { 
    width: 100%; 
    background: var(--text-main); 
    color: #fff; 
    border: none; 
    padding: 12px; 
    cursor: pointer; 
    text-transform: uppercase; 
    font-weight: 600; 
    font-size: 11px; 
    letter-spacing: 1px; 
    transition: 0.3s; 
    border-radius: 4px; 
}

.btn-add:hover { 
    background: var(--primary-blue); 
}

/* =========================================
   FOOTER
========================================= */
.main-footer { 
    background: #111; 
    color: #aaa; 
    padding: 50px 5% 20px; 
    margin-top: 60px; 
    font-size: 14px;
}

.footer-grid { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 30px; 
    flex-wrap: wrap; 
    gap: 30px;
}

.footer-col h4 { 
    margin-bottom: 15px; 
    color: #fff; 
    font-size: 16px; 
    font-weight: 500; 
    letter-spacing: 1px;
}

.footer-col a { 
    display: block; 
    color: #aaa; 
    text-decoration: none; 
    margin-bottom: 8px; 
    transition: 0.2s;
}

.footer-col a:hover { 
    color: #fff; 
}

.footer-bottom { 
    text-align: center; 
    border-top: 1px solid #222; 
    padding-top: 20px; 
    font-size: 13px; 
    color: #666;
}