/* STORE90 Cart + Wishlist V2 — extends store90.css and products-v2.css */

.cart-page{
    --cart-navy:var(--s90-ink);
    --cart-orange:var(--s90-primary);
    --cart-blue:var(--s90-primary);
    --cart-text:var(--s90-ink);
    --cart-muted:var(--s90-muted);
    --cart-border:var(--s90-line);
    --cart-soft:var(--s90-bg);
    --cart-success:#15945a;
    min-height:70vh;
    padding:22px 0 38px;
    background:var(--s90-bg);
}

.cart-shell{
    width:min(1440px,calc(100% - 34px));
    margin-inline:auto;
}

/* رأس الصفحة */
.cart-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:16px;
    padding:0 2px;
}

.cart-title-wrap{
    display:flex;
    align-items:center;
    gap:12px;
}

.cart-title-icon{
    width:46px;
    height:46px;
    flex:0 0 46px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:14px;
    background:#eef5ff;
    color:var(--s90-primary);
    font-size:20px;
}

.cart-top h1{
    margin:0;
    color:var(--cart-text);
    font-size:28px;
    font-weight:950;
}

.cart-top p{
    margin:4px 0 0;
    color:var(--cart-muted);
    font-size:13px;
}

.cart-count-pill{
    display:inline-flex;
    align-items:center;
    gap:7px;
    min-height:40px;
    padding:8px 13px;
    background:#fff;
    color:var(--cart-navy);
    border:1px solid var(--cart-border);
    border-radius:999px;
    font-size:13px;
    font-weight:850;
    box-shadow:0 4px 14px rgba(15,33,58,.03);
}

.cart-count-pill i{
    color:var(--s90-primary);
}

/* التخطيط */
.cart-layout{
    display:grid;
    grid-template-columns:minmax(0,1.75fr) minmax(330px,.72fr);
    gap:18px;
    align-items:start;
}

.cart-panel,
.summary-card{
    background:#fff;
    border:1px solid var(--cart-border);
    border-radius:18px;
    box-shadow:0 8px 24px rgba(15,33,58,.045);
}

/* المنتجات */
.cart-panel{
    overflow:hidden;
}

.cart-panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:15px 18px;
    border-bottom:1px solid var(--cart-border);
}

.cart-panel-head strong{
    color:var(--cart-text);
    font-size:15px;
    font-weight:900;
}

.cart-panel-head span{
    color:var(--cart-muted);
    font-size:12px;
}

.table-responsive{
    padding:0 12px 4px;
}

.cart-table{
    width:100%;
    margin:0;
    border-collapse:separate;
    border-spacing:0 9px;
}

.cart-table thead th{
    padding:8px 12px;
    background:transparent;
    border:0;
    color:#8a96a6;
    font-size:11px;
    font-weight:850;
    text-align:center;
}

.cart-table thead th:first-child{
    text-align:right;
}

.cart-table tbody tr{
    background:#fff;
    box-shadow:0 0 0 1px #edf1f5;
    transition:.18s ease;
}

.cart-table tbody tr:hover{
    box-shadow:0 6px 18px rgba(15,33,58,.06),0 0 0 1px #e4eaf0;
}

.cart-table tbody td{
    padding:12px;
    vertical-align:middle;
    border:0;
    border-top:1px solid transparent;
    border-bottom:1px solid transparent;
}

.cart-table tbody td:first-child{
    border-radius:0 13px 13px 0;
}

.cart-table tbody td:last-child{
    border-radius:13px 0 0 13px;
}

.cart-table tbody td:not(:first-child){
    text-align:center;
}

/* بيانات المنتج */
.product-info{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:250px;
}

.product-image-box{
    width:76px;
    height:76px;
    flex:0 0 76px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    background:var(--cart-soft);
    border:1px solid var(--cart-border);
    border-radius:13px;
}

.product-image-box img{
    width:100%;
    height:100%;
    object-fit:contain;
    padding:5px;
}

.product-name{
    display:block;
    overflow:visible;
    white-space:normal;
    overflow-wrap:anywhere;
    margin-bottom:5px;
    color:var(--cart-text);
    font-size:14px;
    font-weight:900;
    line-height:1.55;
    text-decoration:none;
}

.product-name:hover{
    color:var(--cart-blue);
}

.product-badge{
    display:inline-flex;
    align-items:center;
    padding:3px 7px;
    background:#eef5ff;
    color:#d97c00;
    border:1px solid #ffe0ae;
    border-radius:999px;
    font-size:9px;
    font-weight:900;
}

/* السعر والكمية */
.unit-price{
    text-align:center;
}

.old-price{
    display:block;
    margin-bottom:2px;
    color:#a2abb7;
    font-size:11px;
    text-decoration:line-through;
}

.current-price,
.item-total{
    color:var(--cart-navy);
    font-size:14px;
    font-weight:950;
    white-space:nowrap;
}

