/* استایل‌های اختصاصی صفحه جزئیات محصول سیترا بیوتک */
.detail-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    dir: rtl;
}

/* ساختار دو ستونه اصلی */
.product-detail-wrapper {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 40px;
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(4, 62, 89, 0.04);
}

@media (max-width: 992px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
}

/* بخش گالری تصاویر سمت راست */
.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image-box {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    padding: 15px;
}

.main-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumbnail-item {
    width: 70px;
    height: 70px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.2s ease;
}

.thumbnail-item:hover, .thumbnail-item.active {
    border-color: var(--primary-color, #043e59);
    transform: scale(1.05);
}

.thumbnail-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* بخش اطلاعات محصول سمت چپ */
.product-info-section {
    display: flex;
    flex-direction: column;
}

.product-meta-header {
    margin-bottom: 15px;
}

.category-badge-link {
    display: inline-block;
    background: rgba(4, 62, 89, 0.08);
    color: var(--primary-color, #043e59);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 10px;
}

.detail-brand-name {
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.detail-product-title {
    color: var(--primary-color, #043e59);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.5;
    margin: 5px 0 15px 0;
}

/* بخش مشخصات و ویژگی‌های فنی یکپارچه */
.product-specs-container {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(4, 62, 89, 0.02);
}

.specs-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-color, #043e59);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.specs-section-title i {
    font-size: 1.1rem;
    color: var(--primary-color, #043e59);
}

/* ۱) نمای پیش‌فرض: لپ‌تاپ و دسکتاپ (دو ستونه شکیل) */
.specs-hybrid-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    direction: rtl;
    text-align: right;
}

.spec-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    gap: 15px;
    transition: all 0.2s ease;
}

.spec-row-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.spec-row-key {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #475569;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.spec-row-key i {
    color: var(--primary-color, #043e59);
    width: 16px;
    text-align: center;
}

.spec-row-val {
    flex-grow: 1;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark, #1e293b);
    text-align: left;
    direction: ltr;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* ۲) نمای تبلت (تبلت‌های پرتره و لنداسکیپ کوچک - حداکثر عرض 992px) */
@media (max-width: 992px) {
    .specs-hybrid-grid {
        grid-template-columns: 1fr; /* تبدیل به تک ستونه برای خوانایی بهتر در تبلت */
        gap: 10px;
    }
}

/* ۳) نمای موبایل (اسکرین‌های زیر 576px) */
@media (max-width: 576px) {
    .product-specs-container {
        padding: 15px 12px; /* فشرده‌تر شدن پدینگ کلی باکس ویژگی‌ها در موبایل */
    }

    .spec-row-item {
        flex-direction: column; /* تغییر چیدمان از سطر افقی به ستون عمودی */
        align-items: flex-start; /* تراز کردن محتوا از سمت راست */
        gap: 6px;
        padding: 12px;
    }

    .spec-row-key {
        white-space: normal; /* شکستن متن عنوان ویژگی در صورت طولانی بودن */
        font-size: 0.8rem;
        width: 100%;
        border-bottom: 1px dashed #e2e8f0; /* ایجاد مرز نازک بین عنوان و مقدار */
        padding-bottom: 6px;
    }

    .spec-row-val {
        width: 100%;
        text-align: right; /* هم‌تراز کردن مقادیر با ساختار فارسی در موبایل */
        direction: ltr; /* حفظ ساختار فرمول‌ها و کدهای انگلیسی */
        padding-top: 4px;
        font-size: 0.85rem;
    }
}

/* استایل کدهای مونو جهت هم‌تراز شدن دقیق با سایر بخش‌ها */
.font-mono {
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 0.5px;
    color: #0369a1 !important;
    text-align: left !important;
    direction: ltr !important;
    unicode-bidi: plaintext;
}

.status-in-stock {
    color: #16a34a !important;
}

.status-out-of-stock {
    color: #dc2626 !important;
}

/* بخش انتخاب واریانت‌ها و خرید */
.purchase-section {
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding-top: 20px;
    margin-top: 15px;
}

.section-label {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--text-dark, #1e293b);
    margin-bottom: 12px;
}

.variants-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.variant-btn {
    position: relative;
    cursor: pointer;
}

.variant-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.variant-custom-label {
    display: inline-block;
    padding: 10px 22px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-dark, #1e293b);
    transition: all 0.25s ease;
    background: #ffffff;
    user-select: none;
    text-align: center;
}

.variant-btn:hover .variant-custom-label {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.variant-btn input[type="radio"]:checked + .variant-custom-label {
    border-color: var(--primary-color, #043e59);
    background-color: rgba(4, 62, 89, 0.05);
    color: var(--primary-color, #043e59);
    box-shadow: 0 4px 12px rgba(4, 62, 89, 0.1);
}

/* باکس قیمت و خرید */
.price-and-action-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

@media (max-width: 576px) {
    .price-and-action-box {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
    }
}

.detail-price-area {
    display: flex;
    flex-direction: column;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.current-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: #2e7d32;
}

.currency-label {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--text-muted, #64748b);
    margin-right: 3px;
}

/* بخش جدید توضیحات ادغام‌شده در زیر تصاویر */
.product-description-card-embedded {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(4, 62, 89, 0.02);
}

.description-title {
    color: var(--primary-color, #043e59);
    font-size: 1.05rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

.description-text {
    line-height: 1.8;
    color: var(--text-dark, #1e293b);
    font-size: 0.9rem;
    text-align: justify;
}

.purchase-action-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 0;
    border-radius: 12px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* انتخابگر تعداد */
.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    height: 48px;
    direction: ltr;
}

.qty-btn {
    background: none;
    border: none;
    width: 40px;
    height: 100%;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.qty-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color, #043e59);
}

#product-qty-input {
    width: 50px;
    height: 100%;
    text-align: center;
    border: none;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark, #1e293b);
    outline: none;
    background: transparent;
    -moz-appearance: textfield;
}

#product-qty-input::-webkit-outer-spin-button,
#product-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* دکمه ارسال اصلی خرید */
.add-to-cart-submit-btn {
    flex-grow: 1;
    height: 48px;
    padding: 0 24px;
    background-color: var(--primary-color, #043e59);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    line-height: normal;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(4, 62, 89, 0.15);
}

.add-to-cart-submit-btn i {
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
}

.add-to-cart-submit-btn span {
    display: inline-block;
    padding-top: 2px;
}

.add-to-cart-submit-btn:hover {
    background-color: #032b3f;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(4, 62, 89, 0.25);
}

/* تگ‌های محصول */
.product-tags-wrapper {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag-title-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-left: 5px;
}

.product-tag-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-tag-badge:hover {
    background-color: #bae6fd;
    color: #025082;
}

.specs-hybrid-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    direction: rtl;
    text-align: right;
}

.spec-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    gap: 10px;
}

.spec-row-item:hover {
    background: #f1f5f9;
}

.spec-row-key {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.spec-row-key i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.spec-row-val {
    flex-grow: 1;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: left;
    direction: ltr;
}

.font-mono {
    font-family: 'Consolas', 'Courier New', monospace;
    direction: ltr;
    text-align: left !important;
    unicode-bidi: plaintext;
}

.text-left-align {
    text-align: left !important;
    direction: ltr !important;
    justify-content: flex-end;
}