/* =========================================
   تنظیمات پایه و متغیرهای رنگی (آبی مدرن)
   ========================================= */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8; 
    --dark-bg: #1e293b; 
    --card-bg: #f8fafc; 
    --text-dark: #334155;
    --text-gray: #64748b;
    --border-color: #e2e8f0;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Vazirmatn', sans-serif; 
}

body { 
    background-color: #f1f5f9; 
    color: var(--text-dark); 
    padding-bottom: 0; 
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; outline: none; }

/* =========================================
   هیدر اصلی سایت (چسبان و سه بخشی)
   ========================================= */
.main-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 5%; 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.header-right { display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; }
.logo-img { height: 45px; width: auto; object-fit: contain; }

.menu-toggle { display: none; font-size: 26px; background: none; border: none; color: var(--text-dark); cursor: pointer; transition: 0.3s; }
.menu-toggle:hover { color: var(--primary-color); }

/* منوی دسکتاپ - وسط هدر */
.desktop-nav { display: flex; gap: 30px; }
.desktop-nav a { font-size: 15px; font-weight: bold; color: var(--text-dark); transition: color 0.3s; position: relative; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--primary-color); }
.desktop-nav a.active::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 100%; height: 3px; background: var(--primary-color); border-radius: 5px; }

.header-left { display: flex; align-items: center; }
.cart-btn { 
    background: #eff6ff; border: 1.5px solid var(--primary-color); color: var(--primary-color); 
    padding: 10px 20px; border-radius: 12px; font-size: 15px; font-weight: bold; 
    display: flex; align-items: center; gap: 8px; position: relative; transition: 0.3s;
}
.cart-btn:hover { background: var(--primary-color); color: #fff; }
.cart-count { background: #ef4444; color: #fff; padding: 2px 7px; border-radius: 50px; font-size: 13px; position: absolute; top: -10px; right: -10px; border: 2px solid #fff; }

/* =========================================
   منوی کناری (موبایل)
   ========================================= */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1005; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(3px); }
.sidebar-overlay.active { opacity: 1; visibility: visible; }
.sidebar { position: fixed; top: 0; right: -320px; width: 300px; max-width: 85%; height: 100%; background: #fff; z-index: 1006; overflow-y: auto; transition: right 0.4s ease; display: flex; flex-direction: column; }
.sidebar.open { right: 0; box-shadow: -5px 0 25px rgba(0,0,0,0.1); }
.sidebar-menu { padding: 30px 0; flex-grow: 1; }
.menu-title { padding: 0 20px 15px; font-weight: 900; font-size: 18px; color: var(--primary-color); border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }
.sidebar-menu ul { list-style: none; }
.sidebar-menu li a { display: flex; align-items: center; padding: 15px 20px; font-size: 15px; color: var(--text-dark); font-weight: bold; border-bottom: 1px solid #f9f9f9; transition: 0.3s; }
.sidebar-menu li a:hover { background: #eff6ff; color: var(--primary-color); padding-right: 25px; }
.menu-icon { width: 35px; font-size: 18px; color: #94a3b8; text-align: right; transition: 0.3s; }
.sidebar-menu li a:hover .menu-icon { color: var(--primary-color); }

/* =========================================
   اسلایدر کشیدنی
   ========================================= */
.main-content { padding-top: 20px; }

.slider-container { 
    position: relative; 
    width: 96%; 
    max-width: 1400px;
    margin: 0 auto 30px auto; 
    border-radius: 20px;
    overflow: hidden; 
    cursor: grab;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}
.slider-container:active { cursor: grabbing; }
.slider-wrapper { display: flex; transition: transform 0.5s ease-out; width: 100%; user-select: none; }
.slide { 
    min-width: 100%; 
    height: 420px; 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    padding: 0 8%; 
    color: white; 
}
.slider-dots { position: absolute; bottom: 20px; width: 100%; text-align: center; }
.dot { display: inline-block; width: 10px; height: 10px; background: rgba(255,255,255,0.4); border-radius: 50%; margin: 0 5px; cursor: pointer; transition: 0.3s; }
.dot.active-dot { background: #fff; width: 25px; border-radius: 10px; }

/* =========================================
   دسته‌بندی‌ها
   ========================================= */
.category-section { padding: 20px 0 40px 0; text-align: center; background: #fff; border-radius: 20px; width: 96%; margin: 0 auto 30px auto; box-shadow: 0 5px 20px rgba(0,0,0,0.02); }
.section-title-center { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 30px; padding-top: 20px; }
.section-title-center h2 { font-size: 22px; font-weight: 900; color: var(--text-dark); }
.section-title-center span { color: var(--primary-color); }
.dot-line { width: 50px; height: 3px; background: linear-gradient(to left, var(--primary-color), transparent); position: relative; border-radius: 5px; }

.category-carousel { display: flex; justify-content: center; overflow-x: auto; gap: 30px; padding: 0 20px 10px; scroll-snap-type: x mandatory; }
.category-carousel::-webkit-scrollbar { display: none; }
.cat-item { flex: 0 0 auto; text-align: center; width: 110px; cursor: pointer; }
.cat-img { width: 100px; height: 100px; border-radius: 50%; border: 2px solid var(--primary-color); padding: 5px; margin: 0 auto 10px auto; transition: 0.3s; background: #fff; }
.cat-img:hover { transform: scale(1.1); box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3); }
.cat-img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cat-item p { font-size: 14px; font-weight: bold; color: var(--text-dark); margin-top: 10px; }

/* =========================================
   هدر بخش محصولات
   ========================================= */
.products-section { padding: 40px 5%; background: #fff; margin-bottom: 20px; }
.section-header { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    gap: 15px; 
    margin-bottom: 30px; 
}
.header-icon-circle { 
    width: 60px; 
    height: 60px; 
    background: #eff6ff; 
    color: var(--primary-color); 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 24px; 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1); 
}
.header-text { text-align: right; display: flex; flex-direction: column; gap: 5px; }
.header-text h2 { font-size: 22px; color: var(--text-dark); font-weight: 900; margin: 0; }
.header-subtitle { display: flex; align-items: center; gap: 10px; color: var(--text-gray); font-size: 14px; }
.header-subtitle .line { width: 40px; height: 2px; background: #cbd5e1; }

/* =========================================
   کارت‌های محصولات
   ========================================= */
.product-carousel { display: flex; overflow-x: auto; gap: 1.5%; padding-bottom: 20px; scroll-snap-type: x mandatory; padding-top: 10px; }
.product-carousel::-webkit-scrollbar { height: 6px; }
.product-carousel::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 10px; }
.product-carousel .pro-card { flex: 0 0 calc(16.666% - 1.25%); scroll-snap-align: start; } 

.product-grid { display: flex; flex-wrap: wrap; gap: 1.5%; row-gap: 25px; }
.product-grid .pro-card { width: calc(16.666% - 1.25%); } 

.pro-card { background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 5px 15px rgba(0,0,0,0.03); display: flex; flex-direction: column; cursor: pointer; transition: all 0.3s ease; position: relative; }
.pro-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); border-color: #cbd5e1; }

.pro-img-box { background: var(--card-bg); position: relative; padding: 20px; text-align: center; height: 220px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pro-img-box img { max-width: 100%; max-height: 100%; mix-blend-mode: multiply; transition: transform 0.4s ease; }
.pro-card:hover .pro-img-box img { transform: scale(1.1); }

/* --- نشان تخفیف دایره‌ای و حرفه‌ای (بالا سمت راست) --- */
.discount-badge { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: linear-gradient(135deg, #ef4444, #dc2626); /* رنگ قرمز جذاب */
    color: #fff; 
    font-size: 13px; 
    font-weight: 900; 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; /* دایره کامل */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 10; 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); /* سایه نرم و حرفه‌ای */
    direction: ltr; /* برای نمایش درست اعداد */
}

.pro-details { padding: 20px; text-align: right; display: flex; flex-direction: column; flex-grow: 1; }
.pro-title { font-size: 14px; font-weight: bold; color: var(--text-dark); margin-bottom: 15px; line-height: 1.6; height: 44px; overflow: hidden; }
.price-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-direction: row-reverse; }
.new-price { font-size: 13px; color: #333; }
.new-price strong { font-size: 18px; font-weight: 900; color: var(--primary-color); }
.old-price { font-size: 13px; color: #94a3b8; text-decoration: line-through; }

.add-btn { background: var(--primary-color); color: #fff; border: none; padding: 12px; border-radius: 12px; font-weight: bold; font-size: 14px; width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; transition: 0.3s; margin-top: auto; cursor: pointer; }
.add-btn:hover { background: var(--primary-hover); transform: scale(1.02); }

/* =========================================
   پاپ‌آپ مدال (با باکس توضیحات جدید)
   ========================================= */
.modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px); justify-content: center; align-items: center; }
.modal-content { background-color: #fff; border-radius: 20px; width: 90%; max-width: 900px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.3); overflow: hidden; animation: modalFadeIn 0.3s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.close { position: absolute; top: 15px; left: 20px; color: #94a3b8; font-size: 35px; cursor: pointer; z-index: 10; transition: 0.3s; background: #f1f5f9; width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; line-height: 0; }
.close:hover { color: #ef4444; background: #fee2e2; }

.modal-body { display: flex; flex-direction: row; }
.modal-img-col { flex: 1; background: var(--card-bg); display: flex; align-items: center; justify-content: center; padding: 40px; }
.modal-img-col img { width: 100%; max-height: 350px; object-fit: contain; mix-blend-mode: multiply; }
.modal-info-col { flex: 1; padding: 40px; text-align: right; display: flex; flex-direction: column; justify-content: center; }
.modal-info-col h2 { color: var(--text-dark); font-size: 24px; font-weight: 900; margin-bottom: 10px; line-height: 1.5; }
.modal-info-col .price { color: var(--primary-color); font-size: 24px; font-weight: 900; margin-bottom: 20px; }
.divider { height: 1px; background-color: var(--border-color); margin: 20px 0; }

/* استایل باکس توضیحات (specs-box) */
.specs-box { background: #f8fafc; border: 1px solid #e2e8f0; padding: 15px; border-radius: 12px; margin-bottom: 30px; }
.specs-box p#modalDesc { color: var(--text-gray); line-height: 1.8; font-size: 14px; margin: 0; }

.buy-btn { width: 100%; padding: 16px; background: var(--primary-color); color: #fff; border: none; font-size: 18px; font-weight: bold; border-radius: 12px; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; gap: 10px; }
.buy-btn:hover { background: var(--primary-hover); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2); }

/* =========================================
   سبد خرید کشویی
   ========================================= */
.cart-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1005; backdrop-filter: blur(3px); }
.cart-overlay.active { display: block; }
.cart-drawer { position: fixed; top: 0; left: -100%; width: 400px; max-width: 85%; height: 100%; background: #fff; z-index: 1006; transition: left 0.4s ease; display: flex; flex-direction: column; box-shadow: 5px 0 30px rgba(0,0,0,0.15); }
.cart-drawer.open { left: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 20px; border-bottom: 1px solid var(--border-color); background: #f8fafc; }
.cart-header h2 { font-size: 18px; font-weight: 900; color: var(--primary-color); display: flex; align-items: center; gap: 10px; }
.close-cart { font-size: 30px; color: #94a3b8; cursor: pointer; transition: 0.3s; }
.close-cart:hover { color: #ef4444; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.empty-cart-msg { text-align: center; color: #94a3b8; margin-top: 50px; font-size: 15px; display: flex; flex-direction: column; gap: 15px; align-items: center; }

.cart-item { display: flex; align-items: center; background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.cart-item img { width: 70px; height: 70px; border-radius: 8px; border: 1px solid #f1f5f9; object-fit: cover; }
.cart-item-details { flex: 1; margin-right: 15px; text-align: right; }
.cart-item-details h4 { margin: 0 0 8px 0; font-size: 14px; font-weight: bold; color: var(--text-dark); }
.cart-item-details .item-price { margin: 0 0 10px 0; color: var(--primary-color); font-size: 14px; font-weight: bold; }
.qty-controls { display: inline-flex; align-items: center; gap: 12px; background: #f1f5f9; padding: 4px 10px; border-radius: 8px; }
.qty-controls button { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-dark); }
.remove-item { background: #fef2f2; color: #ef4444; border: none; font-size: 16px; cursor: pointer; width: 35px; height: 35px; border-radius: 8px; margin-right: 10px; transition: 0.3s; display: flex; justify-content: center; align-items: center; }
.remove-item:hover { background: #ef4444; color: white; }

.cart-footer { padding: 20px; border-top: 1px solid var(--border-color); background: #f8fafc; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: var(--text-dark); font-size: 16px; font-weight: bold; }

/* استایل قیمت کل */
.total-price { color: var(--primary-color); font-size: 22px; font-weight: 900; }

.cart-buttons { display: flex; gap: 10px; }
.cart-buttons button { flex: 1; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.continue-btn { background: #e2e8f0; color: #334155; }
.continue-btn:hover { background: #cbd5e1; }
.checkout-btn { background: var(--primary-color); color: #fff; }
.checkout-btn:hover { background: var(--primary-hover); }

/* =========================================
   نوار ناوبری پایین (مخصوص موبایل)
   ========================================= */
.bottom-nav { 
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; 
    background: #fff; border-top: 1px solid var(--border-color); 
    justify-content: space-between; padding: 12px 20px 15px 20px; 
    z-index: 1000; box-shadow: 0 -4px 25px rgba(0,0,0,0.08); 
}
.nav-item { 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; color: var(--text-gray); font-size: 11px; font-weight: bold; 
    flex: 1; text-align: center; white-space: nowrap; position: relative;
    transition: 0.3s; cursor: pointer;
}
.nav-item i { font-size: 20px; transition: transform 0.3s ease; }
.nav-item.active { color: var(--primary-color); }
.nav-item.active i { transform: translateY(-4px); }
.nav-item.active::after {
    content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    width: 35px; height: 3px; background: var(--primary-color); border-radius: 0 0 5px 5px;
}

/* =========================================
   فوتر
   ========================================= */
.simple-footer { text-align: center; padding: 30px; background: var(--dark-bg); color: #fff; font-size: 14px; margin-top: 40px; border-top: 4px solid var(--primary-color); }

/* =========================================
   واکنش‌گرایی (Responsive)
   ========================================= */
@media (max-width: 1200px) {
    .product-grid .pro-card { width: calc(20% - 1.2%); }
    .product-carousel .pro-card { flex: 0 0 calc(20% - 1.2%); }
}

@media (max-width: 992px) {
    .product-grid .pro-card { width: calc(25% - 1.125%); }
    .product-carousel .pro-card { flex: 0 0 calc(25% - 1.125%); }
}

@media (max-width: 768px) {
    body { padding-bottom: 75px; } 
    
    .desktop-nav { display: none; }
    .cart-text { display: none; }
    .menu-toggle { display: block; }
    .header-right { gap: 15px; }
    .cart-btn { padding: 10px 12px; }
    
    .bottom-nav { display: flex; }

    .slider-container { width: 92%; margin: 15px auto; border-radius: 15px; }
    .slide { height: 220px; padding: 0 6%; }

    .category-section { width: 92%; padding: 15px 0 25px 0; }
    .category-carousel { justify-content: flex-start; gap: 15px; }
    .section-title-center h2 { font-size: 18px; }

    .products-section { padding: 25px 5%; }
    .section-header { gap: 10px; margin-bottom: 20px; }
    .header-icon-circle { width: 45px; height: 45px; font-size: 18px; }
    .header-text h2 { font-size: 18px; }

    .product-grid { gap: 15px; row-gap: 15px; }
    .product-grid .pro-card { width: calc(50% - 7.5px); }
    .product-carousel .pro-card { flex: 0 0 calc(65%); } 
    
    .pro-img-box { height: 160px; padding: 10px; }
    .pro-title { font-size: 13px; margin-bottom: 10px; height: 40px; }
    .new-price strong { font-size: 16px; }
    .add-btn { font-size: 12px; padding: 10px; }

    .modal-body { flex-direction: column; }
    .modal-img-col { padding: 30px 20px; }
    .modal-img-col img { max-height: 220px; }
    .modal-info-col { padding: 20px; text-align: center; }
    .modal-info-col h2 { font-size: 20px; }
    .modal-info-col .price { font-size: 22px; }
}