.quantity-control{
    display:inline-flex;
    align-items:center;
    padding:3px;
    background:#f7f9fb;
    border:1px solid var(--cart-border);
    border-radius:10px;
}

.qty-btn{
    width:30px;
    height:30px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:8px;
    background:#fff;
    color:var(--cart-navy);
    box-shadow:0 1px 3px rgba(0,0,0,.035);
}

.qty-btn:hover{
    background:var(--cart-navy);
    color:#fff;
}

.qty-input{
    width:36px;
    padding:0;
    border:0;
    outline:none;
    background:transparent;
    color:var(--cart-text);
    text-align:center;
    font-weight:900;
    -moz-appearance:textfield;
}

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

.remove-btn{
    width:34px;
    height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:10px;
    background:#fff3f4;
    color:#d94b52;
    transition:.18s ease;
}

.remove-btn:hover{
    background:#d94b52;
    color:#fff;
}

/* أسفل قائمة المنتجات */
.cart-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:13px 16px;
    background:#fafbfd;
    border-top:1px solid var(--cart-border);
}

.cart-actions .btn{
    min-height:40px;
    padding:8px 13px;
    border-radius:10px;
    font-size:13px;
    font-weight:850;
}

/* ملخص الطلب */
.summary-card{
    position:sticky;
    top:18px;
    overflow:hidden;
}

.summary-header{
    position:relative;
    padding:17px 18px 13px;
    background:linear-gradient(135deg,#0b55c9,#0d63f3);
    color:#fff;
}

.summary-header::after{
    content:"";
    position:absolute;
    top:-55px;
    left:-35px;
    width:130px;
    height:130px;
    border-radius:50%;
    background:rgba(255,255,255,.10);
}

.summary-header h3{
    position:relative;
    z-index:1;
    margin:0;
    color:#fff;
    font-size:18px;
    font-weight:950;
}

.summary-header p{
    position:relative;
    z-index:1;
    margin:4px 0 0;
    color:rgba(255,255,255,.65);
    font-size:11px;
}

.summary-body{
    padding:15px 18px 18px;
}

.summary-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:8px 0;
    font-size:13px;
}

.summary-row .label{
    color:var(--cart-muted);
}

.summary-row .value{
    color:var(--cart-text);
    font-weight:900;
    white-space:nowrap;
}

.summary-row.discount .value{
    color:var(--cart-success);
}

.summary-total{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    margin-top:6px;
    padding-top:14px;
    border-top:1px dashed #d8e0e8;
}

.summary-total span:first-child{
    color:var(--cart-text);
    font-size:15px;
    font-weight:950;
}

.summary-total .value{
    color:var(--s90-primary);
    font-size:25px;
    font-weight:950;
    line-height:1;
}

/* الكوبون */
.coupon-box{
    margin-top:16px;
    padding-top:14px;
    border-top:1px solid var(--cart-border);
}

.coupon-label{
    margin-bottom:7px;
    color:var(--cart-text);
    font-size:12px;
    font-weight:900;
}

.coupon-input .input-group{
    overflow:hidden;
    background:#f8fafc;
    border:1px solid var(--cart-border);
    border-radius:10px;
}

.coupon-input .form-control{
    min-height:42px;
    padding:9px 11px;
    border:0;
    background:transparent;
    box-shadow:none;
    font-size:13px;
}

.btn-apply{
    min-width:78px;
    border:0;
    background:var(--cart-navy);
    color:#fff;
    font-size:12px;
    font-weight:900;
}

.coupon-applied{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-top:8px;
    padding:9px 10px;
    background:#f0fbf5;
    border:1px solid #d2f2df;
    border-radius:10px;
    font-size:11px;
}

.coupon-applied .code{
    color:#16874c;
    font-weight:950;
}

.remove-coupon{
    border:0;
    background:transparent;
    color:#dc3545;
}

/* زر الدفع */
.checkout-btn{
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    margin-top:15px;
    padding:11px 14px;
    background:var(--s90-primary);
    color:#fff;
    border-radius:11px;
    text-decoration:none;
    font-weight:950;
    transition:.18s ease;
}

.checkout-btn:hover{
    background:var(--s90-primary-dark);
    color:#fff;
    transform:translateY(-1px);
    box-shadow:0 9px 22px rgba(13,99,243,.20);
}

.secure-note{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    margin-top:9px;
    color:#8a96a5;
    font-size:10px;
}

.secure-note i{
    color:var(--cart-success);
}

/* السلة الفارغة */
.empty-cart{
    padding:62px 20px;
    background:#fff;
    border:1px solid var(--cart-border);
    border-radius:20px;
    text-align:center;
    box-shadow:0 8px 24px rgba(15,33,58,.04);
}

.empty-cart .icon{
    width:78px;
    height:78px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 15px;
    background:#f5f7fa;
    color:#abb5c2;
    border-radius:22px;
    font-size:30px;
}

.empty-cart h4{
    margin-bottom:7px;
    color:var(--cart-text);
    font-size:22px;
    font-weight:950;
}

.empty-cart p{
    color:var(--cart-muted);
}

