﻿/* ==========================
   cart-panel.css — fixed
   ========================== */

/* بک‌دراپ تاریک */
.cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 9990;
}

/* حالت فعال — پشتیبانی از دو نام کلاس */
.cart-backdrop.active,
.cart-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* اگر jQuery به‌جای کلاس فقط display:inline-block یا display:block ست کند */
.cart-backdrop[style*="display:block"],
.cart-backdrop[style*="display: block"],
.cart-backdrop[style*="display:block;"],
.cart-backdrop[style*="display: block;"] {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* سایدبار */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -380px; /* ⬅️ همیشه بیرون */
    width: 380px;
    max-width: 92vw;
    height: 100vh;
    background: #090c16;
    border-left: 2px solid #00f6ff;
    box-shadow: 0 0 25px #00eaff70;
    transition: right 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 10000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    color:#fff;
}

/* حالت باز */
.cart-sidebar.open,
.cart-sidebar.active {
    right: 0;
}

/* موبایل: slide from right if preferred */
@media (max-width: 576px) {
   .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-sidebar.open,
    .cart-sidebar.active {
        right: 0;
    }
}

/* header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #00eaff;
    border-bottom: 1px solid #00eaff50;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.close-btn { cursor: pointer; font-size: 22px; transition: 0.2s; }
.close-btn:hover { color: #ff4e8a; transform: scale(1.08); }

/* items */
.cart-items { flex: 1; overflow-y: auto; padding-left: 5px; padding-right: 5px; }
.cart-item { display:flex; align-items:center; background:#111526; padding:12px; border-radius:14px; border:1px solid #1c2033; margin-bottom:15px; transition:transform .18s ease, box-shadow .18s ease, background .18s ease; }
.cart-item:hover { transform: translateY(-2px); box-shadow: 0 0 12px #00eaff40; background:#161b2e; }
.cart-item img { width:70px; height:70px; border-radius:12px; margin-left:12px; object-fit:cover; }

.item-info .fw-bold, .item-info h6 { color:#fff; margin:0; font-size:15px; }
.item-info .small { font-size:13px; opacity:.85; display:block; margin-top:3px; }

/* remove btn */
.remove-item { color:#ff4d4d; cursor:pointer; font-size:20px; margin-right:auto; background:transparent; border:none; transition:transform .12s ease; }
.remove-item:hover { transform: scale(1.12); }

/* footer */
.cart-footer { border-top:1px solid #00eaff40; padding-top:18px; margin-top:8px; }
.total-box { display:flex; justify-content:space-between; color:#fff; margin-bottom:12px; }
.checkout-btn { width:100%; background: linear-gradient(45deg,#00eaff,#00bcd4); color:#000; border:none; padding:12px 14px; font-size:16px; border-radius:12px; font-weight:700; transition: transform .18s ease; }
.checkout-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* z-index safety */
body .cart-backdrop { z-index: 9990; }
body .cart-sidebar { z-index: 10000; }

/* optional: block body scroll while cart open */
body.cart-open { overflow: hidden; }
