/* Kit4Kids Persian UI font. The font is self-hosted so the Persian and English
   pages do not depend on a third-party font request. */
@font-face {
    font-family: "Vazirmatn";
    src: url("/fonts/vazirmatn-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("/fonts/vazirmatn-semibold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("/fonts/vazirmatn-bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700 900;
    font-display: swap;
}

/* Apply the Persian face consistently to every inherited control and page
   surface. English pages keep their existing Instrument Sans declaration. */
html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    font-synthesis: none;
}

html[dir="rtl"] body {
    line-height: 1.85;
    text-rendering: optimizeLegibility;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .button,
html[dir="rtl"] .main-nav a,
html[dir="rtl"] .price strong,
html[dir="rtl"] .product-card__meta,
html[dir="rtl"] .account-heading span {
    font-weight: 700;
}

/* Keep long Persian labels and notices readable instead of collapsing into a
   narrow vertical column on small screens. */
html[dir="rtl"] .toast,
html[dir="rtl"] .alert,
html[dir="rtl"] .form-status,
html[dir="rtl"] .product-card h3,
html[dir="rtl"] .product-card__body > p,
html[dir="rtl"] .product-detail__content,
html[dir="rtl"] .order-item,
html[dir="rtl"] .summary-product span {
    overflow-wrap: anywhere;
}

/* Make the store's digital-only notice visible without taking over the
   product grid. */
.store-pdf-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-block: 0 26px;
    padding: 16px 18px;
    color: #34445a;
    background: #fff9e7;
    border: 1px solid #efd98f;
    border-inline-start: 4px solid #e6ae2f;
    border-radius: 16px;
}

.store-pdf-notice__icon {
    flex: 0 0 40px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #fff;
    background: #e6ae2f;
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
}

.store-pdf-notice strong {
    display: block;
    color: #243f68;
    font-size: 15px;
}

.store-pdf-notice p {
    margin: 4px 0 0;
    color: #5d6a7b;
    font-size: 13px;
    line-height: 1.85;
}

.product-facts--with-image-count {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .product-facts--with-image-count {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* The previous inset-inline:50% rule gave the toast zero available width in
   RTL. Use a physical center anchor and a capped width for both directions. */
.toast {
    inset-inline: auto;
    left: 50%;
    right: auto;
    width: max-content;
    max-width: min(92vw, 560px);
    text-align: center;
    line-height: 1.75;
    white-space: normal;
    overflow-wrap: anywhere;
    transform: translateX(-50%);
}

.toast.is-hiding,
[dir="ltr"] .toast.is-hiding,
[dir="rtl"] .toast.is-hiding {
    transform: translate(-50%, -10px);
}

/* Keep product and account text stable when the card width changes. */
.product-card,
.product-card__body,
.product-card__footer,
.product-detail__content,
.account-layout,
.order-card,
.order-item {
    min-width: 0;
}

.product-card h3,
.product-detail__content h1,
.account-hero h1,
.order-item strong {
    text-wrap: pretty;
}

/* Keep every supplied product artwork complete inside its responsive frame.
   The source files have different aspect ratios, so cover would crop them. */
.product-card__image img,
.product-detail__visual img,
.cart-item > a img,
.order-item img {
    object-fit: contain;
    object-position: center;
}

.product-card:hover .product-card__image img {
    transform: none;
}

/* Login CAPTCHA: keep the arithmetic prompt readable in both RTL and LTR. */
.login-captcha {
    display: grid !important;
    gap: 7px;
}

.login-captcha__question {
    display: inline-flex;
    width: fit-content;
    min-width: 116px;
    justify-content: center;
    padding: 9px 15px;
    color: var(--blue-deep);
    background: #eef6ff;
    border: 1px solid #c7ddf4;
    border-radius: 11px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .04em;
}

.login-captcha small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.7;
}

.password-field {
    display: block;
    margin-bottom: 17px;
    color: #344864;
    font-size: 12px;
    font-weight: 800;
}

.password-field > label {
    display: block;
}

.password-field__control {
    position: relative;
    display: block;
    margin-top: 6px;
}

.password-field__control input {
    margin-top: 0 !important;
    padding-inline-end: 50px;
    font-weight: 400;
}

.password-toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 7px;
    display: grid;
    width: 38px;
    place-items: center;
    padding: 7px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--blue);
    background: #eef6ff;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* The supplied flash-card PNGs already carry an alpha channel. Keep that
   transparency visible in the catalogue instead of adding a photo frame. */
.product-card__image--transparent {
    background: transparent;
}

@media (max-width: 820px) {
    html[dir="rtl"] .section-heading h2 {
        font-size: clamp(26px, 6vw, 36px);
    }

    html[dir="rtl"] .product-card h3 {
        font-size: 17px;
        line-height: 1.65;
    }

    html[dir="rtl"] .product-card__body > p {
        font-size: 13px;
        line-height: 1.85;
    }

    html[dir="rtl"] .product-detail__content h1 {
        font-size: clamp(30px, 7vw, 44px);
    }

    html[dir="rtl"] .lead {
        font-size: 16px;
        line-height: 1.9;
    }

    html[dir="rtl"] .account-hero h1 {
        font-size: clamp(30px, 7vw, 40px);
    }

    html[dir="rtl"] .account-heading h2 {
        font-size: 23px;
        line-height: 1.55;
    }

    html[dir="rtl"] .order-card > header {
        line-height: 1.7;
    }
}

@media (max-width: 560px) {
    html[dir="rtl"] body {
        line-height: 1.9;
    }

    html[dir="rtl"] .product-card__body {
        padding: 16px;
    }

    html[dir="rtl"] .product-card__meta {
        font-size: 11px;
        line-height: 1.7;
    }

    html[dir="rtl"] .product-card h3 {
        margin-block: 8px 6px;
        font-size: 17px;
    }

    html[dir="rtl"] .product-card__footer {
        align-items: center;
    }

    html[dir="rtl"] .price strong {
        font-size: 15px;
    }

    html[dir="rtl"] .product-detail__visual {
        padding: 14px;
        border-radius: 22px;
    }

    html[dir="rtl"] .store-pdf-notice {
        gap: 11px;
        padding: 14px;
    }

    html[dir="rtl"] .store-pdf-notice__icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    html[dir="rtl"] .store-pdf-notice strong {
        font-size: 14px;
    }

    html[dir="rtl"] .store-pdf-notice p {
        font-size: 12px;
        line-height: 1.8;
    }

    html[dir="rtl"] .product-detail__content h1 {
        font-size: 30px;
    }

    html[dir="rtl"] .product-facts > div {
        padding: 13px;
    }

    html[dir="rtl"] .form-card h2 {
        font-size: 24px;
        line-height: 1.55;
    }

    html[dir="rtl"] .alert,
    html[dir="rtl"] .form-status {
        padding: 12px 13px;
        line-height: 1.85;
    }

    html[dir="rtl"] .order-card > header {
        gap: 12px;
        padding: 15px;
    }

    html[dir="rtl"] .order-items {
        padding-inline: 15px;
    }

    html[dir="rtl"] .order-item {
        gap: 11px;
        line-height: 1.8;
    }

    html[dir="rtl"] .download-list .button {
        min-height: 36px;
        padding: 6px 11px;
        font-size: 12px;
    }

    html[dir="rtl"] .toast {
        top: 88px;
        padding: 11px 15px;
        font-size: 13px;
    }
}
