/* ==========================================================================
   فایل استایل اختصاصی صفحه جزئیات محصول (Product Detail) با چیدمان RTL
   ========================================================================== */

:root {
    --primary-blue: #0a3d62;
    --accent-yellow: #f8c291;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e8e8e8;
    --bg-light: #f8f9fb;
    --transition-fast: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* اعمال فونت پیش‌فرض برای تمامی عناصر ورودی و فرم‌ها جهت جلوگیری از تغییر فونت مرورگر */
input, 
select, 
textarea, 
button {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* ساختار کلی صفحه */
.product-detail-page {
    padding: 20px 0 60px 0; /* کاهش پدینگ بالا برای کاهش فاصله با هیرو */
    background-color: var(--bg-light);
    direction: rtl;
    text-align: right;
    font-family: 'Vazirmatn', sans-serif;
}

/* استایل بردکرامب */
.breadcrumb-nav {
    margin-bottom: 20px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 10px;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--accent-yellow);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* ساختار دو ستونه اطلاعات و گالری */
.product-essential-wrapper {
    display: grid;
    grid-template-columns: minmax(320px, 450px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    background: #fff;
    padding: 32px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    margin-top: 15px; /* فاصله اندک برای زیباتر شدن اتصال به هیرو */
}

/* ستون راست: گالری تصاویر */
.product-gallery {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.main-image-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-fast);
}

.main-image-container img:hover {
    transform: scale(1.03);
}

.thumbnail-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumb-item {
    width: 80px;
    height: 80px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.thumb-item:hover, 
.thumb-item.active {
    border-color: var(--primary-blue);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ستون چپ: پنل اطلاعات محصول */
.product-info-panel {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.product-category-tag {
    align-self: flex-start;
    background-color: rgba(10, 61, 98, 0.08);
    color: var(--primary-blue);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
}

.product-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 0;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.product-code {
    color: var(--text-color);
}

.product-status-instock {
    color: #2ecc71;
    font-weight: 600;
}

.product-status-instock i {
    margin-left: 5px;
}

.product-short-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* بخش ویژگی‌ها */
.product-key-features {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
}

.product-key-features h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--primary-blue);
    font-weight: 700;
}

.product-key-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-key-features li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-key-features li i {
    color: var(--primary-blue);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* دکمه‌های کاتالوگی */
.product-action-box {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn-download-catalog,
.btn-download-tds,
.btn-request-consultation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
    text-align: center;
}
 .main-image-container {
            position: relative !important;
            z-index: 1 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            overflow: hidden !important;
            background: #fff !important;
        }

        /* بازگرداندن نحوه نمایش تصویر اصلی به حالت cover مشابه فایل CSS شما */
        #main-product-image {
            width: 100% !important;
            height: 100% !important;
            object-fit: cover !important; /* پر کردن کامل باکس تصویر به صورت زیبا */
            display: block !important;
        }

        /* دکمه‌های ناوبری گالری با قابلیت کلیک تضمین شده */
        .gallery-nav {
            position: absolute !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            z-index: 999 !important;
            width: 42px !important;
            height: 42px !important;
            border: none !important;
            border-radius: 50% !important;
            background: rgba(10, 61, 98, 0.85) !important;
            color: #ffffff !important;
            cursor: pointer !important;
            pointer-events: auto !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            transition: all 0.2s ease-in-out !important;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
        }

        .gallery-nav:hover {
            background: #0a3d62 !important;
            transform: translateY(-50%) scale(1.08) !important;
        }

        .gallery-next {
            right: 14px !important;
            left: auto !important;
        }

        .gallery-prev {
            left: 14px !important;
            right: auto !important;
        }

        /* آیتم‌های بندانگشتی گالری */
        .thumb-item {
            cursor: pointer !important;
            pointer-events: auto !important;
            opacity: 0.6 !important;
            border: 2px solid #e8e8e8 !important;
            transition: all 0.2s ease !important;
            background: #ffffff !important;
            padding: 0 !important;
        }

        .thumb-item.active {
            opacity: 1 !important;
            border-color: #0a3d62 !important;
            box-shadow: 0 0 8px rgba(10, 61, 98, 0.3) !important;
        }

        /* کنترل نمایش تب‌های مشخصات و معرفی */
        .tab-pane {
            display: none !important;
        }

        .tab-pane.active {
            display: block !important;
        }
.btn-download-catalog {
    background: #d32f2f;
    border: 2px solid #d32f2f;
    color: #fff;
}

.btn-download-catalog:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    color: #fff;
    transform: translateY(-2px);
}

.btn-download-tds {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-download-tds:hover {
    background: var(--primary-blue);
    color: #fff;
}

.btn-request-consultation {
    background: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    color: #fff;
}

.btn-request-consultation:hover {
    background: transparent;
    color: var(--primary-blue);
}

/* بخش تب‌ها و اطلاعات پایینی */
.product-detailed-specs {
    margin-top: 40px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.specs-tabs-nav {
    display: flex;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    outline: none;
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--primary-blue);
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background-color: #fff;
}

.specs-tabs-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    margin-top: 0;
    color: var(--primary-blue);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.tab-pane p {
    line-height: 1.8;
    color: var(--text-color);
    margin: 0;
}

/* استایل جدول مشخصات فنی با فونت یکسان */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Vazirmatn', sans-serif;
}

.specs-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-family: 'Vazirmatn', sans-serif;
}

.specs-table tr:last-child td {
    border-bottom: none;
}

.specs-table td:first-child {
    font-weight: 700;
    color: var(--primary-blue);
    width: 30%;
    font-family: 'Vazirmatn', sans-serif;
}

.specs-table td:nth-child(2) {
    color: var(--text-color);
    font-family: 'Vazirmatn', sans-serif;
}

.specs-table tr:nth-child(even) {
    background-color: rgba(248, 249, 251, 0.5);
}

/* هیرو و استایل سراسری */
.hero-section {
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-radius: 0;
    margin-top: -100px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    direction: rtl;
    color: #ffffff;
    background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35));
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    box-shadow: var(--shadow);
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.1rem;
    color: #cccccc;
    max-width: 600px;
    margin: 0 auto;
}

