/* ==========================================================
   استایل شورت‌کد مستقل سبد خرید [tamyar_cart]
   کاملاً جدا از ویجت Elementor قالب (کلاس‌های wd-cart-table/wd-cart-totals
   در cart-page.css) — این‌جا فقط روی کلاس‌های tamyar-sc-* کار می‌کنیم.
   ========================================================== */

.tamyar-sc-cart,
.tamyar-sc-cart * {
    box-sizing: border-box;
}

.tamyar-sc-cart {
    direction: rtl;
    unicode-bidi: embed;
    font-family: 'YekanBakhFaNum', Tahoma, Arial, sans-serif;
    color: var(--tl-text);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 28px;
}

.tamyar-sc-cart .woocommerce-Price-amount {
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
}

/* ---------- حالت خالی ---------- */
.tamyar-sc-cart--empty {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 60px 20px;
}

.tamyar-sc-cart__empty-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--tl-surface-muted);
    color: var(--tl-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin-bottom: 20px;
}

.tamyar-sc-cart__empty-text {
    font-size: 15.5px;
    color: var(--tl-text-muted);
    margin: 0 0 22px;
}

/* ---------- دکمه‌های عمومی ---------- */
.tamyar-sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border-radius: var(--tl-radius-pill);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all .2s ease;
}

.tamyar-sc-btn--primary {
    background: linear-gradient(135deg, var(--tl-primary) 0%, var(--tl-primary-dark) 100%);
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(196, 22, 28, .25);
}

.tamyar-sc-btn--primary:hover {
    transform: translateY(-2px);
    color: #fff !important;
}

.tamyar-sc-btn--outline {
    background: transparent;
    color: var(--tl-text-muted);
    border: 1.5px solid var(--tl-border);
}

.tamyar-sc-btn--outline:hover {
    background: var(--tl-surface-muted);
    border-color: var(--tl-primary);
    color: var(--tl-text);
}

.tamyar-sc-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* ---------- ستون جدول محصولات ---------- */
.tamyar-sc-cart__form {
    flex: 2;
    min-width: 320px;
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius-lg);
    overflow: hidden;
}

.tamyar-sc-cart__table {
    width: 100%;
    border-collapse: collapse;
}

.tamyar-sc-cart__table thead th {
    background: var(--tl-surface-muted);
    color: var(--tl-text-muted);
    font-size: 13.5px;
    font-weight: 700;
    padding: 16px 12px;
    text-align: center;
}

.tamyar-sc-cart__table thead th.tamyar-sc-cart__cell--name {
    text-align: right;
}

.tamyar-sc-cart__row td {
    padding: 16px 12px;
    vertical-align: middle;
    text-align: center;
}

/* حذف */
.tamyar-sc-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--tl-surface-muted);
    color: var(--tl-text-muted);
    border-radius: 50%;
    text-decoration: none;
    transition: all .2s ease;
}

.tamyar-sc-remove svg {
    pointer-events: none;
}

.tamyar-sc-remove:hover {
    background: var(--tl-danger);
    color: #fff;
    transform: scale(1.08);
}

/* تصویر */
.tamyar-sc-cart__cell--thumb img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--tl-radius-md);
    border: 1px solid var(--tl-border);
}

/* نام محصول */
.tamyar-sc-cart__cell--name {
    text-align: right;
}

.tamyar-sc-cart__cell--name a {
    color: var(--tl-text);
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    line-height: 1.6;
}

.tamyar-sc-cart__cell--name a:hover {
    color: var(--tl-primary);
}

.tamyar-sc-cart__cell--name .wc-item-meta,
.tamyar-sc-cart__cell--name .variation {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 12.5px;
    color: var(--tl-text-muted);
}

.tamyar-sc-backorder {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--tl-accent);
}

/* قیمت واحد: خنثی تا فقط جمع‌کل نهایی قرمز و برجسته بمونه.
   !important لازمه چون global-brand.css با !important رنگ قرمز برند رو
   روی همه‌ی .woocommerce-Price-amount سایت می‌ذاره. */
.tamyar-sc-cart__cell--price .woocommerce-Price-amount {
    color: var(--tl-text-muted) !important;
    font-weight: 500;
    font-size: 14px;
}

/* جمع جزء هر ردیف */
.tamyar-sc-cart__cell--subtotal .woocommerce-Price-amount {
    color: var(--tl-primary) !important;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

/* ---------- کنترل تعداد (استپر custom-qty-wrapper خودکار اضافه می‌شه) ---------- */
.tamyar-sc-cart__cell--qty .custom-qty-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--tl-surface-muted);
    border-radius: var(--tl-radius-pill);
    padding: 4px;
    border: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}

.tamyar-sc-cart__cell--qty .custom-qty-wrapper:focus-within {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 3px rgba(196, 22, 28, .12);
}

.tamyar-sc-cart__cell--qty .custom-qty-wrapper button {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--tl-surface);
    color: var(--tl-text);
    font-size: 15px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.tamyar-sc-cart__cell--qty .custom-qty-wrapper button:hover {
    background: var(--tl-primary);
    color: #fff;
}

