/* ============================================
   SINGLE PRODUCT PAGE - دیجی‌کالا استایل
   ============================================ */

.product-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.breadcrumb a {
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #ef4056;
}

.breadcrumb .separator {
    color: #ddd;
    margin: 0 2px;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* ====================
   بخش اصلی محصول
   ==================== */
.product-main-container {
    display: grid;
    grid-template-columns: 45% 1fr;
    gap: 24px;
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

/* ستون گالری */
.product-gallery-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.gallery-wrapper {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.main-image-container {
    position: relative;
    aspect-ratio: 1;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.4s ease, opacity 0.2s ease;
}

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

.discount-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #ef4056;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 64, 86, 0.3);
}

.new-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #10b981;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.thumbnail-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.thumbnail-item {
    aspect-ratio: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
    padding: 4px;
}

.thumbnail-item:hover,
.thumbnail-item.active {
    border-color: #ef4056;
    transform: translateY(-2px);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ویژگی‌های کلیدی */
.key-features-box {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.features-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #232933;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px dashed #e5e7eb;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li svg {
    color: #10b981;
    flex-shrink: 0;
}

.attr-name {
    color: #666;
    font-weight: 500;
}

.attr-value {
    font-weight: 600;
    color: #232933;
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #ddd;
}

/* ستون اطلاعات */
.product-info-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.6;
    color: #232933;
    margin: 0;
}

/* نوار متا */
.product-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.rating-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stars {
    display: flex;
    gap: 2px;
}

.rating-score {
    font-size: 16px;
    font-weight: 700;
    color: #232933;
}

.rating-count {
    font-size: 13px;
    color: #999;
}

.meta-stats {
    display: flex;
    gap: 16px;
}

.meta-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.meta-stat svg {
    color: #999;
}

/* توضیحات کوتاه */
.product-short-desc {
    color: #555;
    line-height: 1.9;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-right: 4px solid #ef4056;
    font-size: 14px;
}

/* باکس خرید */
.product-buy-box {
    padding: 24px;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe5e8 100%);
    border-radius: 16px;
    border: 2px solid #ffe5e8;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.price-box {
    padding-bottom: 16px;
    border-bottom: 1px dashed #ffcdd2;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-row:last-child {
    margin-bottom: 0;
}

.price-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.old-price {
    font-size: 15px;
    color: #999;
    text-decoration: line-through;
}

.current-price {
    font-size: 28px;
    font-weight: 800;
    color: #ef4056;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.current-price .currency {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.discount-tag {
    background: #ef4056;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

/* وضعیت موجودی */
.stock-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.stock-status.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.stock-status.out-of-stock {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* انتخاب تعداد */
.quantity-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.qty-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.qty-control {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: border-color 0.2s;
}

.qty-control:focus-within {
    border-color: #ef4056;
}

.qty-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    font-size: 22px;
    color: #333;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.qty-btn:hover {
    background: #ef4056;
    color: white;
}

.qty-control input {
    width: 60px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.qty-control input:focus {
    outline: none;
}

/* دکمه‌ها */
.btn-add-cart {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ef4056 0%, #f93d66 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(239, 64, 86, 0.35);
    transition: all 0.2s;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 64, 86, 0.45);
}

.btn-add-cart:active {
    transform: translateY(0);
}

.btn-wishlist {
    width: 100%;
    padding: 14px 24px;
    background: white;
    color: #666;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-wishlist:hover {
    border-color: #ef4056;
    color: #ef4056;
    background: #fff5f7;
}

/* اطلاعات اضافی */
.product-extra-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.info-item svg {
    color: #ef4056;
    flex-shrink: 0;
}

.info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
    color: #232933;
}

/* ====================
   تب‌های اطلاعات
   ==================== */
.product-tabs-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.tab-btn {
    flex: 1;
    padding: 18px 24px;
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #ef4056;
    background: #fff5f7;
}

.tab-btn.active {
    color: #ef4056;
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #ef4056;
}

