/* WooCommerce Cart
 * Quantity +/- visual CSS is intentionally NOT included here.
 * Keep your existing quantity CSS separate.
 */

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

.cart-container {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, .85fr);
    gap: 24px;
    align-items: start;
    margin-top: 30px;
    direction: rtl;
}

.cart-products {
    min-width: 0;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 4px 22px;
    
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 22px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:has(+ .cart-item) {
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:not(:has(+ .cart-item)) {
    border-bottom: 0;
}
.cart-item-info {
    min-width: 0;
    flex: 1;
    display: flex;
    gap: 16px;
    align-items: center;
}

.cart-item-image {
    width: 112px;
    min-width: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
}

.cart-item-image > a {
    display: block;
    width: 112px;
    height: 112px;
}

.cart-item-image img {
    width: 112px !important;
    height: 112px !important;
    object-fit: contain;
    display: block;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
}

.product-info {
    min-width: 0;
}

.cart-item-brand {
    display: block;
    margin-bottom: 5px;
    color: #999;
    font-size: 12px;
}

.cart-item-title {
    margin: 0;
    line-height: 1.8;
}

.cart-item-title a,
.cart-item-title {
    color: #262626;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.cart-item-meta {
    margin-top: 7px;
    color: #777;
    font-size: 12px;
    line-height: 1.9;
}

.cart-item-meta dl,
.cart-item-meta p {
    margin: 0;
}

.cart-item-meta dt,
.cart-item-meta dd {
    display: inline;
    margin: 0;
}

.cart-item-meta dd {
    margin-left: 10px;
}

.cart-item-meta dd p {
    display: inline;
}

.cart-item-price {
    flex: 0 0 auto;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* تعداد: دسکتاپ کنار اطلاعات/قیمت، موبایل زیر تصویر */
.cart-qty {
    flex: 0 0 112px;
    width: 112px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cart-qty .quantity {
    display: inline-flex;
    align-items: center;
}

.cart-item-price-box {
    text-align: left;
}

.sale-price-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}

.discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 22px;
    padding: 0 7px;
    border-radius: 20px;
    background: #ef394e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.old-price {
    color: #aaa;
    font-size: 12px;
    text-decoration: line-through;
}

.final-price,
.regular-price {
    color: #202020;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.price-currency {
    margin-right: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

.cart-summary {
    position: sticky;
    top: 20px;
}

.summary-box {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 22px;
}

.summary-title {
    margin: 0 0 22px;
    color: #222;
    font-size: 16px;
    font-weight: 800;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
}

.summary-label {
    color: #777;
    font-size: 13px;
}

.summary-value {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.summary-discount .summary-value,
.summary-coupon .summary-value {
    color: #3f8f63;
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    border: 0;
    background: #f0f0f0;
    margin: 19px 0;
}

.summary-total {
    margin-bottom: 8px;
}

.summary-total .summary-label {
    color: #111;
    font-size: 14px;
    font-weight: 700;
}

.summary-total .summary-value,
.summary-total .summary-value * {
    color: #111 !important;
    font-size: 18px;
    font-weight: 600 !important;
}

.cart-bt.checkout-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 20px;
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #674188 !important;
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 700 !important;
    transition: background .2s ease, transform .2s ease;
}

.cart-bt.checkout-button:hover {
    background: #2D1B3D !important;
    transform: translateY(-1px);
}

.coupon-remove-row {
    margin-top: -5px;
    margin-bottom: 14px;
}

.applied-coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #dceee3;
    border-radius: 10px;
    background: #f7fcf9;
}

.applied-coupon-code {
    color: #3f8f63;
    font-size: 12px;
    font-weight: 700;
}

.applied-coupon .woocommerce-remove-coupon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #777 !important;
    text-decoration: none !important;
    font-size: 18px;
    line-height: 1;
    background: #fff;
    border: 1px solid #e8e8e8;
}

.applied-coupon .woocommerce-remove-coupon:hover {
    color: #ef394e !important;
    border-color: #f3c7cd;
    background: #fff7f8;
}

.coupon-box {
    margin-top: 14px;
}

.coupon-title {
    margin: 0 0 12px;
    color: #333;
    font-size: 13px;
    font-weight: 700;
}

.coupon-row {
    display: flex;
    gap: 8px;
}

.coupon-row input {
    min-width: 0;
    flex: 1;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    outline: none;
    font-size: 13px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.coupon-row input:focus {
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0,0,0,.035);
}

.coupon-row .button {
    height: 44px;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #262626 !important;
    color: #fff !important;
    font-size: 12px;
    font-weight: 500 !important;
    white-space: nowrap;
	font-family: 'peyda' !important;
}

@media (max-width: 900px) {
    .cart-container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 18px;
    }

    .cart-summary {
        position: static;
        width: 100%;
    }

    .cart-products {
        padding: 2px 16px;
        border-radius: 14px;
    }

    .cart-item {
        gap: 14px;
        padding: 18px 0;
    }

    .cart-item-image {
        width: 92px;
        min-width: 92px;
    }

    .cart-item-image img {
        width: 92px !important;
        height: 92px !important;
    }

    .cart-item-price {
        min-width: 145px;
    }

    .summary-box {
        padding: 18px;
        border-radius: 14px;
    }
}