.tamyar-sc-cart__cell--qty .custom-qty-wrapper .cqty {
    width: 36px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--tl-text);
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.tamyar-sc-cart__cell--qty .custom-qty-wrapper .cqty::-webkit-outer-spin-button,
.tamyar-sc-cart__cell--qty .custom-qty-wrapper .cqty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- نوار عملیات (کد تخفیف / بروزرسانی) ---------- */
.tamyar-sc-cart__actions-row td {
    padding: 18px 14px;
}

.tamyar-sc-cart__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.tamyar-sc-coupon {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
    flex: 1 1 280px;
}

.tamyar-sc-coupon__input {
    flex: 1;
    min-width: 150px;
    padding: 11px 16px;
    border: 1.5px solid var(--tl-border);
    border-radius: var(--tl-radius-pill);
    font-size: 14px;
    background: var(--tl-surface-muted);
    color: var(--tl-text);
    outline: none;
    transition: all .2s;
    text-align: right;
}

.tamyar-sc-coupon__input:focus {
    border-color: var(--tl-primary);
    background: var(--tl-surface);
    box-shadow: 0 0 0 4px rgba(196, 22, 28, .08);
}

/* ---------- سایدبار جمع‌کل ---------- */
.tamyar-sc-cart__totals {
    flex: 1;
    min-width: 280px;
}

.tamyar-sc-cart__totals-inner {
    background: var(--tl-surface-muted);
    border-radius: var(--tl-radius-lg);
    padding: 26px 22px 22px;
    border: 1px solid var(--tl-border);
    box-shadow: 0 6px 24px rgba(23, 32, 42, .06);
}

.tamyar-sc-cart__totals-inner h2 {
    font-size: 19px;
    font-weight: 700;
    color: var(--tl-text);
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--tl-border);
    text-align: right;
}

.tamyar-sc-cart__totals-table {
    width: 100%;
    border-spacing: 0;
    background: transparent;
}

.tamyar-sc-cart__totals-table tr {
    border-bottom: 1px solid var(--tl-border);
}

.tamyar-sc-cart__totals-table tr:last-child {
    border-bottom: none;
}

.tamyar-sc-cart__totals-table th,
.tamyar-sc-cart__totals-table td {
    padding: 13px 0;
    text-align: right;
    background: transparent;
    border: none;
    font-size: 14.5px;
}

.tamyar-sc-cart__totals-table th {
    font-weight: 600;
    color: var(--tl-text-muted);
}

.tamyar-sc-cart__totals-table td {
    font-weight: 500;
    color: var(--tl-text);
}

.tamyar-sc-cart__totals-table .order-total th,
.tamyar-sc-cart__totals-table .order-total td {
    padding-top: 16px;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--tl-text);
}

.tamyar-sc-cart__totals-table .order-total .woocommerce-Price-amount {
    color: var(--tl-primary) !important;
    font-size: 20px;
    font-weight: 800;
}

.tamyar-sc-cart__totals-table .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tamyar-sc-cart__totals-table .woocommerce-shipping-methods li {
    padding: 6px 0;
    text-align: right;
    font-size: 13.5px;
}

.tamyar-sc-cart__totals-table .woocommerce-shipping-destination {
    font-size: 12.5px;
    color: var(--tl-text-muted);
    background: var(--tl-surface);
    padding: 8px 12px;
    border-radius: var(--tl-radius-sm);
    margin-top: 8px;
    display: block;
}

/* دکمه اقدام به پرداخت */
.tamyar-sc-cart__checkout {
    margin-top: 20px;
}

.tamyar-sc-cart__checkout .checkout-button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--tl-primary) 0%, var(--tl-primary-dark) 100%);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: var(--tl-radius-pill);
    text-decoration: none;
    transition: all .3s ease;
    box-shadow: 0 6px 24px rgba(196, 22, 28, .3);
}

.tamyar-sc-cart__checkout .checkout-button:hover {
    background: var(--tl-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(196, 22, 28, .4);
}

/* ==========================================
   واکنش‌گرایی — جدول در موبایل به کارت تبدیل می‌شه
   ========================================== */
@media (max-width: 767px) {
    .tamyar-sc-cart {
        flex-direction: column;
    }

    .tamyar-sc-cart__table,
    .tamyar-sc-cart__table tbody,
    .tamyar-sc-cart__row {
        display: block;
        width: 100%;
    }

    .tamyar-sc-cart__table thead {
        display: none;
    }

    .tamyar-sc-cart__row {
        position: relative;
        border-bottom: 1px solid var(--tl-border);
        padding: 14px 0;
    }

    .tamyar-sc-cart__row td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: right;
        border-bottom: none;
        padding: 6px 4px;
    }

    .tamyar-sc-cart__row td[data-title]::before {
        content: attr(data-title);
        font-weight: 700;
        font-size: 12.5px;
        color: var(--tl-text-muted);
    }

    .tamyar-sc-cart__cell--remove {
        position: absolute;
        top: 10px;
        left: 4px;
        width: auto;
    }

    .tamyar-sc-cart__cell--thumb {
        justify-content: flex-start !important;
    }

    .tamyar-sc-cart__totals-inner {
        margin-top: 4px;
        padding: 20px 16px;
    }
}
