/*
 * AAM Good Shopping — Global Styles
 * Extras din: header.php + footer.php
 * Incarcat pe: TOATE paginile
 * ==========================================================================
 */

/* ==========================================================================
   1. ROOT CSS VARIABLES (Centralizate)
   ========================================================================== */
:root {
    /* Culori principale */
    --aam-bg-main: #0a0e1a;
    --aam-bg-secondary: #0f1629;
    --aam-bg-panel: #141b2d;
    --aam-bg-panel-hover: #1a2340;

    /* Accent */
    --aam-blue-deep: #1E3A8A;
    --aam-blue-main: #3B82F6;
    --aam-blue-light: #60A5FA;
    --aam-green: #10B981;

    /* Text */
    --aam-text-primary: #F1F5F9;
    --aam-text-secondary: #94A3B8;
    --aam-text-muted: #64748B;

    /* Border */
    --aam-border-subtle: rgba(59, 130, 246, 0.15);
    --aam-border-active: rgba(59, 130, 246, 0.35);

    /* Gradients */
    --aam-gradient-blue: linear-gradient(135deg, #1E3A8A, #3B82F6);

    /* Fonturi */
    --aam-font-main: 'Outfit', sans-serif;
    --aam-font-mono: 'JetBrains Mono', monospace;

    /* Tranzitii */
    --aam-transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Aliases pentru compatibilitate cu fisierele de pagina */
    --h-bg-primary: var(--aam-bg-main);
    --h-blue-main: var(--aam-blue-main);
    --h-blue-light: var(--aam-blue-light);
    --h-text-primary: var(--aam-text-primary);
    --h-text-secondary: var(--aam-text-secondary);
    --h-border-subtle: var(--aam-border-subtle);
    --h-gradient-blue: var(--aam-gradient-blue);
    --h-font-main: var(--aam-font-main);
    --h-font-mono: var(--aam-font-mono);
    --h-transition: var(--aam-transition);

    --f-bg-primary: var(--aam-bg-main);
    --f-bg-secondary: var(--aam-bg-secondary);
    --f-blue-main: var(--aam-blue-main);
    --f-blue-light: var(--aam-blue-light);
    --f-text-primary: var(--aam-text-primary);
    --f-text-secondary: var(--aam-text-secondary);
    --f-text-muted: var(--aam-text-muted);
    --f-border-subtle: var(--aam-border-subtle);
    --f-font-main: var(--aam-font-main);
    --f-font-mono: var(--aam-font-mono);
}

/* ==========================================================================
   2. RESETARI ASTRA (Header + Footer default ascunse)
   ========================================================================== */
.site-header,
#masthead,
.ast-main-header-wrap {
    display: none !important;
}

.site-footer,
#colophon,
.ast-builder-footer-wrap {
    display: none !important;
}

/* Reset liste: previne bullet-points orfane injectate de Astra pe paginile dark */
body.aam-dark-page ul,
body.aam-dark-page ol,
body.aam-dark-cart ul,
body.aam-dark-cart ol,
body.aam-contact-dark ul,
body.aam-contact-dark ol {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Exceptie: listele din continut legal (gdpr, termeni) trebuie sa pastreze stilul */
#aam-gdpr-page .legal-document ul,
#aam-gdpr-page .legal-document ol,
#aam-termeni-page .legal-document ul,
#aam-termeni-page .legal-document ol {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem 0;
}

/* Corectie layout pagina cont (elimina banda alba) */
body.woocommerce-account .site-content,
body.woocommerce-account #content,
body.woocommerce-account #primary,
body.page-template-page-my-account .site-content,
body.page-template-page-my-account #content,
body.page-template-page-my-account #primary,
body.page-template-page-contul-meu .site-content,
body.page-template-page-contul-meu #content,
body.page-template-page-contul-meu #primary {
    background-color: var(--aam-bg-main) !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* ==========================================================================
   3. STILURI BANNER PNRR (header.php)
   ========================================================================== */
.pnrr-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 52px;
    background-color: #ffffff;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--aam-border-subtle);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pnrr-banner-link {
    display: inline-block;
}

.pnrr-banner-link img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 36px;
}

/* ==========================================================================
   4. HEADER PRINCIPAL
   ========================================================================== */
.aam-custom-header {
    position: fixed;
    top: 52px;
    left: 0;
    width: 100%;
    z-index: 10001;
    padding: 20px 0;
    background: var(--aam-bg-main);
    border-bottom: 1px solid var(--aam-border-subtle);
    transition: top 0.3s ease, background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
    font-family: var(--aam-font-main);
}

.aam-custom-header.is-scrolled {
    top: 0;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 0;
    border-bottom: 1px solid var(--aam-border-subtle);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.aam-header-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.aam-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--aam-text-primary);
    transition: transform 0.3s ease;
}

.aam-logo:hover {
    transform: translateY(-1px);
}

.aam-logo__icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--aam-gradient-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.aam-logo__text {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1;
}

.aam-logo__text span {
    color: var(--aam-blue-light);
    font-weight: 500;
}

/* Navigatie Desktop */
.aam-nav {
    display: block;
}

