/*
Theme Name: VN Core Theme
Theme URI: https://vietnhat.vn
Description: Multi-brand, performance-first custom theme for kitchen appliance e-commerce. VN Network — Whitelabeled.
Version: 4.0.0
Author: Antigravity - WordPress System Architect
Author URI: https://antigravity.dev
Text Domain: vn-core-theme
Tags: e-commerce, minimalist, multi-brand, performance, kitchen-appliances
*/

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--vn-font-body, var(--font-body, 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif));
    color: var(--vn-color-text, var(--text-dark, #1A361A));
    background-color: var(--bg-pure, #FFFFFF);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

ul, ol {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================================
   GLOBAL CSS CUSTOM PROPERTIES (FALLBACK DEFAULTS)
   Brand-specific overrides are in brands/{domain}/style.css
   ============================================================ */
:root {
    /* Brand Palette - defaults to bepdienhongngoai.com palette */
    --primary-green:  #84CC16;
    --primary-hover:  #65A30D;
    --primary-light:  rgba(132, 204, 22, 0.1);
    --primary-glow:   rgba(132, 204, 22, 0.25);
    --text-dark:      #1A361A;
    --text-muted:     #6B7280;
    --text-light:     #9CA3AF;
    --bg-pure:        #FFFFFF;
    --bg-soft:        #F9F9F9;
    --bg-card:        #FFFFFF;
    --border-light:   #E5E7EB;
    --red-sale:       #EF4444;
    --red-sale-bg:    #FEF2F2;

    /* Typography — detailed scale in assets/css/typography.css */
    --font-heading:   'StagSansVU', 'Be Vietnam Pro', Arial, sans-serif;
    --font-body:      'Be Vietnam Pro', Arial, sans-serif;

    /* Spacing */
    --container-max:  1480px;
    --section-gap:    80px;
    --gutter:         clamp(18px, 2vw, 32px);

    /* Effects */
    --radius-sm:      4px;
    --radius-md:      8px;
    --radius-lg:      16px;
    --shadow-card:    0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover:   0 8px 32px rgba(0, 0, 0, 0.12);
    --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Header */
    --header-height:  80px;
}

/* ============================================================
   CONTAINER UTILITY
   ============================================================ */
/* Container sizing — canonical rules in assets/css/layout-container.css */

/* ============================================================
   GLOBAL BUTTON STYLES
   ============================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: var(--primary-green);
    color: #FFFFFF;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    background-color: transparent;
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

/* ============================================================
   TYPOGRAPHY GLOBALS (scale tokens: assets/css/typography.css)
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--vn-font-heading, var(--font-heading));
    line-height: 1.2;
    color: var(--vn-color-text, var(--text-dark));
    font-weight: 500;
}

.section-title {
    font-size: clamp(31px, 3.4vw, 46px);
    font-weight: 500;
    letter-spacing: normal;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 400;
    max-width: 540px;
    line-height: 1.7;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 3px;
}

/* ==========================================================================
   ⚡ FIX: REMOVE DUPLICATE SALE PERCENTAGE FROM PRICE ROW
   ========================================================================== */
/* Hide any sale badge or percentage tags inside the price container */
ul.products li.product .price .onsale,
ul.products li.product .price [class*="percent"],
.products .product .price [class*="percent"],
.products .product .price .sale-percentage,
.products .product .price .badge {
    display: none !important;
}

/* Re-optimize price wrap alignment now that percentage is removed */
ul.products li.product .price,
.products .product .price {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important; 
    gap: 8px !important;
    white-space: nowrap !important;
    margin-bottom: 10px !important;
}

/* Current Price style */
ul.products li.product .price ins,
.products .product .price ins,
ul.products li.product .price > .amount,
.products .product .price > .amount {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #f37022 !important; /* Force matching brand orange if needed */
    text-decoration: none !important;
}

/* Old Strike-through Price style */
ul.products li.product .price del,
.products .product .price del,
ul.products li.product .price del .amount,
.products .product .price del .amount {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #999 !important;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.vn-404-page {
    background: #fff;
}

.vn-404-page__hero {
    display: flex;
    min-height: clamp(460px, 62vh, 680px);
    align-items: center;
    justify-content: center;
    padding: clamp(70px, 8vw, 120px) 20px;
    text-align: center;
}

.vn-404-page__container {
    width: 100%;
}

.vn-404-page__content {
    width: min(100%, 920px);
    margin-inline: auto;
}

.vn-404-page__code {
    margin: 0 0 28px;
    color: #050505;
    font-size: clamp(130px, 20vw, 240px);
    font-weight: 500;
    line-height: 0.78;
    letter-spacing: -0.07em;
}

.vn-404-page__title {
    margin: 0;
    color: #111;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 600;
    line-height: 1.3;
}

.vn-404-page__description {
    max-width: 760px;
    margin: 18px auto 0;
    color: #888;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.7;
}

.vn-404-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 42px;
}

.vn-404-page__button {
    display: inline-flex;
    min-width: 160px;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    padding: 12px 30px;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.vn-404-page__button--ghost {
    background: #fff;
    color: #111;
}

.vn-404-page__button:hover,
.vn-404-page__button:focus-visible {
    background: #fff;
    color: #111;
    transform: translateY(-2px);
}

.vn-404-page__button--ghost:hover,
.vn-404-page__button--ghost:focus-visible {
    background: #111;
    color: #fff;
}

.vn-404-page__button:focus-visible {
    outline: 3px solid rgb(17 17 17 / 20%);
    outline-offset: 4px;
}

@media (max-width: 767px) {
    .vn-404-page__hero {
        min-height: 480px;
        padding: 64px 18px;
    }

    .vn-404-page__code {
        margin-bottom: 24px;
        font-size: clamp(120px, 42vw, 175px);
    }

    .vn-404-page__description {
        margin-top: 14px;
    }

    .vn-404-page__actions {
        margin-top: 34px;
    }

    .vn-404-page__button {
        width: min(100%, 260px);
        margin-top: 0;
    }
}

/* ============================================================
   GLOBAL MODAL / DRAWER SHELL — hidden until opened
   ============================================================ */
.vn-auth-modal:not(.is-open),
.vn-buy-now-modal:not(.is-open),
.vn-wishlist-drawer:not(.is-open),
.vn-cart-drawer:not(.is-open) {
    position: fixed;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.vn-buy-now-modal__overlay[hidden],
.vn-wishlist-drawer__overlay[hidden],
.vn-cart-drawer__overlay[hidden] {
    display: none !important;
}

.vn-buy-now-modal-root:not(:has(.vn-buy-now-modal.is-open)) .vn-buy-now-modal__overlay,
.vn-wishlist-drawer-root:not(:has(.vn-wishlist-drawer.is-open)) .vn-wishlist-drawer__overlay,
.vn-cart-drawer-root:not(:has(.vn-cart-drawer.is-open)) .vn-cart-drawer__overlay {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
