/* =========================================================
   سبد خرید — چیدمانِ «ویترین» (۲۰۲۶-۱۰-۱۸)
   قالب: woocommerce/cart/cart.php · بارگذاری: inc/cart-ui.php (فقط در سبد، بعد از custom.css)
   زمینه‌ی کرمِ برند، کارت‌های سفید با سایه‌ی نرم، یک کارتِ خلاصه‌ی چسبان.
   ========================================================= */

html body.woocommerce-cart,
html body.woocommerce-cart #page,
html body.woocommerce-cart .site-content,
html body.woocommerce-cart .content-area,
html body.woocommerce-cart .site-main,
html body.woocommerce-cart article.page,
html body.woocommerce-cart .entry-content {
    background: #F8F7F4 !important;
}

/* نوارِ گردنبند خودش می‌گوید کجای مسیر هستیم؛ عنوانِ بزرگ فقط برای صفحه‌خوان می‌ماند */
html body.woocommerce-cart:has(.sg-cart-form) .entry-header {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

html body.woocommerce-cart .entry-content > .woocommerce {
    max-width: 1160px;
    margin: 0 auto 48px;
    padding-inline: 16px !important;
    box-sizing: border-box;
}
@media (min-width: 992px) {
    html body.woocommerce-cart .entry-content > .woocommerce {
        grid-template-columns: minmax(0, 1fr) 390px !important;
        gap: 0 28px !important;
    }
}

/* ---------- کارتِ قطعه‌ها ---------- */
html body.woocommerce-cart .sg-cart-list {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4px 26px !important;
    background: #FFFFFF !important;
    border: 1px solid #ECE6DA !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(28, 25, 22, .04), 0 18px 36px -24px rgba(28, 25, 22, .22) !important;
    box-sizing: border-box;
}
html body.woocommerce-cart .sg-cart-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 0 16px;
    border-bottom: 1px solid #F0EBE1;
}
html body.woocommerce-cart .sg-cart-list__title {
    margin: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1C1916 !important;
}
html body.woocommerce-cart .sg-cart-list__count {
    padding: 4px 12px;
    border-radius: 999px;
    background: #F8F3E6;
    color: #86660F;
    font-size: .8rem;
}

html body.woocommerce-cart .sg-ci {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) auto;
    align-items: start;
    gap: 0 22px;
    padding: 24px 0;
    border-bottom: 1px solid #F0EBE1;
    box-sizing: border-box;
    transition: opacity .2s ease, transform .3s cubic-bezier(.4, 0, .2, 1), height .32s cubic-bezier(.4, 0, .2, 1) .08s, padding .32s cubic-bezier(.4, 0, .2, 1) .08s, border-color .2s ease;
}
html body.woocommerce-cart .sg-ci:last-of-type { border-bottom: 0; }
/* حذفِ آنی: قطعه به سمتِ چپ می‌لغزد و جایش بسته می‌شود */
html body.woocommerce-cart .sg-ci.is-leaving {
    opacity: 0;
    transform: translateX(-28px);
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    border-bottom-color: transparent;
    pointer-events: none;
}

html body.woocommerce-cart .sg-ci__img {
    display: block;
    width: 116px;
    height: 116px;
    border-radius: 16px;
    overflow: hidden;
    background: #F8F7F4;
}
html body.woocommerce-cart .sg-ci__img img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    object-fit: cover;
    border-radius: 0 !important;
    transition: transform .25s ease;
}
html body.woocommerce-cart a.sg-ci__img:hover img { transform: scale(1.04); }

html body.woocommerce-cart .sg-ci__body { min-width: 0; padding-top: 4px; }
html body.woocommerce-cart .sg-ci__name,
html body.woocommerce-cart .sg-ci__name a {
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.8 !important;
    color: #1C1916 !important;
    text-decoration: none !important;
}
html body.woocommerce-cart .sg-ci__name a:hover { color: #86660F !important; }

html body.woocommerce-cart .sg-ci__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
html body.woocommerce-cart .sg-ci__chips li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 !important;
    padding: 3px 11px;
    border: 1px solid #EFE8DA;
    border-radius: 999px;
    background: #FBFAF7;
    font-size: .76rem;
    line-height: 1.7;
    color: #8C8070;
}
html body.woocommerce-cart .sg-ci__chips b { font-weight: 700; color: #1C1916; }

html body.woocommerce-cart .sg-ci__lock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0 !important;
    font-size: .78rem;
    color: #86660F;
}