.aam-nav__list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.aam-nav__link {
    text-decoration: none;
    color: var(--aam-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.aam-nav__link:hover,
.aam-nav__link.current-menu-item {
    color: var(--aam-text-primary);
    background: rgba(59, 130, 246, 0.1);
}

/* CTA Button */
.aam-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.aam-btn-cta {
    background: var(--aam-gradient-blue);
    color: white !important;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.aam-btn-cta:hover {
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* Burger */
.aam-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10002;
    position: relative;
    /* FIX: min-width si min-height pentru zona de touch pe mobil */
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
}

.aam-burger span {
    width: 24px;
    height: 2px;
    background: var(--aam-text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.aam-burger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.aam-burger.is-active span:nth-child(2) {
    opacity: 0;
}

.aam-burger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay Mobil */
/* FIX z-index: trebuie sa fie > header (10001) si > burger (10002) */
.aam-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10003;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.aam-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.aam-mobile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.aam-mobile-overlay.is-open .aam-mobile-nav {
    transform: translateY(0);
}

.aam-mobile-nav a {
    text-decoration: none;
    color: var(--aam-text-secondary);
    font-size: 1.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
    font-family: var(--aam-font-main);
}

.aam-mobile-nav a:hover,
.aam-mobile-nav a.current-menu-item {
    color: var(--aam-blue-light);
}

.aam-mobile-contact {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid var(--aam-border-subtle);
    padding-top: 30px;
    width: 80%;
}

.aam-mobile-contact span {
    display: block;
    font-family: var(--aam-font-mono);
    font-size: 0.8rem;
    color: var(--aam-text-muted);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVE: MOBIL (< 921px)
   FIX: !important pe .aam-burger pentru a preveni suprascrierile
        WooCommerce / Astra native care pot seta display:none pe butoane
   ========================================================================== */
@media (max-width: 921px) {
    .aam-nav {
        display: none !important;
    }

    .aam-btn-cta {
        display: none !important;
    }

    .aam-burger {
        display: flex !important;
    }

    /* Asigura ca header-ul ramane vizibil si nu este suprascrieren de Astra */
    .aam-custom-header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Previne overflow-ul orizontal pe mobil */
    .aam-header-container {
        padding: 0 16px;
    }
}

/* ==========================================================================
   5. FOOTER PRINCIPAL
   ========================================================================== */
.aam-custom-footer {
    background-color: var(--aam-bg-main);
    border-top: 1px solid var(--aam-border-subtle);
    padding: 60px 0 30px;
    font-family: var(--aam-font-main);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.aam-custom-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.aam-footer-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Meniu Footer */
.aam-footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    flex-wrap: wrap;
}

.aam-footer-nav a {
    color: var(--aam-text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.aam-footer-nav a:hover {
    color: var(--aam-blue-light);
}

/* PNRR Footer */
.pnrr-footer {
    width: 100%;
    max-width: 980px;
    margin: 0 0 28px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.015) 100%);
    padding: 18px 20px;
}

.pnrr-title,
.pnrr-disclaimer {
    margin: 0;
    color: var(--aam-text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

.pnrr-title {
    color: var(--aam-text-primary);
    font-weight: 600;
}

.pnrr-links {
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pnrr-links a {
    color: var(--aam-blue-light);
    text-decoration: none;
    font-size: 0.8rem;
    font-family: var(--aam-font-mono);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.pnrr-links a:hover {
    color: var(--aam-text-primary);
}

/* Badge-uri legale */
.legal-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.legal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 168px;
    min-height: 62px;
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.legal-badge:hover {
    transform: translateY(-2px);
    border-color: var(--aam-border-subtle);
    background: rgba(59, 130, 246, 0.06);
}

.stripe-badge-link {
    min-width: 214px;
}

.legal-badge-img {
    display: block;
    width: auto;
    height: 44px;
    object-fit: contain;
}

.stripe-badge-img {
    display: block;
    width: auto;
    height: 32px;
    object-fit: contain;
}

.legal-badge-fallback {
    display: none;
    color: var(--aam-text-secondary);
    font-family: var(--aam-font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.4;
    padding: 0 6px;
}

.legal-badge-img.is-broken,
.stripe-badge-img.is-broken {
    display: none;
}

.legal-badge-img.is-broken+.legal-badge-fallback,
.stripe-badge-img.is-broken+.legal-badge-fallback {
    display: inline-block;
}

/* Social Links */
.aam-footer-social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 34px 0;
    flex-wrap: wrap;
}

.aam-footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--aam-text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: var(--aam-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.aam-footer-social-link:hover {
    color: var(--aam-text-primary);
    border-color: var(--aam-border-subtle);
    background: rgba(59, 130, 246, 0.06);
}

.aam-footer-social-link .social-icon-placeholder {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Footer Bottom */
.aam-footer-bottom {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.aam-footer-copy {
    font-size: 0.9rem;
    color: var(--aam-text-secondary);
    margin: 0;
}

.aam-footer-copy strong {
    color: var(--aam-text-primary);
    font-weight: 600;
}

.aam-footer-company-info {
    font-size: 0.85rem;
    color: var(--aam-text-muted);
    margin: 0;
    font-family: var(--aam-font-mono);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .aam-custom-footer {
        padding: 40px 0 20px;
    }

    .aam-footer-nav {
        gap: 20px;
        flex-direction: column;
        text-align: center;
        margin-bottom: 30px;
    }

    .pnrr-footer {
        padding: 16px 14px;
        margin-bottom: 22px;
    }

    .pnrr-links {
        gap: 8px;
    }

    .legal-badges {
        gap: 10px;
        margin-bottom: 22px;
    }

    .legal-badge {
        width: 100%;
        max-width: 280px;
        min-height: 56px;
    }

    .legal-badge-img {
        height: 40px;
    }

    .aam-footer-social-links {
        margin-bottom: 26px;
    }

    .aam-footer-social-link {
        width: 100%;
        justify-content: center;
        max-width: 260px;
    }

    .aam-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}