@media (max-width: 600px) {
    .cart-products {
        padding: 0 13px;
    }

    .cart-item {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        align-items: start;
        gap: 12px;
    }

    .cart-item-info {
        display: contents;
    }

    .cart-item-image {
        width: 112px;
        min-width: 112px;
        grid-column: 1;
        grid-row: 1;
    }

    .cart-item-image > a {
        width: 82px;
        height: 82px;
    }

    .cart-item-image img {
        width: 82px !important;
        height: 82px !important;
        border-radius: 11px;
    }

    .cart-qty {
        grid-column: 1;
        grid-row: 2;
        width: 112px;
        min-width: 112px;
        align-self: start;
        justify-self: center;
        margin-top: -2px;
    }

    .product-info {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
    }

    .cart-item-title a,
    .cart-item-title {
        font-size: 13px;
        line-height: 1.75;
    }

    .cart-item-brand {
        font-size: 11px;
    }

    .cart-item-meta {
        margin-top: 4px;
        font-size: 11px;
    }

    .cart-item-price {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px 12px;
    }

    .cart-item-price-box {
        margin-right: auto;
    }

    .sale-price-line {
        margin-bottom: 2px;
    }

    .final-price,
    .regular-price {
        font-size: 14px;
    }

    .old-price {
        font-size: 11px;
    }

    .discount-badge {
        min-width: 32px;
        height: 20px;
        font-size: 10px;
    }

    .summary-title {
        margin-bottom: 18px;
    }

    .coupon-row input {
        width: 100%;
    }
}


/* Empty cart */
.custom-empty-cart {
    max-width: 760px;
    margin: 32px auto;
    padding: 58px 24px;
    text-align: center;
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(0,0,0,.035);
}
.custom-empty-cart-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: #fafafa;
    border: 1px solid #eee;
    transform: rotate(-3deg);
}
.custom-empty-cart-icon svg {
    width: 39px;
    height: 39px;
    fill: none;
    stroke: #444;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(3deg);
}
.custom-empty-cart h2 {
    margin: 0 0 9px;
    color: #1d1d1d;
    font-size: 19px;
    font-weight: 700;
}
.custom-empty-cart p {
    max-width: 430px;
    margin: 0 auto 24px;
    color: #777;
    font-size: 13px;
    line-height: 2;
}
.custom-empty-cart .return-to-shop { margin: 0; }
.custom-empty-cart .button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 26px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #222 !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
    transition: transform .2s ease, background .2s ease;
}
.custom-empty-cart .button:hover {
    background: #111 !important;
    transform: translateY(-1px);
}
@media (max-width: 767px) {
    .custom-empty-cart {
        margin: 18px 12px;
        padding: 44px 18px;
        border-radius: 16px;
    }
    .custom-empty-cart-icon {
        width: 72px;
        height: 72px;
        border-radius: 21px;
    }
    .custom-empty-cart h2 { font-size: 17px; }
}


/* Coupon inline notices */
.coupon-notif {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity .2s ease, transform .2s ease;
}

.coupon-notif.show {
    opacity: 1;
    transform: translateY(0);
}

.coupon-notif.error {
    color: #991b1b;
    background: #fff1f2;
    border: 1px solid #fecaca;
}

.coupon-notif.success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

/* Hide WooCommerce success notices on cart; errors remain visible */
.woocommerce-cart .woocommerce-notices-wrapper > .woocommerce-message {
    display: none !important;
}


/* Final cart additions */
.cart-stock-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 8px;
    color: #c62828;
    font-size: 12px;
    line-height: 1.7;
	background: #fff1f1;
	padding: 6px 10px;
	border-radius: 6px;
}
.cart-stock-warning-icon {
    display:flex; align-items:center; justify-content:center;
    width:16px; height:16px; flex:0 0 16px; border-radius:50%;
    background:#c62828; color:#fff; font-size:10px; font-weight:700;
}
.cart-price-change {
    width:fit-content; margin-top:8px; font-size:11px; line-height:1.8;
}
.cart-price-change strong { font-weight:700; }
.cart-price-change.price-up { color:#c62828; }
.cart-price-change.price-down { color:#16803c; }
.cart-bt.checkout-button.checkout-disabled {
    background:#ddd !important; color:#888 !important;
    cursor:not-allowed; pointer-events:none; transform:none !important;
}
.woocommerce-cart .woocommerce-notices-wrapper > .woocommerce-error {
    display:none !important;
}
.coupon-row .button.is-loading {
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: wait;
}

.coupon-spinner {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: coupon-spin .65s linear infinite;
}

@keyframes coupon-spin {
    to {
        transform: rotate(360deg);
    }
}
.cart-item-variation span{
	font-size: 13px;
	font-weight:500;
}