.tab-count {
    font-size: 12px;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    color: #666;
}

.tab-btn.active .tab-count {
    background: #ffe5e8;
    color: #ef4056;
}

.tabs-content {
    padding: 32px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* توضیحات */
.description-content {
    line-height: 2;
    color: #444;
    font-size: 15px;
}

.description-content p {
    margin-bottom: 16px;
}

.description-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}

/* مشخصات فنی */
.specs-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.spec-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.spec-row:hover {
    background: #fafafa;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-name {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.spec-value {
    color: #232933;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* نظرات */
.reviews-summary {
    display: flex;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe5e8 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.rating-big {
    text-align: center;
}

.rating-number {
    font-size: 48px;
    font-weight: 800;
    color: #ef4056;
    line-height: 1;
    margin-bottom: 12px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.rating-total {
    font-size: 14px;
    color: #666;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ef4056 0%, #f93d66 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.name {
    font-weight: 600;
    font-size: 14px;
    color: #232933;
}

.date {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #232933;
}

.review-comment {
    color: #555;
    line-height: 1.9;
    font-size: 14px;
}

.empty-tab {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-tab svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-tab p {
    margin-bottom: 20px;
    font-size: 15px;
}

/* ====================
   محصولات مرتبط
   ==================== */
.related-products-section {
    background: white;
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.related-products-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.related-products-section .section-title {
    font-size: 20px;
    font-weight: 700;
    color: #232933;
}

/* ====================
   نوار فیکس موبایل
   ==================== */
.mobile-sticky-bar {
    display: none;
}

/* ====================
   ریسپانسیو
   ==================== */
@media (max-width: 1024px) {
    .product-main-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-gallery-column {
        position: static;
    }
    
    .product-extra-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding-bottom: 90px;
    }
    
    .product-main-container {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .product-buy-box {
        padding: 20px;
    }
    
    .tabs-header {
        overflow-x: auto;
    }
    
    .tab-btn {
        padding: 14px 16px;
        font-size: 14px;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .tabs-content {
        padding: 20px 16px;
    }
    
    .spec-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .related-products-section {
        padding: 20px 16px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* نوار فیکس موبایل */
    .mobile-sticky-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: white;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        border-top: 1px solid #f0f0f0;
        animation: slideUp 0.3s ease-out;
    }
    
    .sticky-content {
        display: flex;
        align-items: center;
        gap: 12px;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .sticky-price-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .sticky-old-price {
        font-size: 12px;
        color: #999;
        text-decoration: line-through;
    }
    
    .sticky-current-price {
        font-size: 18px;
        font-weight: 800;
        color: #ef4056;
        display: flex;
        align-items: baseline;
        gap: 4px;
    }
    
    .sticky-current-price .currency {
        font-size: 11px;
        font-weight: 500;
        color: #666;
    }
    
    .btn-sticky-add {
        flex-shrink: 0;
        min-width: 140px;
        padding: 14px 20px;
        background: linear-gradient(135deg, #ef4056 0%, #f93d66 100%);
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 16px rgba(239, 64, 86, 0.35);
        transition: all 0.2s;
    }
    
    .btn-sticky-add:active {
        transform: scale(0.96);
    }
    
    .btn-sticky-add.disabled {
        background: #ccc;
        box-shadow: none;
        cursor: not-allowed;
    }
    
    .btn-sticky-add svg {
        width: 20px;
        height: 20px;
    }
    
    /* مخفی کردن دکمه‌های تکراری در دسکتاپ */
    .product-buy-box .btn-add-cart,
    .product-buy-box .btn-wishlist {
        display: none;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .mobile-sticky-bar {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }
    }
}

@media (max-width: 480px) {
    .product-main-container {
        padding: 12px;
    }
    
    .current-price {
        font-size: 22px;
    }
    
    .btn-sticky-add {
        min-width: 120px;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .sticky-current-price {
        font-size: 16px;
    }
}