.empty-cart .btn{
    min-height:43px;
    padding:9px 20px;
    border-radius:10px;
    font-weight:850;
}

/* responsive */
@media(max-width:991.98px){
    .cart-layout{
        grid-template-columns:1fr;
    }

    .summary-card{
        position:static;
    }
}

@media(max-width:767.98px){
    .cart-page{
        padding-top:15px;
    }

    .cart-shell{
        width:min(100% - 18px,1440px);
    }

    .cart-top{
        align-items:center;
    }

    .cart-title-icon{
        width:40px;
        height:40px;
        flex-basis:40px;
        border-radius:12px;
    }

    .cart-top h1{
        font-size:22px;
    }

    .cart-top p{
        display:none;
    }

    .cart-count-pill{
        min-height:36px;
        padding:6px 10px;
        font-size:11px;
    }

    .cart-panel-head{
        padding:13px 14px;
    }

    .cart-panel-head span{
        display:none;
    }

    .table-responsive{
        padding:0;
    }

    .cart-table{
        display:block;
        border-spacing:0;
    }

    .cart-table thead{
        display:none;
    }

    .cart-table tbody{
        display:block;
    }

    .cart-table tbody tr{
        display:block;
        margin:0;
        padding:13px 14px;
        border-bottom:1px solid var(--cart-border);
        box-shadow:none;
    }

    .cart-table tbody tr:last-child{
        border-bottom:0;
    }

    .cart-table tbody td{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        padding:7px 0;
        border:0;
        text-align:left!important;
    }

    .cart-table tbody td:first-child{
        display:block;
        padding-bottom:11px;
        border-radius:0;
    }

    .cart-table tbody td:last-child{
        border-radius:0;
    }

    .cart-table tbody td:not(:first-child)::before{
        content:attr(data-label);
        color:var(--cart-muted);
        font-size:11px;
        font-weight:850;
    }

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

    .product-image-box{
        width:66px;
        height:66px;
        flex-basis:66px;
    }

    .product-name{
        font-size:13px;
    }

    .cart-actions{
        flex-direction:column;
    }

    .cart-actions .btn{
        width:100%;
    }
}

@media(max-width:420px){
    .cart-count-pill span{
        display:none;
    }

    .cart-count-pill{
        width:36px;
        justify-content:center;
        padding:0;
    }
}

/* Wishlist page — STORE90 V2 */
.wishlist-page{min-height:70vh;padding:24px 0 42px;background:var(--s90-bg)}
.wishlist-page .container{max-width:1380px}
.wishlist-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:12px;padding:0 2px}
.wishlist-title-wrap{display:flex;align-items:center;gap:11px}
.wishlist-title-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:#fff1f3;color:#e24a55;font-size:18px}
.wishlist-header h2{margin:0;color:var(--s90-ink);font-size:24px;font-weight:950}
.wishlist-header .sub-title{margin:3px 0 0;color:var(--s90-muted);font-size:11px}
.wishlist-header .items-count{display:inline-flex;align-items:center;min-height:36px;padding:6px 12px;border:1px solid var(--s90-line);border-radius:999px;background:#fff;color:#667386;font-size:11px;font-weight:850}
.wishlist-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.wishlist-grid .product-card .btn-wishlist{top:10px;left:10px;bottom:auto;color:#e24a55;border-color:#f1d7da}
.wishlist-grid .product-card .btn-wishlist:hover{background:#e24a55;color:#fff;border-color:#e24a55}
.wishlist-grid .product-image{aspect-ratio:1/.84}
.empty-wishlist{max-width:620px;margin:35px auto 0;padding:52px 24px;text-align:center;background:#fff;border:1px solid var(--s90-line);border-radius:18px;box-shadow:var(--s90-shadow)}
.empty-wishlist .icon{width:68px;height:68px;display:grid;place-items:center;margin:0 auto 14px;border-radius:18px;background:#fff1f3;color:#e24a55;font-size:25px}
.empty-wishlist h4{margin-bottom:7px;color:var(--s90-ink);font-size:18px;font-weight:950}
.empty-wishlist p{margin-bottom:18px;color:var(--s90-muted);font-size:11px}
.empty-wishlist .btn{padding:10px 20px;border:0;border-radius:10px;background:var(--s90-primary);font-size:11px;font-weight:900}
@media(max-width:1199px){.wishlist-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){.wishlist-page{padding-top:14px}.wishlist-page .container{padding-inline:10px}.wishlist-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.wishlist-header h2{font-size:19px}.wishlist-title-icon{width:38px;height:38px;border-radius:11px}}
@media(max-width:380px){.wishlist-grid{grid-template-columns:1fr}}

/* Phase 27 — wishlist single-item mobile layout */
@media(max-width:767px){
 .wishlist-grid>.product-card:only-child{grid-column:1/-1;width:min(100%,520px);justify-self:center}
 .wishlist-grid>.product-card:only-child .product-image{aspect-ratio:1/.72}
}
