/* ==========================================================================
   PRODUCT PAGE - CONSULTATION BOX AND ITS NUMBERS DIALOG
   --------------------------------------------------------------------------
   Views/Product/_HelpBox.cshtml. The box invites the customer to talk to an expert and shows no
   number; its button opens the dialog, which lists the store's numbers, each one a tel: link.

   The button is tinted, not solid: the solid accent button on this page is "add to cart", right
   above the box on a desktop, and the box must not compete with it.

   Phones: a bottom sheet, like the variant sheet (quickview.css). Desktop: a centred dialog.
   ========================================================================== */

.tc-pdp-help,
.tc-cfp,
.tc-cfp-bar,
.tc-cfp-btn,
.tc-help-modal {
    --tc-help-ink: #0C0C0C;
    --tc-help-text: #3F4064;
    --tc-help-muted: #81858B;
    --tc-help-rule: #EDEDED;
    --tc-help-accent: var(--ryan-primary, #007AD0);
    --tc-help-tint: rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.08);
    --tc-help-tint-strong: rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.14);
    --tc-help-live: #1FA463;
    font-family: IRANYekanX, tahoma, sans-serif;
    direction: rtl;
    text-align: right;
}

/* --------------------------------------------------------------------------
   The box
   -------------------------------------------------------------------------- */

.tc-pdp-help--card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #E9EAEB;
    border-radius: 16px;
    background: #FFFFFF;
}

.tc-pdp-help__lead {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tc-pdp-help__badge {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tc-help-tint);
    color: var(--tc-help-accent);
}

.tc-pdp-help__badge svg {
    width: 22px;
    height: 22px;
}

.tc-pdp-help__text {
    flex: 1 1 auto;
    min-width: 0;
}

.tc-pdp-help__title {
    font-size: 14px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 22px;
    color: var(--tc-help-ink);
}

.tc-pdp-help__desc {
    margin-top: 2px;
    font-size: 12px;
    line-height: 20px;
    color: var(--tc-help-muted);
}

/* the support hours, with a small "on line" dot */
.tc-pdp-help__hours {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    color: var(--tc-help-text);
}

.tc-pdp-help__dot {
    position: relative;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tc-help-live);
}

.tc-pdp-help__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--tc-help-live);
    opacity: 0.45;
    animation: tc-help-live 2s ease-out infinite;
}

@keyframes tc-help-live {
    0% {
        transform: scale(1);
        opacity: 0.45;
    }

    80%, 100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

.tc-pdp-help__cta {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 44px;
    margin-top: 14px;
    padding: 0 14px;
    border: 1px solid rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.22);
    border-radius: 12px;
    background: var(--tc-help-tint);
    color: var(--tc-help-accent);
    font-family: inherit;
    font-size: 14px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tc-pdp-help__cta:hover {
    border-color: rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.4);
    background: var(--tc-help-tint-strong);
}

.tc-pdp-help__cta:active {
    background: var(--tc-help-tint-strong);
}

.tc-pdp-help__cta:focus-visible {
    outline: 2px solid var(--tc-help-accent);
    outline-offset: 2px;
}

.tc-pdp-help__cta-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.tc-pdp-help__cta-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-pdp-help__cta-arrow {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    transition: transform 0.15s ease;
}

.tc-pdp-help__cta:hover .tc-pdp-help__cta-arrow {
    transform: translateX(-3px);
}

/* phones: a section of the page, under the product page's section header */
.tc-pdp-help--mobile .tc-pdp-help__badge {
    width: 44px;
    height: 44px;
}

.tc-pdp-help--mobile .tc-pdp-help__desc {
    margin-top: 0;
    font-size: 13px;
    line-height: 22px;
    color: var(--tc-help-text);
}

.tc-pdp-help--mobile .tc-pdp-help__hours {
    margin-top: 6px;
    color: var(--tc-help-muted);
}

.tc-pdp-help--mobile .tc-pdp-help__cta {
    height: 48px;
    margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Call for price (Views/Product/_AddToCart.cshtml): in place of the price and the add button, so
   its button is the page's solid one. It shows no number; it opens the dialog below
   (assets/call-for-price). The arrow says the button opens something.
   -------------------------------------------------------------------------- */

.tc-cfp {
    width: 100%;
}

.tc-cfp__lead {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tc-cfp__badge {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--tc-help-tint);
    color: var(--tc-help-accent);
}

.tc-cfp__badge svg {
    width: 22px;
    height: 22px;
}

.tc-cfp__text {
    flex: 1 1 auto;
    min-width: 0;
}

.tc-cfp__title {
    font-size: 14px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 22px;
    color: var(--tc-help-ink);
}

.tc-cfp__desc {
    margin-top: 2px;
    font-size: 12px;
    line-height: 20px;
    color: var(--tc-help-muted);
}

a.tc-cfp-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    margin-top: 16px;
    padding: 0 16px 0 6px;
    border-radius: 12px;
    background: var(--tc-help-accent);
    box-shadow: 0 8px 18px -10px rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.7);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.tc-cfp-btn:hover,
