/**
 * Moshina Child Theme - Cart Page Styles
 * Modern, responsive, Arabic (RTL) styled cart page.
 */

:root {
    --moshina-cart-primary: #C07D36;
    --moshina-cart-primary-dark: #a66627;
    --moshina-cart-primary-light: #fef7ee;
    --moshina-cart-text: #1e293b;
    --moshina-cart-text-muted: #64748b;
    --moshina-cart-bg: #f8fafc;
    --moshina-cart-card-bg: #ffffff;
    --moshina-cart-border: #e2e8f0;
    --moshina-cart-radius: 16px;
    --moshina-cart-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

.moshina-cart-page-wrapper {
    font-family: inherit;
    direction: rtl;
    text-align: right;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    color: var(--moshina-cart-text);
}

/* ── Empty Cart State ───────────────────────────────────────── */
.moshina-cart-empty-box {
    background: var(--moshina-cart-card-bg);
    border: 1px solid var(--moshina-cart-border);
    border-radius: var(--moshina-cart-radius);
    box-shadow: var(--moshina-cart-shadow);
    padding: 60px 20px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
}

.moshina-cart-empty-icon-wrap {
    width: 90px;
    height: 90px;
    background: var(--moshina-cart-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 42px;
}

.moshina-cart-empty-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--moshina-cart-text);
    margin-bottom: 12px;
}

.moshina-cart-empty-subtitle {
    font-size: 15px;
    color: var(--moshina-cart-text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.moshina-cart-shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--moshina-cart-primary);
    color: #ffffff !important;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(192, 125, 54, 0.3);
}

.moshina-cart-shop-btn:hover {
    background: var(--moshina-cart-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 125, 54, 0.4);
}

/* ── Dynamic Free Shipping Notice Bar ──────────────────────── */
.moshina-cart-shipping-bar {
    background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%);
    border: 1px solid #ffedd5;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.08);
}

.moshina-cart-shipping-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #9a3412;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.moshina-cart-shipping-bar-header .bar-icon {
    font-size: 18px;
}

.moshina-cart-shipping-bar-header .highlight-free {
    color: #059669;
    font-weight: 800;
}

.moshina-cart-shipping-progress {
    height: 10px;
    background: #fed7aa;
    border-radius: 999px;
    overflow: hidden;
}

.moshina-cart-shipping-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ── Main Cart Layout Grid ─────────────────────────────────── */
.moshina-cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* ── Left Column Card ──────────────────────────────────────── */
.moshina-cart-card {
    background: var(--moshina-cart-card-bg);
    border: 1px solid var(--moshina-cart-border);
    border-radius: var(--moshina-cart-radius);
    box-shadow: var(--moshina-cart-shadow);
    padding: 24px;
}

.moshina-cart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--moshina-cart-border);
    margin-bottom: 20px;
}

.moshina-cart-card-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.moshina-cart-card-header h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--moshina-cart-text);
}

.moshina-cart-count-badge {
    color: var(--moshina-cart-primary);
    font-weight: 800;
}

.moshina-cart-continue-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--moshina-cart-primary);
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.moshina-cart-continue-link:hover {
    color: var(--moshina-cart-primary-dark);
}

/* ── Cart Items List ───────────────────────────────────────── */
.moshina-cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.moshina-cart-item-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px 40px;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.moshina-cart-item-row:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.moshina-cart-item-row.is-updating {
    opacity: 0.5;
    pointer-events: none;
}

/* Thumbnail */
.moshina-cart-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moshina-cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info & Options */
.moshina-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.moshina-cart-item-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.moshina-cart-item-title a {
    color: var(--moshina-cart-text);
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.moshina-cart-item-title a:hover {
    color: var(--moshina-cart-primary);
}

.moshina-cart-item-unit-price {
    font-size: 13px;
    color: var(--moshina-cart-text-muted);
}

.moshina-cart-item-unit-price .val {
    font-weight: 600;
    color: #475569;
}

.moshina-cart-item-options {
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 4px;
}

.moshina-cart-item-options dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
}

.moshina-cart-item-options dt {
    font-weight: 700;
}

.moshina-cart-item-options dd {
    margin: 0;
}

/* Quantity Controls */
.moshina-cart-item-qty-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.moshina-cart-item-qty-col .qty-label {
    font-size: 11px;
    color: var(--moshina-cart-text-muted);
}

.moshina-cart-qty-ctrl {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--moshina-cart-border);
    border-radius: 8px;
    overflow: hidden;
}

.moshina-cart-qty-btn {
    width: 30px;
    height: 32px;
    background: #f8fafc;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--moshina-cart-text);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moshina-cart-qty-btn:hover {
    background: #e2e8f0;
}

.moshina-cart-qty-input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--moshina-cart-border);
    border-right: 1px solid var(--moshina-cart-border);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--moshina-cart-text);
    -moz-appearance: textfield;
}

