/*
 * Audit UX/UI — P2 polish (CSS quick wins)
 * Items: 20 (card hover), 27 (typography hierarchy), 28 (search border),
 *        31 (loading state CTA), 35 (sticky category bar mobile),
 *        36 (progress indicator checkout), 41 (small text contrast)
 * Created: 2026-05-21
 */

/* ============================================================
 * P2.20 — Hover state pe carduri produs
 * ============================================================ */
.product-card-box {
    transition: box-shadow .2s ease, transform .2s ease;
    border-radius: var(--nr-radius-s, 8px);
}
.product-card-box:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}
.product-card-box:hover .product-title {
    color: var(--nr-green-primary, #023A15);
}
.product-card-box img {
    transition: transform .3s ease;
}
.product-card-box:hover .img-box img {
    transform: scale(1.03);
}

/* ============================================================
 * P2.27 — Ierarhie tipografică h1/h2/h3
 * Avada are H1=H2=26px. Recomandare audit: 32/24/20.
 * (Notă: pentru a-l face permanent, schimbă în Avada Options →
 *  Global Typography → H1/H2/H3 Typography → Font Size.)
 * ============================================================ */
main h1,
.fusion-page-title-bar h1,
.product-info-wrapper h1,
.post-content h1,
.entry-title {
    font-size: clamp(28px, 4vw, 36px) !important;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 0.5em;
}
main h2,
.section-heading h2,
.post-content h2 {
    font-size: clamp(22px, 3vw, 28px) !important;
    line-height: 1.25;
    font-weight: 600;
}
main h3,
.post-content h3,
.section-heading h3 {
    font-size: 20px !important;
    line-height: 1.3;
    font-weight: 600;
}

/* ============================================================
 * P2.28 — Search bar: border + contrast vizual
 * ============================================================ */
.fusion-search-form .s,
.fusion-search-form .fusion-live-search-input,
input.search-field {
    border: 1px solid var(--nr-border, #E5E5E5) !important;
    border-radius: var(--nr-radius-s, 8px) !important;
    padding: 10px 14px !important;
    background-color: #FFFFFF !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fusion-search-form .s:focus,
.fusion-search-form .fusion-live-search-input:focus,
input.search-field:focus {
    border-color: var(--nr-green-primary, #023A15) !important;
    box-shadow: 0 0 0 3px rgba(2, 58, 21, 0.12) !important;
    outline: none !important;
}
/* Lupa search aliniată */
.fusion-search-form .fusion-search-button,
.fusion-search-form button[type="submit"] {
    border-radius: 0 var(--nr-radius-s, 8px) var(--nr-radius-s, 8px) 0;
}

/* ============================================================
 * P2.31 — Loading state pentru CTA-uri (add-to-cart, checkout)
 * Folosit prin .is-loading class adăugat din JS la click.
 * WC AJAX add-to-cart bagă deja .loading pe link — exploatăm asta.
 * ============================================================ */
.add_to_cart_button.loading,
.single_add_to_cart_button.loading,
.fusion-button.is-loading,
.checkout-button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}
.add_to_cart_button.loading::after,
.single_add_to_cart_button.loading::after,
.fusion-button.is-loading::after,
.checkout-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: nr-spin .7s linear infinite;
}
@keyframes nr-spin {
    to { transform: rotate(360deg); }
}
/* Ascundem iconul WC default care nu se vede pe verde */
.add_to_cart_button.loading::before {
    display: none !important;
}

/* ============================================================
 * P2.35 — Bara de categorii sticky pe mobile
 * Target: .headercatmenu (wrapper) sau .wc-main-categories
 * Avada header e sticky pe desktop; pe mobile e doar la top.
 * ============================================================ */
@media (max-width: 980px) {
    .headercatmenu,
    .swiper.headercatmenu,
    .wc-main-categories-wrapper {
        position: sticky !important;
        top: 60px; /* sub mobile header */
        z-index: 90;
        background-color: #FFFFFF;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        padding: 8px 0;
    }
    /* Fade gradient dreapta să indice scrollabilitate */
    .headercatmenu::after,
    .wc-main-categories-wrapper::after {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to right, transparent, #FFFFFF);
        pointer-events: none;
    }
}

/* Fade gradient și pe desktop (audit 4.4 punct 1) */
.headercatmenu,
.wc-main-categories-wrapper {
    position: relative;
}
@media (min-width: 981px) {
    .headercatmenu::after,
    .wc-main-categories-wrapper::after {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 60px;
        background: linear-gradient(to right, transparent, #FFFFFF);
        pointer-events: none;
        z-index: 2;
    }
}

/* ============================================================
 * P2.36 — Progress indicator subtle pe checkout
 * Bara subțire la top care arată câți pași sunt completați.
 * Custom checkout-ul folosește expandable steps cu .checkout-step
 * și .completed / .active states.
 * ============================================================ */
.woocommerce-checkout #payment,
.woocommerce-checkout .checkout-steps,
.checkout-page-wrapper {
    position: relative;
}
.woocommerce-checkout .checkout-steps::before,
.checkout-page-wrapper::before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 3px;
    background: linear-gradient(
        to right,
        var(--nr-green-primary, #023A15) var(--nr-checkout-progress, 33%),
        #E5E5E5 var(--nr-checkout-progress, 33%)
    );
    z-index: 100;
    margin-bottom: 16px;
    border-radius: 0 0 4px 4px;
    transition: --nr-checkout-progress 0.3s ease;
}

/* Indicator vizual mai clar pentru pașii completați */
.checkout-step.completed .step-number,
.checkout-step.is-completed .step-number {
    background-color: var(--nr-green-primary, #023A15) !important;
    color: #FFFFFF !important;
}
.checkout-step.completed .step-number::after {
    content: " ✓";
}

/* ============================================================
 * P2.17 — Mobile menu refactor: section headers + CTA footer
 * Section header items have class .menu-item--section (set in DB).
 * ============================================================ */

/* Section header label: uppercase, gray, no link behavior, no chevron */
.awb-menu li.menu-item--section {
    pointer-events: none;
    margin-top: 20px;
    margin-bottom: 6px;
    padding: 8px 18px;
    border-top: 1px solid var(--nr-border, #E5E5E5);
}
.awb-menu li.menu-item--section:first-child {
    border-top: none;
    margin-top: 0;
}
.awb-menu li.menu-item--section > a {
    pointer-events: none;
    cursor: default;
    background: transparent !important;
}
.awb-menu li.menu-item--section .menu-text,
.awb-menu li.menu-item--section > a .menu-text {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 1.2px;
    color: #8A8A8A !important;
    text-transform: uppercase;
}
/* Hide submenu arrow / accordion control on section headers */
.awb-menu li.menu-item--section .awb-menu__sub-toggle,
.awb-menu li.menu-item--section .submenu-toggle,
.awb-menu li.menu-item--section > a::after {
    display: none !important;
}

/* Footer CTA in mobile menu panel (injected by JS) */
.nr-mobile-menu-cta {
    margin-top: 24px;
    padding: 16px 18px;
    border-top: 1px solid var(--nr-border, #E5E5E5);
    background-color: #F5F7F4;
}
.nr-mobile-menu-cta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #8A8A8A;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}
.nr-mobile-menu-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--nr-green-primary, #023A15) !important;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    min-height: 44px;
}
.nr-mobile-menu-cta-link:hover {
    color: var(--nr-green-primary-hv, #0A5C24) !important;
    text-decoration: underline;
}
.nr-mobile-menu-cta-link svg {
    flex-shrink: 0;
}

/* ============================================================
 * P2.14 — Trust signals zona buy-box PDP
 * Block sub butonul "Adaugă în coș" cu 4 puncte de încredere.
 * ============================================================ */
.nr-trust-signals {
    margin-top: 18px;
    padding: 14px 16px;
    background: #F5F7F4;
    border-radius: var(--nr-radius-s, 8px);
    border: 1px solid var(--nr-border, #E5E5E5);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--nr-text-body, #333333);
}
.nr-trust-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nr-trust-row svg {
    flex-shrink: 0;
    color: var(--nr-green-primary, #023A15);
}
.nr-trust-row strong {
    color: var(--nr-text-dark, #1A1A1A);
    font-weight: 600;
}
.nr-trust-row a {
    color: var(--nr-green-primary, #023A15) !important;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.nr-trust-row a:hover {
    text-decoration: underline;
}

/* Pe mobile — și mai compact */
@media (max-width: 600px) {
    .nr-trust-signals {
        padding: 12px;
        font-size: 12px;
        gap: 8px;
    }
    .nr-trust-row svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================================
 * P2.22 — Footer payment / trust logos aliniate uniform
 *
 * Audit: logo-uri footer "lipite la sfârșit" fără ritm vizual,
 *        Euplatesc (1200×296px native) afișat enorm.
 * Fix:  toate logo-urile la max-height 48px, centrat, gap uniform.
 *
 * NOTĂ: există duplicate în footer (SOL.svg de 2 ori, Euplatesc 2 variante).
 *       Pentru a le elimina permanent, editează din Avada Builder
 *       → Footer Layout → Image Elements (imageframe 7-10).
 *       CSS-ul de mai jos doar le aliniază.
 * ============================================================ */
.fusion-tb-footer .fusion-imageframe img[src*="Raiffeisen"],
.fusion-tb-footer .fusion-imageframe img[src*="Euplatesc"],
.fusion-tb-footer .fusion-imageframe img[src*="EuPlatesc"],
.fusion-tb-footer .fusion-imageframe img[src*="SOL.svg"],
.fusion-tb-footer .fusion-imageframe img[src*="anpc"],
.fusion-tb-footer .fusion-imageframe img[src*="ANPC"],
.fusion-tb-footer .fusion-imageframe img[src*="visa" i],
.fusion-tb-footer .fusion-imageframe img[src*="mastercard" i],
.fusion-tb-footer .fusion-imageframe img[src*="maestro" i],
.fusion-tb-footer .fusion-imageframe img[src*="netopia" i] {
    max-height: 48px !important;
    width: auto !important;
    height: auto !important;
    max-width: 180px !important;
    object-fit: contain;
    margin: 0 12px;
}

/* Wrappers — center align uniform */
.fusion-tb-footer .fusion-image-element {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    display: flex;
    justify-content: center;
    align-items: center;
}
.fusion-tb-footer .fusion-imageframe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Pe mobile — și mai compact */
@media (max-width: 768px) {
    .fusion-tb-footer .fusion-imageframe img[src*="Raiffeisen"],
    .fusion-tb-footer .fusion-imageframe img[src*="Euplatesc"],
    .fusion-tb-footer .fusion-imageframe img[src*="EuPlatesc"],
    .fusion-tb-footer .fusion-imageframe img[src*="SOL.svg"],
    .fusion-tb-footer .fusion-imageframe img[src*="anpc"] {
        max-height: 36px !important;
        max-width: 140px !important;
        margin: 0 8px;
    }
}

/* ============================================================
 * P2.41 — Contrast text mic (preț unitar, brand link, categorie)
 * Audit: text gri pe alb sub 4.5:1 WCAG AA
 * ============================================================ */
.calculated-price,
.price-per-unit,
.price-per,
.product-card-box .calculated-price,
.woocommerce-loop-product__title small {
    color: #595959 !important; /* contrast 7:1 vs alb */
    font-weight: 500;
}

.product-brand,
.product-brand a,
.product-card-box .product-brand a {
    color: #595959 !important;
}
.product-brand a:hover {
    color: var(--nr-green-primary, #023A15) !important;
    text-decoration: underline;
}

.product-category-name,
.product-card-box .product-category-name {
    color: #595959 !important;
}

/* Originea produsului (steagul) — text mai lizibil */
.product-origin-text,
.origin-text {
    color: #4A4A4A !important;
    font-size: 13px;
}