a.tc-cfp-btn:focus {
    color: #FFFFFF;
    text-decoration: none;
}

a.tc-cfp-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 22px -10px rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.85);
}

a.tc-cfp-btn:active {
    transform: scale(0.985);
}

a.tc-cfp-btn:focus-visible {
    outline: 2px solid var(--tc-help-accent);
    outline-offset: 2px;
}

/* the phone rings, quietly: every few seconds a short small shake with one faint halo spreading
   from it, then rest. A hover rings it at once. */
.tc-cfp-btn__ring {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-inline-start: -4px;
    border-radius: 50%;
}

.tc-cfp-btn__ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    opacity: 0;
    animation: tc-cfp-halo 4s ease-out 1.2s infinite;
}

.tc-cfp-btn__icon {
    width: 20px;
    height: 20px;
    transform-origin: 50% 50%;
    animation: tc-cfp-ring 4s ease-in-out 1.2s infinite;
}

a.tc-cfp-btn:hover .tc-cfp-btn__icon {
    animation: tc-cfp-ring-once 0.7s ease-in-out;
}

a.tc-cfp-btn:hover .tc-cfp-btn__ring::before {
    animation: tc-cfp-halo-once 0.9s ease-out;
}

@keyframes tc-cfp-ring {
    0%, 16%, 100% {
        transform: none;
    }

    2% {
        transform: rotate(-12deg);
    }

    4% {
        transform: rotate(10deg);
    }

    6% {
        transform: rotate(-8deg);
    }

    8% {
        transform: rotate(6deg);
    }

    10% {
        transform: rotate(-3deg);
    }

    12% {
        transform: rotate(1deg);
    }
}