html body.woocommerce-cart .sg-ci__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    align-self: stretch;
    gap: 12px;
    padding-top: 4px;
}
html body.woocommerce-cart .sg-ci__price,
html body.woocommerce-cart .sg-ci__price .woocommerce-Price-amount,
html body.woocommerce-cart .sg-ci__price bdi {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1C1916 !important;
    white-space: nowrap;
}
html body.woocommerce-cart .sg-ci__price .woocommerce-Price-currencySymbol {
    font-size: .74rem !important;
    font-weight: 400 !important;
    color: #8C8070 !important;
}
html body.woocommerce-cart .sg-ci .product-remove a.remove::before,
html body.woocommerce-cart .sg-ci .product-remove a.remove::after { content: none !important; display: none !important; }
html body.woocommerce-cart .sg-ci .product-remove a.sg-ci__remove {
    display: inline-flex !important;
    text-indent: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    white-space: nowrap;
    align-items: center;
    gap: 5px;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #8C8070 !important;
    font-size: .8rem !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}
html body.woocommerce-cart .sg-ci .product-remove a.sg-ci__remove:hover,
html body.woocommerce-cart .sg-ci .product-remove a.sg-ci__remove:focus-visible {
    background: #FBEDEA !important;
    color: #B4442C !important;
}

/* ---------- کارتِ خلاصه: جمع + کد تخفیف + دکمه، یک‌جا ---------- */
html body.woocommerce-cart .cart-collaterals.sg-cart-summary {
    display: block !important;
    margin-top: 16px;
    padding: 24px !important;
    background: #FFFFFF !important;
    border: 1px solid #ECE6DA !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(28, 25, 22, .04), 0 18px 36px -24px rgba(28, 25, 22, .22) !important;
    box-sizing: border-box;
}
@media (min-width: 992px) {
    html body.woocommerce-cart .cart-collaterals.sg-cart-summary { margin-top: 0; }
}
html body.woocommerce-cart .sg-cart-summary .cart_totals,
html body.woocommerce-cart .sg-cart-summary .sg-coupon {
    position: relative;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
html body.woocommerce-cart .sg-cart-summary .cart_totals > h2 {
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1C1916 !important;
}
html body.woocommerce-cart .sg-cart-summary table.shop_table {
    width: 100% !important;
    margin: 0 0 18px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
html body.woocommerce-cart .sg-cart-summary table.shop_table,
html body.woocommerce-cart .sg-cart-summary table.shop_table tbody { display: block !important; }
html body.woocommerce-cart .sg-cart-summary table.shop_table tr {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0 !important;
    border-bottom: 1px dashed #EAE2D2 !important;
    background: transparent !important;
}
html body.woocommerce-cart .sg-cart-summary table.shop_table tr.order-total { border-bottom: 0 !important; padding-top: 16px !important; align-items: center; }
html body.woocommerce-cart .sg-cart-summary table.shop_table th,
html body.woocommerce-cart .sg-cart-summary table.shop_table td {
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: .88rem !important;
    font-weight: 400 !important;
    vertical-align: top;
    transition: opacity .2s ease;
}
html body.woocommerce-cart .sg-cart-summary table.shop_table th { color: #6B6B6B !important; text-align: right !important; }
html body.woocommerce-cart .sg-cart-summary table.shop_table td { color: #1C1916 !important; text-align: left !important; }
html body.woocommerce-cart .sg-cart-summary table.shop_table td::before { display: none !important; }
html body.woocommerce-cart .sg-cart-summary #shipping_method { margin: 0 !important; padding: 0 !important; list-style: none !important; }
html body.woocommerce-cart .sg-cart-summary #shipping_method li { margin: 0 !important; padding: 0 !important; }
/* آدرس و «تغییر آدرس» جایشان در تسویه است، نه در سبد */
html body.woocommerce-cart .sg-cart-summary .woocommerce-shipping-destination,
html body.woocommerce-cart .sg-cart-summary .woocommerce-shipping-calculator { display: none !important; }

html body.woocommerce-cart .sg-cart-summary tr.order-total th,
html body.woocommerce-cart .sg-cart-summary tr.order-total td {
    vertical-align: middle;
}
html body.woocommerce-cart .sg-cart-summary tr.order-total th { color: #1C1916 !important; font-weight: 700 !important; font-size: .95rem !important; }
html body.woocommerce-cart .sg-cart-summary tr.order-total td,
html body.woocommerce-cart .sg-cart-summary tr.order-total td strong,
html body.woocommerce-cart .sg-cart-summary tr.order-total .woocommerce-Price-amount,
html body.woocommerce-cart .sg-cart-summary tr.order-total bdi {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #1C1916 !important;
}
html body.woocommerce-cart .sg-cart-summary .woocommerce-Price-currencySymbol {
    font-size: .74rem !important;
    font-weight: 400 !important;
    color: #8C8070 !important;
}

html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout { margin: 0 !important; padding: 0 !important; }
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button,
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout .button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100% !important;
    min-height: 56px;
    margin: 0 !important;
    padding: 0 20px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #1C1916 !important;
    color: #F1DFA6 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: background-color .2s ease, transform .2s ease;
}
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button:hover {
    background: #2B2622 !important;
    transform: translateY(-1px);
}

/* در حالِ به‌روزرسانی بعد از حذف: نوارِ نازکِ طلایی بالای کارت + اعدادِ کم‌رنگ */
html body.woocommerce-cart .sg-cart-summary .cart_totals.is-syncing table td { opacity: .3; }
html body.woocommerce-cart .sg-cart-summary .cart_totals.is-syncing::before {
    content: "";
    position: absolute;
    top: -24px;
    right: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #C9A227, transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: sg-cart-sync 1s linear infinite;
}
@keyframes sg-cart-sync { from { background-position: -100% 0; } to { background-position: 200% 0; } }
html body.woocommerce-cart .sg-cart-total-bar.is-syncing strong { opacity: .3; transition: opacity .2s ease; }

/* کد تخفیف: یک خطِ جمع‌شونده زیرِ دکمه */
html body.woocommerce-cart .sg-cart-summary .sg-coupon--cart {
    margin-top: 16px !important;
    padding-top: 12px !important;
    border-top: 1px solid #F0EBE1 !important;
}
html body.woocommerce-cart .sg-coupon--cart .sg-coupon__label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
html body.woocommerce-cart .sg-coupon__toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 6px 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: #86660F !important;
    font: inherit;
    font-size: .88rem !important;
    cursor: pointer;
}
html body.woocommerce-cart .sg-coupon__toggle svg { transition: transform .2s ease; }
html body.woocommerce-cart .sg-coupon--cart.is-open .sg-coupon__toggle svg { transform: rotate(180deg); }
html body.woocommerce-cart .sg-coupon--cart .sg-coupon__row { display: none !important; }
html body.woocommerce-cart .sg-coupon--cart.is-open .sg-coupon__row {
    display: flex !important;
    gap: 8px;
    margin-top: 10px;
    animation: sg-cart-open .2s ease both;
}
@keyframes sg-cart-open { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- گوشی ---------- */
@media (max-width: 600px) {
    html body.woocommerce-cart .entry-content > .woocommerce { padding-inline: 0 !important; }
    html body.woocommerce-cart .sg-ci__lock { font-size: .72rem; align-items: flex-start; }
    html body.woocommerce-cart .sg-cart-list { padding: 2px 16px !important; border-radius: 18px !important; }
    html body.woocommerce-cart .sg-cart-list__head { padding: 16px 0 12px; }
    html body.woocommerce-cart .sg-ci {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 0 14px;
        padding: 18px 0;
    }
    html body.woocommerce-cart .sg-ci__img { width: 88px; height: 88px; border-radius: 14px; grid-row: span 2; }
    html body.woocommerce-cart .sg-ci__name, html body.woocommerce-cart .sg-ci__name a { font-size: .92rem !important; }
    html body.woocommerce-cart .sg-ci__side {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
        margin-top: 12px;
        padding-top: 0;
    }
    html body.woocommerce-cart .sg-ci .product-remove a.sg-ci__remove { padding: 6px 4px 6px 10px !important; }
    html body.woocommerce-cart .sg-ci__side { order: 3; }
    html body.woocommerce-cart .cart-collaterals.sg-cart-summary { padding: 20px 18px !important; border-radius: 18px !important; }
}
@media (prefers-reduced-motion: reduce) {
    html body.woocommerce-cart .sg-ci, html body.woocommerce-cart .sg-ci__img img { transition: none !important; }
    html body.woocommerce-cart .sg-cart-summary .cart_totals.is-syncing::before { animation: none; }
}
html body.woocommerce-cart .sg-coupon--cart.is-open .sg-coupon__row { flex-direction: row !important; align-items: stretch; }
html body.woocommerce-cart .sg-coupon--cart .sg-coupon__input { flex: 1 1 auto !important; min-width: 0; width: auto !important; margin: 0 !important; }
html body.woocommerce-cart .sg-coupon--cart .sg-coupon__btn { flex: 0 0 auto !important; width: auto !important; margin: 0 !important; padding: 0 20px !important; }

/* هاور: نوشته‌ی دکمه طلایی بماند (یک قانونِ قدیمی آن را خاکستری می‌کرد) */
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button:hover,
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button:focus,
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button:active,
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button:visited {
    color: #F1DFA6 !important;
}
html body.woocommerce-cart .sg-cart-summary .wc-proceed-to-checkout a.checkout-button:hover * { color: inherit !important; }