.products-toolbar {
    margin-top: 20px;
}

.product-detail-hero {
    position: relative;
    background: linear-gradient(135deg, #123b5d 0%, #1d6fa5 100%);
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-radius: 0;
    margin-top: -100px;
    padding: 180px 20px 140px; /* بازگشت به مقدار اولیه ارتفاع پدینگ */
    text-align: center;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    box-shadow: var(--shadow);
    min-height: 500px; /* بازگشت به حداقل ارتفاع ۵۰۰ پیکسل اولیه */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.product-detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
}
.main-image-container {
    position: relative;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(10, 61, 98, 0.82);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: var(--transition-fast);
}

.gallery-nav:hover {
    background: var(--primary-blue);
    transform: translateY(-50%) scale(1.08);
}

.gallery-next {
    right: 14px;
}

.gallery-prev {
    left: 14px;
}

.thumb-item {
    padding: 0;
    background: #fff;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
}


.product-detail-hero-content {
    position: relative;
    z-index: 1;
    max-width: 850px;
}

.product-detail-hero-content h1 {
    margin: 0;
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.5;
}

/* واکنش‌گرایی (Responsive) */
@media (max-width: 992px) {
    .product-essential-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
    .product-gallery,
    .product-info-panel {
        grid-column: auto;
    }
    .main-image-container {
        max-width: 100%;
    }
    .product-title {
        font-size: 1.5rem;
    }
    .btn-download-catalog,
    .btn-download-tds,
    .btn-request-consultation {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .product-detail-hero {
        min-height: 500px; /* بازگشت به ارتفاع اولیه موبایل */
        padding: 90px 20px 50px; /* بازگشت به پدینگ اولیه موبایل */
    }
    .product-detail-hero-content h1 {
        font-size: 1.7rem;
    }
}

@media (max-width: 576px) {
    .product-detail-page {
        padding: 10px 0 40px 0;
    }
    .product-essential-wrapper {
        padding: 15px;
        border-radius: 12px;
    }
    .specs-tabs-nav {
        flex-direction: column;
    }
    .tab-btn {
        width: 100%;
        text-align: right;
        padding: 12px 20px;
    }
    .specs-tabs-content {
        padding: 15px;
    }
    .specs-table td {
        display: block;
        width: 100% !important;
        padding: 10px 5px;
    }
    .specs-table td:first-child {
        border-bottom: none;
        padding-bottom: 2px;
        font-size: 0.9rem;
    }
}