@keyframes tc-cfp-halo {
    0% {
        transform: scale(0.75);
        opacity: 0;
    }

    4% {
        opacity: 0.8;
    }

    30%, 100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

@keyframes tc-cfp-ring-once {
    0%, 100% {
        transform: none;
    }

    15% {
        transform: rotate(-12deg);
    }

    30% {
        transform: rotate(10deg);
    }

    45% {
        transform: rotate(-7deg);
    }

    60% {
        transform: rotate(4deg);
    }

    75% {
        transform: rotate(-2deg);
    }
}

@keyframes tc-cfp-halo-once {
    0% {
        transform: scale(0.75);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

.tc-cfp-btn__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* the arrow in its own light circle at the button's end; it rises a little twice after the
   page loads, and on hover, like the sheet it opens */
.tc-cfp-btn__arrow {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
}

.tc-cfp-btn__arrow svg {
    width: 18px;
    height: 18px;
    animation: tc-cfp-nudge 1.2s ease-in-out 0.8s 2;
    transition: transform 0.15s ease;
}

a.tc-cfp-btn:hover .tc-cfp-btn__arrow svg {
    transform: translateY(-2px);
}

@keyframes tc-cfp-nudge {
    0%, 100% {
        transform: none;
    }

    40% {
        transform: translateY(-3px);
    }

    70% {
        transform: translateY(1px);
    }
}

/* the first tap waits for the dialog's own files (call-for-price.js sets is-busy) */
a.tc-cfp-btn.is-busy {
    pointer-events: none;
    filter: saturate(0.8);
}

a.tc-cfp-btn.is-busy .tc-cfp-btn__arrow svg {
    animation: tc-cfp-nudge 0.8s ease-in-out infinite;
}

/* the phone's buy bar: no price there, so this takes the bar's row - the icon and the two lines
   that say what the button is for, then a compact button. 48px high, the row's own height, so the
   bar keeps its size. */
body.page-product .bottom-fix-pdp-mobile .pdp-buybar__cta:has(.tc-cfp-bar),
body.page-product .bottom-fix-pdp-mobile .pdp-buybar__action:has(.tc-cfp-bar) {
    flex: 1 1 auto;
    min-width: 0;
}

.tc-cfp-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: 48px;
}

/* black and white, so the button stays the bar's one colour */
.tc-cfp-bar__icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #F3F4F6;
    color: var(--tc-help-ink);
}

.tc-cfp-bar__icon svg {
    width: 22px;
    height: 22px;
}

.tc-cfp-bar__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tc-cfp-bar__title,
.tc-cfp-bar__desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-cfp-bar__title {
    font-size: 13px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 20px;
    color: var(--tc-help-ink);
}

.tc-cfp-bar__desc {
    font-size: 11px;
    line-height: 16px;
    color: var(--tc-help-muted);
}

a.tc-cfp-btn--bar {
    flex: 0 0 auto;
    width: auto;
    height: 44px;
    margin-top: 0;
    padding: 0 16px 0 6px;
    gap: 8px;
    font-size: 14px;
}

a.tc-cfp-btn--bar .tc-cfp-btn__ring {
    width: 26px;
    height: 26px;
    margin-inline-start: -3px;
}

a.tc-cfp-btn--bar .tc-cfp-btn__icon {
    width: 18px;
    height: 18px;
}

a.tc-cfp-btn--bar .tc-cfp-btn__label {
    flex: 0 0 auto;
}

a.tc-cfp-btn--bar .tc-cfp-btn__arrow {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

a.tc-cfp-btn--bar .tc-cfp-btn__arrow svg {
    width: 16px;
    height: 16px;
}

/* under 375px the button goes back to its tight size, so both lines beside it still fit */
@media (max-width: 374.98px) {
    .tc-cfp-bar {
        gap: 6px;
    }

    .tc-cfp-bar__icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .tc-cfp-bar__icon svg {
        width: 20px;
        height: 20px;
    }

    a.tc-cfp-btn--bar {
        padding: 0 10px 0 4px;
        gap: 6px;
    }

    a.tc-cfp-btn--bar .tc-cfp-btn__arrow {
        width: 30px;
        height: 30px;
    }
}

/* --------------------------------------------------------------------------
   The dialog
   -------------------------------------------------------------------------- */

.tc-help-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tc-help-modal[hidden] {
    display: none;
}

.tc-help-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 22, 40, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tc-help-modal__sheet {
    position: relative;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* the head level with the product page's sheets' (pdp-mobile.css .tc-sheet__head): the
       grip, then the title and the close button centred 38px down */
    padding: 22px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    background: #FFFFFF;
    color: var(--tc-help-ink);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tc-help-modal__sheet:focus {
    outline: none;
}

.tc-help-modal.is-open .tc-help-modal__backdrop {
    opacity: 1;
}

.tc-help-modal.is-open .tc-help-modal__sheet {
    transform: none;
}

/* while the finger drags the sheet down (pdp-help.js), it follows the finger with no delay */
.tc-help-modal.is-dragging .tc-help-modal__sheet,
.tc-help-modal.is-dragging .tc-help-modal__backdrop {
    transition: none;
}

body.tc-help-lock {
    overflow: hidden;
}

/* the product page's sheets' grip */
.tc-help-modal__grip {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #E0E0E2;
    transform: translateX(-50%);
}

.tc-help-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* a sheet's title is a section's title (the type ladder, base.less), as on the product page's
   other sheets */
.tc-help-modal__title {
    font-size: var(--tc-fs-section, 17px);
    font-weight: var(--tc-fw-title, 700);
    line-height: 1.6;
    color: var(--tc-help-ink);
}

/* the variant sheet's round grey tool button */
.tc-help-modal__close {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #F1F3F4;
    color: #202124;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tc-help-modal__close:hover,
.tc-help-modal__close:active {
    background: #E3E5E8;
}

.tc-help-modal__close:focus-visible {
    outline: 2px solid var(--tc-help-accent);
    outline-offset: 2px;
}

.tc-help-modal__close svg {
    width: 17px;
    height: 17px;
}

.tc-help-modal__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
    text-align: center;
}

.tc-pdp-help__badge--lg {
    width: 56px;
    height: 56px;
    border-radius: 18px;
}

.tc-pdp-help__badge--lg svg {
    width: 28px;
    height: 28px;
}

.tc-help-modal__lead {
    max-width: 320px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 22px;
    color: var(--tc-help-text);
}

/* the product's name: its model numbers in Latin digits («مدل 2247», not «۲۲۴۷»), as the page's
   own name and code read - the family's Latin-digit cut, the Persian letters unchanged */
.tc-help-modal__lead b {
    font-family: IRANYekanXEn, IRANYekanX, tahoma, sans-serif;
    font-weight: var(--tc-fw-label, 600);
    color: var(--tc-help-ink);
}

/* --------------------------------------------------------------------------
   A product card's «تماس برای قیمت» (assets/call-for-price): the product's photo and name above
   the lead, and the skeleton the dialog opens on while its content loads
   -------------------------------------------------------------------------- */

.tc-help-modal__photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border-radius: 16px;
    background: #F4F2F0;
}

.tc-help-modal__photo img {
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* the product's name: Latin digits in model numbers, as the card's own name reads */
.tc-help-modal__product {
    max-width: 320px;
    margin-top: 12px;
    font-family: IRANYekanXEn, IRANYekanX, tahoma, sans-serif;
    font-size: 15px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 24px;
    color: var(--tc-help-ink);
}

.tc-help-modal__product + .tc-help-modal__lead {
    margin-top: 4px;
}

.tc-help-skel {
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, #F1F2F4 25%, #E6E8EB 37%, #F1F2F4 63%);
    background-size: 400% 100%;
    animation: tc-help-skel 1.3s ease infinite;
}

.tc-help-skel--photo { width: 88px; height: 88px; border-radius: 16px; }
.tc-help-skel--title { width: 180px; height: 16px; margin-top: 14px; }
.tc-help-skel--lead { width: 250px; max-width: 100%; height: 12px; margin-top: 10px; }
.tc-help-skel--icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; }
.tc-help-skel--sm { width: 60px; height: 10px; }
.tc-help-skel--md { width: 120px; height: 14px; margin-top: 6px; }
.tc-help-skel--btn { flex: 0 0 auto; width: 84px; height: 36px; border-radius: 10px; }

.tc-help-skel__line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--tc-help-rule);
    border-radius: 14px;
}

