/*
 * Self-hosted buyer typography.
 * The same families and weights are retained without third-party handshakes.
 */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 800;
    src: url("/assets/fonts/inter-latin-800-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("/assets/fonts/poppins-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("/assets/fonts/poppins-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("/assets/fonts/poppins-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("/assets/fonts/poppins-latin-700-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 800;
    src: url("/assets/fonts/poppins-latin-800-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 900;
    src: url("/assets/fonts/poppins-latin-900-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("/assets/fonts/outfit-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("/assets/fonts/outfit-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("/assets/fonts/outfit-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("/assets/fonts/outfit-latin-700-normal.woff2") format("woff2");
}

/*
 * Consistent complex-script rendering across Windows, macOS, Android, and iOS.
 * Each subset is used only when its language/script is visible.
 */
@font-face {
    font-family: "DW Noto Sans Sinhala";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("/assets/fonts/noto-sans-sinhala-sinhala-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4;
}
@font-face {
    font-family: "DW Noto Sans Tamil";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("/assets/fonts/noto-sans-tamil-tamil-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC;
}
@font-face {
    font-family: "DW Noto Sans Arabic";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("/assets/fonts/noto-sans-arabic-arabic-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

/*
 * Locale-aware storefront typography.
 *
 * The English UI was designed around Poppins/Inter, whose very heavy display
 * weights and tight tracking do not translate cleanly to complex scripts.
 * Give every translated storefront a stable local family and a smaller,
 * deliberately chosen weight range. This keeps Sinhala, Tamil, and Arabic
 * equally legible on Windows and Apple platforms without changing English.
 */
html[lang="si"] {
    --dw-locale-font: "DW Noto Sans Sinhala", "Inter", sans-serif;
    --dw-locale-body-weight: 400;
    --dw-locale-control-weight: 560;
    --dw-locale-display-weight: 640;
    --dw-locale-line-height: 1.58;
}
html[lang="ta"] {
    --dw-locale-font: "DW Noto Sans Tamil", "Inter", sans-serif;
    --dw-locale-body-weight: 400;
    --dw-locale-control-weight: 560;
    --dw-locale-display-weight: 640;
    --dw-locale-line-height: 1.55;
}
html[lang="ar"] {
    --dw-locale-font: "DW Noto Sans Arabic", "Inter", sans-serif;
    --dw-locale-body-weight: 400;
    --dw-locale-control-weight: 560;
    --dw-locale-display-weight: 650;
    --dw-locale-line-height: 1.6;
}
html[lang="fr"],
html[lang="de"] {
    --dw-locale-font: "Inter", sans-serif;
    --dw-locale-body-weight: 400;
    --dw-locale-control-weight: 600;
    --dw-locale-display-weight: 700;
    --dw-locale-line-height: 1.5;
}

:is(html[lang="si"], html[lang="ta"], html[lang="ar"], html[lang="fr"], html[lang="de"]) body,
:is(html[lang="si"], html[lang="ta"], html[lang="ar"], html[lang="fr"], html[lang="de"]) body :not(.fas):not(.far):not(.fab):not(.fa):not([class^="fa-"]):not([class*=" fa-"]) {
    font-family: var(--dw-locale-font) !important;
}

:is(html[lang="si"], html[lang="ta"], html[lang="ar"], html[lang="fr"], html[lang="de"]) body {
    font-weight: var(--dw-locale-body-weight);
    line-height: var(--dw-locale-line-height);
    font-synthesis: none;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Complex scripts need natural spacing for correct shaping. */
:is(html[lang="si"], html[lang="ta"], html[lang="ar"]) body :not(.fas):not(.far):not(.fab):not(.fa):not([class^="fa-"]):not([class*=" fa-"]) {
    letter-spacing: normal !important;
}

/* Calm, medium-weight labels and controls instead of synthetic 800/900 bold. */
:is(html[lang="si"], html[lang="ta"], html[lang="ar"], html[lang="fr"], html[lang="de"]) body :where(
    button,
    [role="button"],
    .btn,
    .card-btn,
    .dw-nav-link,
    .new-header .navigation a,
    .new-header .header-btn,
    .new-header .action-btn,
    .new-header .account-text,
    .new-header .auth-action,
    .new-header #langCurrText,
    .home-trust-bar .feature-text,
    .flash-sale-section .flash-sale-shop-more,
    .category-name
) {
    font-weight: var(--dw-locale-control-weight) !important;
}

/* Reserve the strongest translated weight for genuine hierarchy. */
:is(html[lang="si"], html[lang="ta"], html[lang="ar"], html[lang="fr"], html[lang="de"]) body :where(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    strong,
    b,
    .section-title,
    .product-title,
    .product-name,
    .card-title,
    .modal-title,
    .flash-sale-section .flash-sale-title h2
) {
    font-weight: var(--dw-locale-display-weight) !important;
}

:is(html[lang="si"], html[lang="ta"], html[lang="ar"]) body :where(h1, h2, h3, h4, h5, h6) {
    line-height: 1.38;
}

.dw-language-script-si { font-family: "DW Noto Sans Sinhala", "Inter", sans-serif; }
.dw-language-script-ta { font-family: "DW Noto Sans Tamil", "Inter", sans-serif; }
.dw-language-script-ar { font-family: "DW Noto Sans Arabic", "Inter", sans-serif; }

.dw-language-suggestion {
    position: fixed;
    right: 22px;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 10030;
    width: min(390px, calc(100vw - 32px));
    padding: 15px 16px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    color: #172033;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(244, 91, 22, .2);
    border-radius: 18px;
    box-shadow: 0 18px 52px rgba(23, 32, 51, .2);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(18px) scale(.98);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .78, .2, 1);
}
.dw-language-suggestion.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.dw-language-suggestion.is-leaving {
    opacity: 0;
    transform: translateY(10px) scale(.985);
}
.dw-language-suggestion-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #f45b16;
    background: #fff2e9;
    border-radius: 13px;
    font-size: 20px;
}
.dw-language-suggestion-copy {
    min-width: 0;
}
.dw-language-suggestion-copy strong,
.dw-language-suggestion-copy span {
    display: block;
}
.dw-language-suggestion-copy strong {
    margin-bottom: 2px;
    color: #111827;
    font-size: 14px;
    line-height: 1.35;
}
.dw-language-suggestion-copy span {
    color: #667085;
    font: 500 12px/1.45 "Inter", sans-serif;
}
.dw-language-suggestion-action {
    min-height: 36px;
    padding: 8px 12px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #f45b16, #ff7a1a);
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(244, 91, 22, .22);
}
.dw-language-suggestion-close {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    color: #7c8494;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.dw-terms-notice {
    position: fixed;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 10040;
    width: min(760px, calc(100vw - 32px));
    padding: 17px 18px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    color: #172033;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(23, 32, 51, .12);
    border-radius: 20px;
    box-shadow: 0 22px 62px rgba(23, 32, 51, .22);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translate(-50%, 18px) scale(.99);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .78, .2, 1);
}
.dw-terms-notice.is-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}
.dw-terms-notice.is-leaving {
    opacity: 0;
    transform: translate(-50%, 10px) scale(.99);
}
.dw-terms-notice-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #f45b16, #ff8a28);
    border-radius: 14px;
    font-weight: 850;
    box-shadow: 0 8px 20px rgba(244, 91, 22, .24);
}
.dw-terms-notice-copy strong {
    display: block;
    margin-bottom: 3px;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
}
.dw-terms-notice-copy p {
    margin: 0;
    color: #667085;
    font: 500 12px/1.5 "Inter", sans-serif;
}
.dw-terms-notice-copy .dw-terms-notice-legal {
    margin-top: 5px;
    color: #4b5565;
}
.dw-terms-notice-copy a {
    color: #cf470d;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dw-terms-notice-accept {
    min-height: 40px;
    padding: 9px 15px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: #172033;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
}
.dw-terms-notice-close {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    color: #7c8494;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.dw-terms-notice-accept:focus-visible,
.dw-terms-notice-close:focus-visible,
.dw-terms-notice-copy a:focus-visible {
    outline: 3px solid rgba(244, 91, 22, .28);
    outline-offset: 2px;
}
html[data-theme="dark"] .dw-terms-notice,
body.dark-mode .dw-terms-notice {
    color: #f8fafc;
    background: rgba(23, 28, 38, .98);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 22px 62px rgba(0, 0, 0, .48);
}
html[data-theme="dark"] .dw-terms-notice-copy strong,
body.dark-mode .dw-terms-notice-copy strong { color: #f8fafc; }
html[data-theme="dark"] .dw-terms-notice-copy p,
body.dark-mode .dw-terms-notice-copy p { color: #b8c0ce; }
html[data-theme="dark"] .dw-terms-notice-copy a,
body.dark-mode .dw-terms-notice-copy a { color: #ff9b62; }
html[data-theme="dark"] .dw-terms-notice-accept,
body.dark-mode .dw-terms-notice-accept { color: #172033; background: #fff; }
.dw-language-suggestion-action:focus-visible,
.dw-language-suggestion-close:focus-visible {
    outline: 3px solid rgba(244, 91, 22, .28);
    outline-offset: 2px;
}
html[data-theme="dark"] .dw-language-suggestion,
body.dark-mode .dw-language-suggestion {
    color: #f8fafc;
    background: rgba(23, 28, 38, .97);
    border-color: rgba(255, 138, 71, .28);
    box-shadow: 0 20px 56px rgba(0, 0, 0, .46);
}
html[data-theme="dark"] .dw-language-suggestion-copy strong,
body.dark-mode .dw-language-suggestion-copy strong { color: #f8fafc; }
html[data-theme="dark"] .dw-language-suggestion-copy span,
body.dark-mode .dw-language-suggestion-copy span { color: #b8c0ce; }

@media (max-width: 768px) {
    .dw-language-suggestion {
        right: 16px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        grid-template-columns: 36px minmax(0, 1fr);
        padding: 14px;
    }
    .dw-language-suggestion-icon {
        width: 36px;
        height: 36px;
    }
    .dw-language-suggestion-action {
        grid-column: 1 / -1;
        width: 100%;
    }
    .dw-terms-notice {
        bottom: calc(82px + env(safe-area-inset-bottom));
        padding: 15px;
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .dw-terms-notice-icon {
        width: 38px;
        height: 38px;
    }
    .dw-terms-notice-accept {
        grid-column: 1 / -1;
        width: 100%;
    }
    .dw-terms-notice-copy .dw-terms-notice-legal {
        margin-top: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dw-language-suggestion,
    .dw-terms-notice { transition: none; }
}
