/* Project: eOnlineBazar - Premium Styling
  Features: Responsive Grid (3-column mobile), Animations, Live Validation Colors
*/

:root {
    --primary: #1a237e;
    --accent: #ff5722;
    --success: #2ecc71;
    --danger: #d32f2f;
    --light-bg: #f4f7fa;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Hind Siliguri', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--light-bg);
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* --- SECTION 1: HEADER & SEARCH --- */
.main-header {
    background: var(--primary);
    color: var(--white);
    padding: 10px 0 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    font-size: 22px;
    cursor: pointer;
}

.cart-trigger {
    position: relative;
    font-size: 24px;
    cursor: pointer;
}

.count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

.search-wrapper {
    display: flex;
    background: white;
    border-radius: 25px;
    margin-top: 10px;
    padding: 2px;
    overflow: hidden;
}

.search-wrapper input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    outline: none;
}

.search-wrapper button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
}

/* --- SECTION 2: PRODUCT GRID (Feature 1) --- */
/* --- FIXED SECTION 2: PRODUCT GRID & CARDS --- */

/* ১. মেইন গ্রিড সেটআপ */
.product-grid {
    display: grid;
    gap: 10px;
    padding: 20px 0;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

/* মোবাইলে ৩ কলাম নিশ্চিত করা */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ২. প্রোডাক্ট কার্ড (নতুন পজিশনসহ) */
.p-card {
    background: var(--white);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    position: relative; /* বাটন লক করার জন্য */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.p-card:active { transform: scale(0.96); }

/* ৩. ইমেজ ও নাম */
.p-img-box { font-size: 35px; margin-bottom: 5px; }
.p-info .name { 
    font-size: 10px; 
    font-weight: 700; 
    line-height: 1.2;
    height: 25px; 
    overflow: hidden; 
}

/* ৪. দামের এরিয়া (বাটন থেকে দূরে রাখা হয়েছে) */
.p-info .price { 
    color: var(--accent); 
    font-weight: 700; 
    font-size: 12px;
    margin-top: 5px;
    padding-bottom: 15px; /* নিচের বাটনের জন্য জায়গা রাখা */
}

/* ৫. প্লাস বাটন (একেবারে কোণায় ফিক্সড) */
.add-btn-main {
    background: var(--primary);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: absolute; /* কার্ডের কোণায় সেট করা */
    bottom: 8px;
    right: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}


/* --- SECTION 3: MODALS & PANELS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 20px;
}

/* Side Panel (Cart) */
/* --- SIDE PANEL & SCROLLING UPDATE --- */

/* ১. মেইন প্যানেল: যা আপনার স্ক্রিনের ডান দিক থেকে আসবে */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%; /* মোবাইলে পুরো স্ক্রিন জুড়ে থাকবে */
    height: 100vh; /* পুরো স্ক্রিনের উচ্চতা নিবে */
    background: var(--white);
    z-index: 2000; /* যাতে সবকিছুর উপরে থাকে */
    display: none; /* শুরুতে লুকানো থাকবে */
    flex-direction: column; /* হেডার এবং বডিকে উপর-নিচে সাজাবে */
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* ২. প্যানেল বডি: যেখানে আসল স্ক্রলিং ম্যাজিক কাজ করবে */
.panel-body {
    flex: 1; /* হেডার বাদে বাকি পুরো জায়গাটি নিবে */
    overflow-y: auto; /* কন্টেন্ট বেশি হলে এখানে স্ক্রল করার সুযোগ দিবে */
    padding: 15px;
    padding-bottom: 80px; /* নিচের বাটনের জন্য বাড়তি জায়গা যাতে ঢাকা না পড়ে */
    -webkit-overflow-scrolling: touch; /* মোবাইলে স্মুথ স্ক্রলিংয়ের জন্য */
    background-color: #ffffff;
}

/* ৩. প্যানেল হেডার (স্থির থাকবে, স্ক্রল হবে না) */
.panel-header {
    background: var(--primary);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0; /* স্ক্রল করার সময় হেডার যেন ছোট না হয়ে যায় */
}

/* ৪. স্ক্রলবার দেখতে যাতে সুন্দর লাগে (ঐচ্ছিক) */
.panel-body::-webkit-scrollbar {
    width: 5px;
}
.panel-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* --- SECTION 4: CART ITEMS & BUTTONS --- */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.qty-controls {
    display: flex;
    align-items: center;
    background: #f0f2f7;
    border-radius: 20px;
    padding: 5px 10px;
}

.qty-btn {
    border: none; background: transparent;
    font-size: 20px; color: var(--primary);
    font-weight: bold; width: 30px; cursor: pointer;
}

/* --- SECTION 5: VALIDATION COLORS (Feature 9-13) --- */
.input-group { margin-bottom: 15px; }
.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
}

/* Live validation colors */
.valid-bg { background-color: #e8f5e9 !important; border-color: var(--success) !important; }
.invalid-bg { background-color: #ffebee !important; border-color: var(--danger) !important; }

.red-star { color: var(--danger); font-weight: bold; }
.error-msg { color: var(--danger); font-size: 11px; display: none; margin-top: 5px; font-weight: 600; }

/* --- SECTION 6: PAYMENT & POLICY --- */
.radio-group { display: flex; flex-direction: column; gap: 10px; margin: 15px 0; }
.radio-label {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.radio-label.active { border-color: var(--primary); background: #f0f2ff; }

.policy-container {
    background: #fff8f8;
    border: 1px solid #ffebeb;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.policy-list li {
    font-size: 11px;
    margin-bottom: 5px;
    color: #666;
    list-style: inside decimal;
}

/* --- SECTION 7: NOTIFICATIONS & STATUS --- */
.notification-overlay {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
}

.status-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px; height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Utility Classes */
.hidden { display: none !important; }
.btn-primary-large { background: var(--accent); color: white; border: none; width: 100%; padding: 16px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.btn-confirm-order { background: var(--success); color: white; border: none; width: 100%; padding: 16px; border-radius: 10px; font-weight: 700; cursor: pointer; }



/* --- PRODUCT DETAIL DRAWER STYLES --- */

/* ১. মেইন প্যানেল (কার্ট প্যানেলের মতোই হবে) */
#productDetailPanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1500; /* যাতে সবকিছুর উপরে থাকে */
    display: none; /* শুরুতে লুকানো থাকবে */
    flex-direction: column;
    animation: slideIn 0.3s ease-out; /* স্লাইড এনিমেশন */
}

/* ২. স্লাইড এনিমেশন */
@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* ৩. প্যানেলের ভেতরের কন্টেন্ট স্টাইল */
.detail-view {
    padding: 20px;
    text-align: center;
}

.detail-img-large {
    font-size: 100px;
    margin: 20px 0;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.detail-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.detail-price {
    font-size: 26px;
    color: var(--accent);
    font-weight: 800;
    margin: 15px 0;
}

.detail-desc {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 0 10px;
}

/* ৪. বাটনগুলোর ডিজাইন */
.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whatsapp-btn {
    width: 100%;
    padding: 15px;
    border: 2px solid #25D366;
    background: transparent;
    color: #25D366;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.whatsapp-btn:active {
    background: #25D366;
    color: white;
}



/* Shipping Form Styling */
#shippingPanel .panel-body {
    padding: 20px;
    background: #fdfdfd;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #444;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
}

.form-input:focus {
    border-color: var(--primary);
}


/* style.css এর শেষে যোগ করুন */

/* মেইন ওভারলে (ব্যাকগ্রাউন্ড ঘোলা করার জন্য) */
#orderSuccessModal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* কালো আবছা ব্যাকগ্রাউন্ড */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* যাতে সবকিছুর উপরে থাকে */
}

/* মোডাল কন্টেন্ট বক্স (ধবধবে সাদা) */
.success-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s ease-out; /* জুম এনিমেশন */
}

/* জুম ইন এনিমেশন */
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* সবুজ টিক চিহ্ন আইকন */
.success-icon {
    font-size: 80px;
    color: #4CAF50; /* সবুজ রঙ */
    margin-bottom: 20px;
}

/* অভিনন্দন টেক্সট */
.congrats-text {
    color: #333;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif; /* পপিন্স ফন্ট */
}

/* অর্ডার প্লেসড টেক্সট */
.order-placed-text {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
}

/* অর্ডার আইডি বক্স */
.order-id-box {
    background-color: #f7f7f7;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 16px;
    color: #555;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

/* আইডি নম্বর (অরেঞ্জ রঙ) */
.id-number {
    color: #FF5722; /* অরেঞ্জ রঙ */
    font-weight: 700;
    font-size: 18px;
}

/* নিচের সাধারণ টেক্সট */
.call-text {
    color: #888;
    font-size: 14px;
    margin-bottom: 25px;
}

/* মোডাল বন্ধ করার বাটন (গ্রিন রঙ) */
.success-modal-content .close-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.success-modal-content .close-btn:hover {
    background-color: #45a049;
}


/* সাকসেস মোডাল প্রফেশনাল লুক */
.success-modal-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    max-width: 350px;
    border: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4CAF50;
    color: white;
    border-radius: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 16px rgba(76, 175, 80, 0.3);
}

.order-id-box {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 12px;
    margin: 20px 0;
    border: 1px solid #eee;
}

.id-number {
    color: #FF5722; /* আপনি স্ক্রিনশটে যেমন চেয়েছিলেন */
    font-weight: bold;
}


/* প্রফেশনাল টোস্ট স্টাইল */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

.toast-msg {
    background: #333; /* ডার্ক প্রফেশনাল ব্যাকগ্রাউন্ড */
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    min-width: 250px;
    max-width: 300px;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease, fadeOut 0.4s ease 1.6s forwards; /* ২ সেকেন্ডের মাথায় গায়েব হবে */
}

@keyframes slideUp {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 0; opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* পেমেন্ট কার্ড ফিক্স */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.payment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 5px;
    height: 80px; /* আইকন সহ সুন্দর দেখানোর জন্য ফিক্সড হাইট */
}

/* কুপন সেকশনের মূল বক্স */
.coupon-section {
    border: 1px dashed #FF5722; /* আপনার স্ক্রিনশটের সেই রেড/কমলা বর্ডার */
    border-radius: 12px;
    padding: 12px;
    background-color: #FFF9F7;
    margin: 15px 0;
}

/* ইনপুট এবং বাটনকে এক লাইনে রাখার কন্টেইনার */
.coupon-flex-container {
    display: flex;
    align-items: center;
    gap: 8px; /* ইনপুট এবং বাটনের মাঝের দূরত্ব */
}

/* ইনপুট বক্সটি ছোট করার জন্য */
#couponInput {
    flex: 1; /* এটি বক্সের ভেতরের বাকি জায়গা দখল করবে */
    max-width: 200px; /* ইনপুট ফিল্ডটি ছোট দেখানোর জন্য এই লিমিটটি দেওয়া */
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

/* এপ্লাই বাটন */
.apply-btn {
    background-color: #2C3E50; /* আপনার পছন্দের ডার্ক কালার */
    color: white;
    border: none;
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap; /* লেখা যাতে ভেঙে না যায় */
}


/* কন্টেইনার ডিজাইন */
.coming-soon-container {
    width: 100%;
    min-height: 350px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%); /* প্রফেশনাল ডার্ক গ্রাডিয়েন্ট */
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* ব্যাকগ্রাউন্ডে হালকা ডিজাইন এলিমেন্ট (অপশনাল) */
.coming-soon-container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

/* মেইন টাইটেল */
.main-title {
    color: #FF5722; /* আপনার পছন্দের সেই কমলা রঙ */
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.3;
    font-family: 'Poppins', sans-serif;
}

/* বর্ণনা বা সাব-টেক্সট */
.sub-text {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 20px;
    font-family: 'Hind Siliguri', sans-serif;
}

/* ছোট ব্যাজ ডিজাইন */
.badge {
    display: inline-block;
    background: rgba(255, 87, 34, 0.2);
    color: #FF5722;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}



/* Bottom Navigation Styles */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* যাতে অন্য সব এলিমেন্টের উপরে থাকে */
    border-top: 1px solid #e0e0e0;
}

.nav-item {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    transition: 0.3s;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

/* অ্যাক্টিভ মেনুর জন্য কালার */
.nav-item.active {
    color: #FF5722; /* আপনার ওয়েবসাইটের থিম কালার অনুযায়ী পরিবর্তন করতে পারেন */
}

/* কার্ট আইকনের ওপর সংখ্যা দেখানোর জন্য */
.cart-icon-wrapper {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #FF5722;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 50%;
}

/* বডির নিচে গ্যাপ রাখা যাতে কন্টেন্ট মেনুর নিচে চাপা না পড়ে */
body {
    padding-bottom: 60px;
}
