/* =====================================================================
   ESTILOS BASE
   Solo estructura, header, footer, layout, grid básico
   ===================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #F3F4F6;
    color: #374151;
}

/* =====================================================================
   HEADER
   ===================================================================== */

.header {
    background: linear-gradient(135deg, #F8FAFC, #E2E8F0);
    border-bottom: 3px solid #1E3A8A;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
}

.nav-container {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    line-height: 0;
}

.logo-img {
    display: block;
    height: 60px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #1E3A8A;
}

.search-bar {
    flex: 1;
    max-width: 440px;
    margin: 0 2rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #D1D5DB;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.search-bar input:focus {
    outline: none;
    border-color: #1E3A8A;
}

.search-bar-submit {
    flex-shrink: 0;
    padding: 0.7rem 1rem;
    background-color: #1E3A8A;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-bar-submit:hover {
    background-color: #1D4ED8;
}

.user-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #1E3A8A;
    color: white;
}

.btn-primary:hover {
    background-color: #1D4ED8;
}

.btn-outline {
    background-color: transparent;
    color: #1E3A8A;
    border: 2px solid #1E3A8A;
}

.btn-outline:hover {
    background-color: #1E3A8A;
    color: white;
}

.cart-icon {
    position: relative;
    background-color: #1E3A8A;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #DC2626;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================================
   LAYOUT PRINCIPAL
   ===================================================================== */

.main-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr 250px;
    gap: 2rem;
    padding: 2rem 1rem;
}

/* =====================================================================
   SIDEBAR IZQUIERDO
   ===================================================================== */

.sidebar {
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    height: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar h3 {
    color: #1E3A8A;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.category-group {
    margin-bottom: 1.5rem;
}

.category-group ul {
    list-style: none;
    margin-left: 1rem;
}

.category-group li {
    margin: 0.5rem 0;
}

.category-group a {
    text-decoration: none;
    color: #374151;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.category-group a:hover {
    color: #1E3A8A;
    font-weight: 500;
}

/* =====================================================================
   AREA DE CONTENIDO
   ===================================================================== */

.content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-banner {
    position: relative;
    background-color: #1a2b52;
    /* Capa semitransparente (no es blur): baja el alfa para ver mejor la foto; sube alfa si el texto pierde contraste */
    background-image: linear-gradient(135deg, rgba(30, 58, 138, 0.45), rgba(15, 35, 72, 0.38)), var(--hero-banner-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: clamp(1.75rem, 5vw, 3rem) clamp(1rem, 4vw, 2.5rem);
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    min-height: clamp(200px, 32vw, 340px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.hero-banner h1 {
    font-size: clamp(1.55rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.85);
    max-width: 42rem;
    line-height: 1.2;
}

.hero-banner p {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    opacity: 0.98;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.75);
    max-width: 40rem;
    line-height: 1.45;
    margin: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    border-color: #1E3A8A;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.product-image {
    width: 100%;
    height: 150px;
    background-color: #F3F4F6;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1E3A8A;
    margin-bottom: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* =====================================================================
   SIDEBAR DERECHO
   ===================================================================== */

.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.right-sidebar .promo-banner {
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.right-sidebar .promo-banner.featured {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD);
    border: 2px solid #1E3A8A;
}

.right-sidebar .promo-banner h4 {
    color: #1E3A8A;
    margin-bottom: 0.5rem;
}

.right-sidebar .promo-banner p {
    font-size: 0.9rem;
    color: #374151;
    margin: 0 0 1rem 0;
}

.right-sidebar .promo-banner a,
.right-sidebar .promo-banner button {
    text-decoration: none !important;
    width: 100%;
    display: block;
    margin-top: 0.8rem;
}

.right-sidebar .promo-banner .btn {
    width: 100%;
    text-decoration: none;
}

/* =====================================================================
   FOOTER
   ===================================================================== */

.footer {
    background-color: #374151;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 0 1rem;
}

.footer-section h4 {
    color: #F8FAFC;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin: 0.5rem 0;
}

.footer-section a {
    color: #D1D5DB;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4B5563;
    margin-top: 2rem;
    color: #9CA3AF;
}

/* =====================================================================
   MENU MOVIL
   ===================================================================== */

.mobile-menu {
    display: none;
    background-color: #1E3A8A;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #F8FAFC, #E2E8F0);
        border-bottom: 3px solid #1E3A8A;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
        padding: 0.25rem 0 0.75rem;
        z-index: 150;
    }

    .header.nav-menu-open .nav-menu {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .nav-menu li {
        border-bottom: 1px solid #e5e7eb;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 0.9rem 1.25rem;
    }

    .mobile-menu {
        display: block;
    }

    .logo {
        flex-shrink: 0;
    }

    .search-bar {
        margin: 0 0.5rem;
        max-width: none;
        flex: 1 1 auto;
        min-width: 0;
        order: 5;
        flex-basis: 100%;
    }

    .search-bar-submit {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
    }

    .nav-container {
        padding: 0 1rem;
        position: relative;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .main-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .sidebar,
    .right-sidebar {
        order: 2;
    }

    .content {
        order: 1;
    }

    .hero-banner {
        min-height: clamp(180px, 42vw, 260px);
        padding: 1.35rem 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}