html, body{
    overflow-x:hidden;
}
.cart-summary {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #eee;
    position: sticky;
    top: 20px;
    flex: 0 0 340px;          /* ← عرض ثابت ≈ ۳۴۰px */
    max-width: 380px;         /* حداکثر برای صفحه‌های خیلی بزرگ */
    align-self: flex-start;   /* چسبیده به بالا بمونه */
}

.summary-row{
    display:flex;
    justify-content:space-between;
    margin-bottom:12px;
}

.summary-row.total{
    font-weight:700;
    font-size:18px;
    border-top:1px solid #eee;
    padding-top:15px;
}

.checkout-btn{
    display:block;
    width:100%;
    text-align:center;
    background:#ef394e;
    color:#fff;
    padding:14px;
    border-radius:10px;
    margin-top:20px;
    text-decoration:none;
}

.my-cart-page *{
    box-sizing:border-box;
}

.my-cart-page a{
    text-decoration:none !important;
}

.cart-admin-notice{
    background:#fff8e1;
    border:1px solid #ffe082;
    padding:15px;
    border-radius:12px;
    text-align:center;
    margin-bottom:25px;
}

.checkout-steps {
    width: 100%;
    margin: 40px 0;
}
/*----نوار وضعیت---*/
.step-progress {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0 10px;
    position: relative;
    counter-reset: step;
}

.step-progress::before {
    content: '';
    position: absolute;
    top: 22px;
    right: 0;
    left: 0;
    height: 4px;
    background: #e0e0e0;
    z-index: 0;
    border-radius: 10px;
}

.step {
    position: relative;
    text-align: center;
    flex: 1;
    z-index: 1;
    font-family: inherit;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    width: 45px;
    height: 45px;
    line-height: 45px;
    display: block;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #777;
    font-weight: bold;
    transition: 0.3s ease;
}

.step.active::before {
    background: linear-gradient(135deg, #4e73df, #1cc88a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.step.completed::before {
    content: "✓";
    background: #1cc88a;
    color: #fff;
}

.step span {
    font-size: 12px;
    color: #666;
}

.step.active span {
    font-weight: bold;
    color: #333;
}

.step.completed span {
    color: #1cc88a;
    font-weight: 500;
}
/*----ستون اول---*/
.cart-wrapper {
    display: flex;
    flex-wrap: wrap;          /* ← مهم برای موبایل */
    gap: 10px;                /* کمی فاصله بیشتر بهتره */
    align-items: flex-start;  /* بالا تراز بشن */
} 

.cart-table {
    flex: 1 1 0%;             /* رشد کنه، اما پایه صفر */
    min-width: 0;             /* جلوگیری از overflow */
    /* یا اگر می‌خوای عرض حداقل داشته باشه: min-width: 580px; */
}

/* لیست محصولات */
.cart-items{
    display:flex;
    flex-direction:column;
    gap:10px;
}

/* هر ردیف محصول */
.cart-item {
    display: grid;
    grid-template-columns: 105px 1fr 150px 160px;  /* ← عرض بیشتر برای قیمت و actions */
    gap: 12px;  /* ← فاصله بیشتر بین ستون‌ها */
    align-items: center;
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 16px;
}

/* تصویر */
.item-image img{
    width:100px;
    height:auto;
}

/* اطلاعات */
.item-title{
    font-size:16px;
    margin:0 0 10px;
}

.meta-row{
    font-size:13px;
    color:#666;
    margin:4px 0;
}

.meta-row a{
    color:#555;
}

.shipping-time{
    margin-top:8px;
    font-weight:500;
    color:#ff0000;
}

/* قیمت */
.item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;  /* چپ‌چین نگه دار */
    justify-content: center;  /* عمودی مرکز */
    min-width: 140px;  /* ← حداقل عرض برای جلوگیری از کوچک شدن */
}

.price-old-row{
    display:flex;
    gap:8px;
    align-items:center;
}

.item-price .old{
    text-decoration:line-through;
    color:#999;
    font-size:11px;
}

.item-price .discount{
    background:#ef394e;
    color:#fff;
    font-size:11px;
    padding:3px 6px;
    border-radius:6px;
}

.price-new{
    font-size:16px;
    font-weight:700;
    margin-top:6px;
}

/* تعداد و حذف */
.item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    direction:ltr;
    min-width: 140px;  /* ← حداقل عرض */
}

.remove-item{
    font-size:13px;
    color:#999;
}

.remove-item:hover{
    color:#ef394e;
}

.custom-quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-btn.minus .icon-trash {
    font-size: 20px;
    color: #ef394e;
}

.qty-input {
    width: 45px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 5px 4px;
    font-size: 14px;
}

.cart-item {
    width: 100%;
    max-width: 100%;
}
.cart-summary{
    align-self:flex-start;
}
@media (min-width: 992px){

    .cart-summary{
        position:sticky;
        top:40px;
        height:fit-content;
    }

}
/* ریسپانسیو – موبایل */

/* جلوگیری از کش آمدن بیش از حد در صفحه‌های خیلی عریض */
@media (min-width: 1400px) {
    .cart-wrapper {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

.cart-item {
    max-width:100%;
    overflow:hidden;
}

@media (max-width:768px){

    .cart-item{
        display:grid;
        grid-template-columns:120px 1fr;
        grid-template-areas:
            "image info"
            "price actions";
        gap:10px;
        padding:12px;
        align-items:start;
    }

    .item-image{
        grid-area:image;
    }

    .item-info{
        grid-area:info;
    }

    .item-price{
        grid-area:price;
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        min-width:0;
        padding:8px;
    }
    
    .price-new {
    font-size: 15px;
    }

    .item-actions{
        grid-area:actions;
        display:flex;
        justify-content:flex-end;
        min-width:0;
    }

    .item-image img{
        width:75px;
    }

    /* کاهش فضای کناره‌ها */
    .my-cart-page.container{
        padding-left:8px !important;
        padding-right:8px !important;
    }

    /* summary فول عرض در موبایل */
    .cart-summary{
        flex:unset;
        width:100%;
        max-width:100%;
        position:relative;
        top:auto;
    }
    
    .item-actions{
        grid-area:actions;
        display:flex;
        justify-content:flex-start; /* ← بچسبه به چپ */
        direction:ltr;
        padding-right:6px; 
    }
    
    .cart-admin-notice {
    font-size: 15px;
    }

}