.moshina-cart-qty-input::-webkit-outer-spin-button,
.moshina-cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Subtotal */
.moshina-cart-item-subtotal-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.moshina-cart-item-subtotal-col .subtotal-label {
    font-size: 11px;
    color: var(--moshina-cart-text-muted);
}

.moshina-cart-item-subtotal-val {
    font-size: 15px;
    font-weight: 800;
    color: var(--moshina-cart-primary);
}

/* Remove button */
.moshina-cart-item-remove-col {
    display: flex;
    justify-content: center;
}

.moshina-cart-remove-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moshina-cart-remove-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* ── Right Side: Order Summary Sidebar ─────────────────────── */
.moshina-cart-summary-card {
    background: var(--moshina-cart-card-bg);
    border: 1px solid var(--moshina-cart-border);
    border-radius: var(--moshina-cart-radius);
    box-shadow: var(--moshina-cart-shadow);
    padding: 24px;
    position: sticky;
    top: 90px;
}

.moshina-cart-summary-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 20px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--moshina-cart-border);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--moshina-cart-text);
}

.moshina-cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 14px;
}

.moshina-cart-summary-row .label {
    color: var(--moshina-cart-text-muted);
    font-weight: 600;
}

.moshina-cart-summary-row .val {
    font-weight: 700;
    color: var(--moshina-cart-text);
}

.moshina-cart-free-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.moshina-cart-summary-divider {
    height: 1px;
    background: var(--moshina-cart-border);
    margin: 18px 0;
}

.moshina-cart-summary-row.total-row {
    font-size: 18px;
    margin-bottom: 4px;
}

.moshina-cart-summary-row.total-row .label {
    font-weight: 800;
    color: var(--moshina-cart-text);
}

.moshina-cart-summary-row.total-row .val {
    font-weight: 900;
    color: var(--moshina-cart-primary);
    font-size: 20px;
}

.moshina-cart-tax-notice {
    display: block;
    font-size: 11px;
    color: var(--moshina-cart-text-muted);
    margin-bottom: 22px;
}

/* Coupon Box */
.moshina-cart-coupon-box {
    margin: 16px 0;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
}

.moshina-cart-coupon-form {
    display: flex;
    gap: 8px;
}

.moshina-cart-coupon-input {
    flex: 1;
    height: 40px;
    border: 1px solid var(--moshina-cart-border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    background: #ffffff;
    color: var(--moshina-cart-text);
    outline: none;
    transition: border-color 0.2s ease;
}

.moshina-cart-coupon-input:focus {
    border-color: var(--moshina-cart-primary);
}

.moshina-cart-coupon-btn {
    height: 40px;
    background: var(--moshina-cart-text);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.moshina-cart-coupon-btn:hover {
    background: var(--moshina-cart-primary);
}

.moshina-cart-coupon-msg {
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.moshina-cart-coupon-msg.success {
    display: block;
    color: #15803d;
    font-weight: 600;
}

.moshina-cart-coupon-msg.error {
    display: block;
    color: #b91c1c;
    font-weight: 600;
}

/* Applied Coupons Tags */
.moshina-cart-coupons-applied {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.moshina-cart-coupon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.moshina-cart-coupon-row .coupon-tag {
    font-weight: 700;
    color: #166534;
}

.moshina-cart-coupon-row .coupon-discount {
    font-weight: 800;
    color: #15803d;
}

.moshina-cart-remove-coupon {
    background: transparent;
    border: none;
    color: #dc2626;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.moshina-cart-remove-coupon:hover {
    background: #fee2e2;
}

/* Checkout Button */
.moshina-cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    background: var(--moshina-cart-primary);
    color: #ffffff !important;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(192, 125, 54, 0.3);
}

.moshina-cart-checkout-btn:hover {
    background: var(--moshina-cart-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 125, 54, 0.4);
}

.moshina-cart-checkout-btn .btn-arrow {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.moshina-cart-checkout-btn:hover .btn-arrow {
    transform: translateX(-4px);
}

/* Trust Badges */
.moshina-cart-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--moshina-cart-border);
}

.moshina-cart-trust-badges .badge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--moshina-cart-text-muted);
}

/* ── Responsive Breakpoints ────────────────────────────────── */
@media (max-width: 991px) {
    .moshina-cart-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .moshina-cart-summary-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .moshina-cart-card {
        padding: 16px;
    }

    .moshina-cart-item-row {
        grid-template-columns: 60px 1fr auto;
        grid-template-areas: 
            "thumb info remove"
            "thumb qty subtotal";
        gap: 10px;
        padding: 12px;
    }

    .moshina-cart-item-thumb {
        grid-area: thumb;
        width: 60px;
        height: 60px;
    }

    .moshina-cart-item-info {
        grid-area: info;
    }

    .moshina-cart-item-qty-col {
        grid-area: qty;
        align-items: flex-start;
    }

    .moshina-cart-item-subtotal-col {
        grid-area: subtotal;
        align-items: flex-end;
        justify-content: flex-end;
    }

    .moshina-cart-item-remove-col {
        grid-area: remove;
        justify-content: flex-end;
    }
}