.tc-help-skel__text {
    flex: 1 1 auto;
    min-width: 0;
}

@keyframes tc-help-skel {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.tc-help-modal__intro .tc-pdp-help__hours {
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #F2FAF6;
    color: #157347;
}

.tc-help-modal__lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.tc-help-modal__line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--tc-help-rule);
    border-radius: 14px;
    background: #FFFFFF;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tc-help-modal__line:hover {
    border-color: rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.35);
    background: rgba(var(--ryan-primary-rgb, 0, 122, 208), 0.03);
    color: inherit;
    text-decoration: none;
}

.tc-help-modal__line:active {
    background: var(--tc-help-tint);
}

.tc-help-modal__line:focus-visible {
    outline: 2px solid var(--tc-help-accent);
    outline-offset: 2px;
}

.tc-help-modal__icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F4F5F7;
    color: var(--tc-help-text);
}

.tc-help-modal__icon svg {
    width: 20px;
    height: 20px;
}

.tc-help-modal__number {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.tc-help-modal__kind {
    font-size: 11px;
    line-height: 16px;
    color: var(--tc-help-muted);
}

.tc-help-modal__digits {
    font-size: 17px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 24px;
    letter-spacing: 0.5px;
    color: var(--tc-help-ink);
    unicode-bidi: isolate;
    white-space: nowrap;
}

.tc-help-modal__call {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--tc-help-accent);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: var(--tc-fw-label, 600);
}

.tc-help-modal__call svg {
    width: 16px;
    height: 16px;
}

@media (min-width: 768px) {
    .tc-help-modal {
        align-items: center;
    }

    .tc-help-modal__sheet {
        width: min(420px, calc(100vw - 48px));
        max-height: 86vh;
        padding: 20px;
        border-radius: 16px;
        opacity: 0;
        transform: translateY(16px) scale(0.98);
        transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
    }

    .tc-help-modal.is-open .tc-help-modal__sheet {
        opacity: 1;
        transform: none;
    }

    .tc-help-modal__grip {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tc-pdp-help__dot::after {
        animation: none;
    }

    .tc-help-modal__backdrop,
    .tc-help-modal__sheet {
        transition: none;
    }

    .tc-help-skel {
        animation: none;
    }

    /* the phone's ring stays: a small, short shake every few seconds is the call-for-price
       button's one cue, and Windows with "animation effects" off (common on office PCs) asks for
       reduced motion without anyone choosing it */
    .tc-cfp-btn__arrow svg,
    a.tc-cfp-btn.is-busy .tc-cfp-btn__arrow svg {
        animation: none;
    }
}
