/*
    PDP shipping info (Widgets.ShippingInfo) - fetched by shipping-info.js after the page has
    loaded, together with the content it styles. The card follows the buy column's other cards
    (the help box: white, #E9EAEB hairline, 16px corners). The delivery time and the return
    link are a fixed blue, as in the design, not the theme's primary: on a store whose primary
    is red, "ارسال فردا" in red reads as a warning. Free shipping takes the buy box's green.
*/

.tc-si-slot.is-ready {
    animation: tc-si-in 0.25s ease-out;
}

@keyframes tc-si-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tc-si-slot.is-ready { animation: none; }
}

/* ---- the buy box's two lines, under the guarantee ----------------------------------------- */

/* the designer's truck, a picture: the theme's 22px rule for the facts' icons is for svg */
.tc-si-bb__ico {
    flex: none;
    width: 22px;
    height: 22px;
}

.tc-si-bb {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* ---- desktop: the lines open the card in a window (shipping-info.js, linkToCard) ----------- */

/* The selectors carry the buy box's own ancestry: the theme sizes every icon in a fact at 22px
   from `body.page-product .km-product-page-top .km-product-left .tc-bb__fact svg`. */
body.page-product .tc-bb__facts .tc-si-slot.tc-si-bb-link {
    margin: -6px -8px;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

body.page-product .tc-bb__facts .tc-si-slot.tc-si-bb-link:hover {
    background: #F2F2F2;
}

body.page-product .tc-bb__facts .tc-si-slot.tc-si-bb-link:focus-visible {
    outline: 2px solid #1F7AE0;
    outline-offset: 0;
}

body.page-product .km-product-page-top .tc-bb__facts .tc-si-bb__more {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #1F7AE0;
    font-size: 13px;
    font-weight: 500;
}

body.page-product .km-product-page-top .km-product-left .tc-bb__fact .tc-si-bb__more svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.tc-si-dialog {
    width: min(460px, calc(100vw - 32px));
    max-height: min(80vh, 720px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    overflow: auto;
    overscroll-behavior: contain;
}

.tc-si-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.tc-si-dialog[open] {
    animation: tc-si-in 0.2s ease-out;
}

.tc-si-dialog .tc-si {
    margin: 0;
    padding: 24px;
    border: 0;
    border-radius: 0;
}

.tc-si__close {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-block: -6px;
    margin-inline-end: -8px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6B6B6B;
    cursor: pointer;
}

.tc-si__close:hover {
    background: #F2F2F2;
    color: #242424;
}

.tc-si__close:focus-visible {
    outline: 2px solid #1F7AE0;
    outline-offset: 0;
}

@media (prefers-reduced-motion: reduce) {
    .tc-si-dialog[open] { animation: none; }
}

/* ---- the card ---------------------------------------------------------------------------- */

.tc-si {
    --tc-si-ink: #242424;
    --tc-si-muted: #8C8C8C;
    --tc-si-blue: #1F7AE0;
    --tc-si-blue-tint: rgba(31, 122, 224, 0.07);
    --tc-si-blue-tint-strong: rgba(31, 122, 224, 0.13);
    --tc-si-green: #12A150;
    --tc-si-orange: #E8890C;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
    padding: 20px 16px;
    border: 1px solid #E9EAEB;
    border-radius: 16px;
    background: #FFFFFF;
    color: var(--tc-si-ink);
    font-size: 14px;
    line-height: 1.7;
}

.tc-si * {
    box-sizing: border-box;
}

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

.tc-si .tc-si__title {
    margin: 0;
    color: var(--tc-si-ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.tc-si__part {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tc-si .tc-si__lead {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--tc-si-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.tc-si__lead .tc-si__ico {
    flex: none;
    width: 24px;
    height: 24px;
}

.tc-si .tc-si__note {
    margin: -8px 0 0;
    color: var(--tc-si-orange);
    font-size: 13px;
    line-height: 1.9;
}

.tc-si__zone {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tc-si .tc-si__zone-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.tc-si__zone-head .tc-si__ico {
    flex: none;
    width: 20px;
    height: 20px;
}

.tc-si__city {
    font-weight: 600;
}

/* «ارسال امروز»: a small tinted chip beside the city - at the city's own size it read as a
   second heading */
.tc-si__when {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: #EEF4FD;
    color: var(--tc-si-blue);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
}

.tc-si .tc-si__methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    /* under the city name, past the pin */
    padding: 0 26px 0 0;
    list-style: none;
}

.tc-si__methods li {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
    padding-right: 14px;
    font-size: 13.5px;
    line-height: 1.6;
}

.tc-si__methods li::before {
    content: "";
    position: absolute;
    top: 0.62em;
    right: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #BDBDBD;
}

.tc-si__name {
    color: var(--tc-si-muted);
}

.tc-si__price {
    color: var(--tc-si-ink);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.tc-si__price--free {
    color: var(--tc-si-green);
}

.tc-si__part--free {
    gap: 8px;
}

.tc-si__part--free .tc-si__lead {
    color: var(--tc-si-green);
}

.tc-si .tc-si__free-text {
    margin: 0;
    color: #4A4A4A;
    font-size: 13.5px;
}

.tc-si__return {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--tc-si-blue-tint);
    color: var(--tc-si-blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.tc-si__return:hover,
.tc-si__return:focus-visible {
    background: var(--tc-si-blue-tint-strong);
    color: var(--tc-si-blue);
    text-decoration: none;
}

.tc-si__return:focus-visible {
    outline: 2px solid var(--tc-si-blue);
    outline-offset: 2px;
}

/* ---- phones: a page section like its neighbours, no card ----------------------------------- */

body.tc-pdpm .tc-si {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

body.tc-pdpm .tc-si .tc-si__title {
    font-size: 18px;
}
