﻿/* ============================================================
   ১. CART OVERLAY (কার্টের বাইরে ক্লিক করে বন্ধ করার জন্য)
============================================================ */
.cart-overlay,
#cartOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5); /* ব্যাকগ্রাউন্ড শ্যাডো */
    z-index: 9998; /* Drawer এর ঠিক এক ধাপ নিচে */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

/* JS দিয়ে 'show' ক্লাস যুক্ত হলে দৃশ্যমান হবে */
.cart-overlay.show,
#cartOverlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   ২. CART DRAWER MAIN CONTAINER (মূল ড্রয়ার)
============================================================ */
.cart-drawer,
#cartDrawer {
    position: fixed;
    top: 0;
    right: -100%; /* ডিফল্টভাবে ডানপাশে লুকানো থাকবে */
    width: 100%;
    max-width: 380px; /* মোবাইল ও ডেস্কটপ দুই জায়গাতেই সুন্দর সাইজ */
    height: 100vh;
    height: 100dvh; /* Dynamic Viewport Height (মোবাইলেও নিচে বাটন কাটবে না) */
    max-height: 100dvh;
    background-color: #ffffff;
    z-index: 9999;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);

    /* Flexbox Layout: কন্টেন্ট ও ফুটার সঠিক জায়গায় রাখার জন্য */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* JS দিয়ে 'active' ক্লাস যুক্ত হলে স্লাইড করে সামনে আসবে */
.cart-drawer.active,
#cartDrawer.active {
    right: 0;
}

/* ============================================================
   ৩. CART HEADER & INFO (হেডার ও ইনফো সেকশন)
============================================================ */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #ffffff;
    flex-shrink: 0 !important; /* চ্যাপ্টা বা সংকুচিত হবে না */
}

.cart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1b3b36;
}

.cart-back,
.cart-wishlist {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.cart-back:hover,
.cart-wishlist:hover {
    background-color: #f5f5f5;
}

.cart-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    font-size: 14px;
    color: #555;
    flex-shrink: 0 !important; /* চ্যাপ্টা বা সংকুচিত হবে না */
}

.cart-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1b3b36;
}

.cart-info-right #lblTotalItems {
    font-weight: 700;
    color: #000;
}

/* ============================================================
   ৪. PRODUCT LIST AREA (শুধুমাত্র এই অংশটিতে স্ক্রলবার আসবে)
============================================================ */
.cart-body {
    flex: 1 1 auto !important;
    min-height: 0 !important; /* স্ক্রলবার আনা এবং ফুটার স্থায়ী রাখার জন্য আবশ্যক */
    overflow-y: auto !important; /* কন্টেন্ট বেশি হলে অটোমেটিক স্ক্রলবার আসবে */
    padding: 15px;
    background-color: #fdfdfd;
}

/* কাস্টম স্ক্রলবার স্টাইল (ডিজাইন সুন্দর করার জন্য) */
.cart-body::-webkit-scrollbar {
    width: 5px;
}

.cart-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.cart-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ============================================================
   ৫. CART ITEM CARD STYLES (কার্টের ভেতরের আইটেমসমূহ)
============================================================ */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cart-image img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    border-radius: 8px;
}

.cart-details {
    flex: 1;
}

