/* ================= استایل‌های اصلی صفحه محصول ================= */
body { background-color: #f8fafc; }
.page-content { margin-top: 110px; padding-bottom: 80px; }

/* گالری تصاویر و بزرگنمایی */
.product-gallery { background: #fff; border-radius: 20px; padding: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #f1f5f9; }
.main-image-box { width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; border-radius: 12px; overflow: hidden; position: relative; cursor: zoom-in; }
.main-image-box img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 0.3s ease; }
.main-image-box:hover img { transform: scale(1.02); }

.zoom-icon-overlay { position: absolute; bottom: 15px; right: 15px; background: rgba(255,255,255,0.9); color: #6366f1; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; opacity: 0; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.15); pointer-events: none; }
.main-image-box:hover .zoom-icon-overlay { opacity: 1; transform: translateY(-5px); }

.thumb-gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.thumb-gallery::-webkit-scrollbar { display: none; }
.thumb-box { width: 75px; height: 75px; flex-shrink: 0; border: 2px solid transparent; border-radius: 12px; padding: 5px; cursor: pointer; transition: all 0.3s; background: #f8fafc; }
.thumb-box:hover, .thumb-box.active { border-color: #6366f1; background: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.2); }
.thumb-box img { width: 100%; height: 100%; object-fit: contain; }

/* پنجره مودال برای عکس بزرگ */
.modal-backdrop.show { backdrop-filter: blur(5px); background-color: rgba(15, 23, 42, 0.85); opacity: 1; }
.image-zoom-modal .modal-content { background: transparent; border: none; }
.image-zoom-modal .btn-close { filter: invert(1) grayscale(100%) brightness(200%); width: 2em; height: 2em; opacity: 0.8; }
.image-zoom-modal .btn-close:hover { opacity: 1; transform: scale(1.1); }
.modal-product-img { max-height: 85vh; width: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }

/* باکس اطلاعات میانی */
.product-info-column { padding: 0 1rem; }
.rating-stars { color: #f59e0b; font-size: 0.9rem;}
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 0.8rem; color: #475569; font-size: 0.95rem; line-height: 1.6; }
.feature-list li i { color: #6366f1; margin-top: 5px; font-size: 0.8rem; }

/* باکس خرید چسبان */
.buy-box { background: #fff; border-radius: 20px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08); border: 1px solid #e2e8f0; padding: 1.5rem; position: sticky; top: 100px; z-index: 10; }
.stock-badge { background: rgba(16, 185, 129, 0.1); color: #10b981; padding: 5px 12px; border-radius: 50px; font-size: 0.85rem; font-weight: 700; }
.price-display { font-size: 2.2rem; font-weight: 900; color: #0f172a; }

/* بلوک‌های پایین صفحه */
.full-details-card { background: #fff; border-radius: 24px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); padding: 2.5rem; margin-top: 2.5rem; border: 1px solid #f1f5f9; }
.section-title { font-weight: 900; font-size: 1.4rem; color: #0f172a; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.8rem; }
.section-title::before { content: ''; display: block; width: 6px; height: 20px; background: #6366f1; border-radius: 10px; }

/* مشخصات فنی مدرن */
.specs-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 768px) { .specs-grid { grid-template-columns: repeat(2, 1fr); } }
.spec-item { display: flex; align-items: center; background: #f8fafc; padding: 1rem 1.25rem; border-radius: 16px; border: 1px solid #f1f5f9; transition: all 0.3s ease; }
.spec-item:hover { background: #fff; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); transform: translateY(-3px); border-color: #e2e8f0; }
.spec-icon { width: 45px; height: 45px; background: rgba(99,102,241,0.1); color: #6366f1; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-left: 1rem; flex-shrink: 0; }
.spec-content { flex: 1; display: flex; flex-direction: column; }
.spec-key { font-size: 0.85rem; font-weight: 700; color: #64748b; margin-bottom: 0.2rem; }
.spec-value { font-size: 1.05rem; font-weight: 800; color: #0f172a; }

/* توضیحات کامل */
.rich-text-content { line-height: 2; color: #334155; font-size: 1rem; }
.rich-text-content h1, .rich-text-content h2, .rich-text-content h3 { color: #0f172a; font-weight: 800; margin-top: 1.5rem; margin-bottom: 1rem; font-size: 1.3rem;}
.rich-text-content table { width: 100% !important; border-collapse: collapse; margin: 2rem 0; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px #e2e8f0; }
.rich-text-content table th, .rich-text-content table td { padding: 0.8rem; border-bottom: 1px solid #e2e8f0; text-align: right; font-size: 0.95rem;}
.rich-text-content table th { background-color: #f8fafc; font-weight: 700; color: #0f172a; width: 35%; }

/* اصلاح رنگ متن‌های توضیحات کامل (Rich Text) در دارک مود */
[data-bs-theme="dark"] .rich-text-content,
[data-bs-theme="dark"] .rich-text-content p,
[data-bs-theme="dark"] .rich-text-content span,
[data-bs-theme="dark"] .rich-text-content div,
[data-bs-theme="dark"] .rich-text-content li,
[data-bs-theme="dark"] .rich-text-content a {
    color: #cbd5e1 !important;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .rich-text-content strong,
[data-bs-theme="dark"] .rich-text-content b {
    color: #f8fafc !important;
}

/* محصولات مرتبط */
.product-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #f1f5f9; transition: all .3s ease; display: flex; flex-direction: column; height: 100%; position: relative; text-decoration: none !important; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px -5px rgba(0,0,0,.1); }
.product-image-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #fff; padding: 1rem; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.product-image-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .5s ease; }
.product-card:hover .product-image-wrap img { transform: scale(1.05); }
.product-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; text-align: center; background: #fff; }
.product-card-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 .5rem; color: #0f172a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { margin-top: auto; color: #6366f1; font-size: 1.1rem; font-weight: 900; }

/* ================== دارک مود ================== */
[data-bs-theme="dark"] body { background-color: #0f172a; }
[data-bs-theme="dark"] .product-gallery, [data-bs-theme="dark"] .buy-box, [data-bs-theme="dark"] .full-details-card, [data-bs-theme="dark"] .bg-light, [data-bs-theme="dark"] .product-card, [data-bs-theme="dark"] .product-body, [data-bs-theme="dark"] .product-image-wrap { background-color: #1e293b !important; border-color: #334155 !important; box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important; }
[data-bs-theme="dark"] .main-image-box { background-color: #0f172a; }
[data-bs-theme="dark"] .zoom-icon-overlay { background: rgba(30,41,59,0.9); color: #818cf8; }
[data-bs-theme="dark"] .product-image-wrap { background-color: #2a3b59; }
[data-bs-theme="dark"] .thumb-box { background-color: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .thumb-box:hover, [data-bs-theme="dark"] .thumb-box.active { border-color: #6366f1; background-color: #1e293b; }
[data-bs-theme="dark"] .text-dark, [data-bs-theme="dark"] .product-title, [data-bs-theme="dark"] .section-title, [data-bs-theme="dark"] .price-display, [data-bs-theme="dark"] .product-card-title, [data-bs-theme="dark"] .rich-text-content h1, [data-bs-theme="dark"] .rich-text-content h2, [data-bs-theme="dark"] .rich-text-content h3 { color: #f8fafc !important; }
[data-bs-theme="dark"] .text-muted, [data-bs-theme="dark"] .text-secondary, [data-bs-theme="dark"] .short-desc, [data-bs-theme="dark"] .feature-list li { color: #94a3b8 !important; }
[data-bs-theme="dark"] .border-bottom, [data-bs-theme="dark"] .border-start, [data-bs-theme="dark"] .border-end, [data-bs-theme="dark"] .border-top, [data-bs-theme="dark"] .border { border-color: #334155 !important; }
[data-bs-theme="dark"] .spec-item { background-color: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .spec-item:hover { background-color: #2a3b59; border-color: #4f46e5; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2); }
[data-bs-theme="dark"] .spec-icon { background: rgba(99,102,241,0.15); color: #818cf8; }
[data-bs-theme="dark"] .spec-key { color: #94a3b8; }
[data-bs-theme="dark"] .spec-value { color: #f8fafc; }
[data-bs-theme="dark"] .rich-text-content table th { background-color: #0f172a; color: #f8fafc; border-color: #334155; }
[data-bs-theme="dark"] .rich-text-content table td { border-color: #334155; color: #cbd5e1; }
[data-bs-theme="dark"] .btn-wishlist { background-color: #1e293b; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #0f172a; border-color: #334155; color: #f8fafc; }
[data-bs-theme="dark"] .form-control::placeholder { color: #64748b; }