.cart-details h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.cart-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.offer-price {
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

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

/* Quantity Button (+ / -) */
.qty-box {
    display: inline-flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 20px;
    padding: 2px 8px;
    gap: 10px;
}

.qty-btn {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty {
    font-size: 14px;
    font-weight: 600;
}

/* Trash/Delete Button */
.cart-delete .delete-btn {
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.cart-delete .delete-btn:hover {
    color: #e74c3c;
}

/* ============================================================
   ৬. CART FOOTER (কন্টিনিউ বাটন ও মোট টাকা - ফিক্সড)
============================================================ */
.cart-footer {
    flex-shrink: 0 !important; /* প্রোডাক্ট যত বেশিই হোক এটি নিচে ফিক্সড থাকবে */
    background: #ffffff;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.grand-total {
    font-size: 22px;
    font-weight: 800;
    color: #1b3b36;
    line-height: 1;
}

.saving-text {
    font-size: 11px;
    color: #27ae60;
    font-weight: 600;
    margin-top: 4px;
}

/* Continue / Checkout Button */
.checkout-btn {
    background-color: #0d5c46;
    color: #ffffff !important;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s;
    border: none;
}

.checkout-btn:hover {
    background-color: #084232;
}





/* ============================================================
   FLOATING CART BAR STYLES
============================================================ */
.floating-cart,
#floatingCart {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #154c3a; /* ইমেজের গভীর সবুজ রঙ */
    padding: 6px 8px 6px 14px;
    border-radius: 50px; /* ক্যাপসুল শেপ */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px; /* কার্টের ভেতরের সামগ্রিক ফাঁকা জায়গা কমানো হলো */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 9990;
    width: fit-content; /* অতিরিক্ত স্পেস দূর করে উপাদান অনুযায়ী ফিট করার জন্য */
    min-width: 240px; /* সর্বনিম্ন প্রস্থ কমিয়ে দেওয়া হলো যেন মোবাইল স্ক্রিনেও ফিট থাকে */
}

/* বাম পাশের অংশ (ইমেজ + টেক্সট) */
.fc-left {
    display: flex;
    align-items: center;
    gap: 8px; /* ইমেজ এবং টেক্সটের মাঝের ফাঁকা জায়গা কমানো হলো */
}

/* ওভারল্যাপিং প্রোডাক্ট ইমেজের কন্টেইনার */
.fc-images {
    display: flex;
    align-items: center;
    padding-left: 12px; /* প্রথম ছবির নেগেটিভ মার্জিন ব্যালেন্স করার জন্য কন্টেইনারে প্যাডিং */
}

/* প্রতিটি প্রোডাক্ট ছবি (গোল ও হোয়াইট বর্ডার) */
.fcImg {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ffffff;
    border: 2px solid #ffffff;
    margin-left: -16px; /* ইমেজের মতো ছবিগুলোকে আরও কাছাকাছি এনে স্পেস কমানো হলো */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.fcImg:first-child {
    margin-left: 0; /* প্রথম ছবির মার্জিন থাকবে না */
}

/* ৩টির বেশি প্রোডাক্ট হলে +1 বা +2 ব্যাজ (ইমেজের মতো ধূসর-সবুজ ব্যাজ) */
.fc-more {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #557268; /* ব্যাজের ব্যাকগ্রাউন্ড কালার */
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    margin-left: -16px; /* ব্যাজটিকেও ছবির কাছাকাছি আনা হলো */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* টেক্সট সেকশন (Items & Price) */
.fc-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fc-items {
    font-size: 12px;
    font-weight: 500;
    color: #e0f2fe;
    line-height: 1.1;
}

.fc-price {
    font-size: 18px; /* টেক্সট কিছুটা কমপ্যাক্ট করার জন্য ফন্ট সাইজ সামান্য কমানো হলো */
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

/* ডানপাশের হলুদ (Yellow) বাটন */
.fc-btn {
    background-color: #f7ca55; /* ইমেজের উজ্জ্বল হলুদ রঙ */
    color: #154c3a; /* আইকনের ডার্ক গ্রিন রঙ */
    border-radius: 30px;
    padding: 8px 14px; /* বাটনের ভেতরের অতিরিক্ত স্পেস কমানো হলো */
    display: flex;
    align-items: center;
    gap: 6px; /* আইকন ও অ্যারো চিহ্নের মাঝের স্পেস কমানো হলো */
    text-decoration: none !important;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s, background-color 0.2s;
}

.fc-btn:hover {
    background-color: #ebd349;
    transform: scale(1.03);
}

.fc-btn i {
    font-size: 15px;
}
