/**
 * استایل‌های سفارشی برای بهبود تم کلی صفحه محصول
 */

/* متغیرهای رنگ‌ها */
:root {
    --primary-color: #2E7D32;
    --primary-light: #e8f5e9;
    --primary-dark: #1B5E20;
    --secondary-color: #455a64;
    --accent-color: #FF5722;
    --text-dark: #333333;
    --text-light: #757575;
    --background-light: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --warning-color: #FFC107;
}

/* بهبود استایل کلی صفحه */
body.shop-page {
    background-color: var(--background-light);
}

/* باکس اصلی محصول */
.product-content {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 30px;
    overflow: hidden;
}

/* گالری تصاویر */
.main-image {
    position: relative;
    background-color: var(--background-light);
    overflow: hidden;
}

.main-image img {
    transition: transform 0.5s ease;
}

.main-image:hover img {
    transform: scale(1.05);
}

.zoom-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 2;
    opacity: 0;
}

.main-image:hover .zoom-icon {
    opacity: 1;
}

.zoom-icon:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.gallery-thumbnails img {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumbnails img.active {
    border-color: var(--primary-color);
}

/* بخش اطلاعات محصول */
.product-info h1 {
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    position: relative;
    padding-bottom: 15px;
}

.product-info h1:after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.product-category {
    background-color: var(--primary-light);
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.product-category:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* بخش قیمت محصول */
.product-price-wrapper {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(145deg, #f5f9f5, var(--primary-light));
    border-radius: 12px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.product-price-wrapper::before {
    content: "قیمت محصول";
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 3px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 18px;
    margin-left: 15px;
}

.current-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* توضیحات محصول */
.product-description {
    line-height: 2;
    color: var(--text-light);
    margin: 25px 0;
    padding: 20px;
    background-color: var(--background-light);
    border-right: 4px solid var(--primary-color);
    border-radius: 0 12px 12px 0;
    font-size: 15px;
    text-align: justify;
}

/* ویژگی‌های محصول */
.product-features h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-dark);
    position: relative;
    padding-right: 15px;
}

.product-features h3:before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.product-features ul {
    padding: 0;
    margin: 0;
}

.product-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background-color: var(--background-light);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.product-features li:hover {
    background-color: var(--primary-light);
    transform: translateX(-5px);
}

.product-features li i {
    color: var(--primary-color);
    font-size: 16px;
}

/* دکمه‌های عملیات */
.quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.quantity-btn {
    background: none;
    border: none;
    height: 48px;
    width: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 16px;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background-color: var(--primary-light);
}

.quantity input {
    width: 60px;
    height: 48px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    height: 48px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 25px;
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.2);
}

.add-to-cart-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.3);
}

.add-to-wishlist-btn {
    background-color: white;
    height: 48px;
    width: 48px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
    font-size: 18px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.add-to-wishlist-btn:hover {
    color: var(--error-color);
    border-color: var(--error-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.add-to-wishlist-btn i.fas {
    color: var(--error-color);
}

/* بخش مشخصات محصول */
.product-meta-info {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.product-meta-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 14px;
}

.product-meta-info i {
    color: var(--primary-color);
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* وضعیت موجودی */
.stock-info {
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-right: 10px;
}

.in-stock {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.out-of-stock {
    background-color: #ffebee;
    color: var(--error-color);
}

/* بخش تب‌ها */
.product-tabs {
    margin-top: 40px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-light);
}

.tab-item {
    padding: 15px 25px;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.tab-item:hover {
    color: var(--primary-color);
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-item.active:after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* جدول مشخصات فنی */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.specs-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.specs-row:last-child {
    border-bottom: none;
}

.specs-row:nth-child(odd) {
    background-color: var(--background-light);
}

.specs-label {
    flex: 1;
    padding: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.specs-value {
    flex: 2;
    padding: 15px;
    color: var(--text-light);
}

/* بخش نظرات */
.reviews-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--background-light);
    border-radius: 10px;
}

.average-rating {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.rating-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.rating-stars {
    margin-bottom: 10px;
}

.rating-stars i {
    color: #FFD700;
    font-size: 18px;
}

.rating-count {
    color: var(--text-light);
    font-size: 14px;
}

.rating-breakdown {
    flex: 1;
    min-width: 250px;
}

.rating-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-label {
    width: 80px;
    font-size: 14px;
    color: var(--text-light);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 10px;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
}

.rating-percent {
    width: 40px;
    font-size: 14px;
    color: var(--text-light);
    text-align: right;
}

.user-reviews {
    margin-top: 30px;
}

.review {
    padding: 20px;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.reviewer-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}

.review-date {
    color: var(--text-light);
    font-size: 14px;
}

.reviewer-rating {
    margin-top: 5px;
}

.reviewer-rating i {
    color: #FFD700;
    font-size: 14px;
}

.review-content p {
    line-height: 1.8;
    color: var(--text-light);
}

/* فرم ثبت نظر */
.add-review {
    margin-top: 40px;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.add-review h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 10px;
}

.add-review h3:after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.rating-select {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.rating-select i {
    cursor: pointer;
    font-size: 24px;
    color: #e0e0e0;
    transition: all 0.2s;
}

.rating-select i.fas,
.rating-select i.star-hover {
    color: #FFD700;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    min-height: 120px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
    outline: none;
}

.submit-review {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.submit-review:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.2);
}

/* محصولات مرتبط */
.related-products {
    margin-top: 50px;
}

.related-products h2 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 15px;
}

.related-products h2:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* کارت محصول */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-card .product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-card .product-actions a {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.product-card .product-actions a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.product-card .product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-category {
    font-size: 12px;
    padding: 4px 10px;
    margin-bottom: 8px;
    display: inline-block;
}

.product-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-dark);
}

.product-card h3 a {
    color: inherit;
    text-decoration: none;
}

.product-card h3 a:hover {
    color: var(--primary-color);
}

.product-card .product-price {
    margin-top: auto;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* مودال بزرگنمایی تصویر */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 50px 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    animation: zoom 0.3s;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@keyframes zoom {
    from {transform: scale(0.1); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* ریسپانسیو */
@media (max-width: 992px) {
    .product-content {
        display: block;
    }
    
    .product-gallery, 
    .product-info {
        width: 100%;
    }
    
    .main-image {
        height: auto;
    }
    
    .gallery-thumbnails {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }
    
    .product-features ul {
        grid-template-columns: 1fr;
    }
    
    .reviews-summary {
        flex-direction: column;
    }
    
    .related-products .products {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* نوار چسبنده افزودن به سبد خرید */
    .sticky-add-to-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);
        padding: 10px 15px;
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: transform 0.3s ease;
        border-top: 1px solid #f0f0f0;
    }
    
    .sticky-add-to-cart.hidden {
        transform: translateY(100%);
    }
    
    /* قسمت اطلاعات (قیمت و موجودی) */
    .sticky-info {
        display: flex;
        flex-direction: column;
    }
    
    /* قسمت قیمت */
    .sticky-price {
        display: flex;
        flex-direction: column;
        margin-bottom: 4px;
        position: relative;
        padding-right: 30px;
    }
    
    .sticky-discount-badge {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background-color: #ef394e;
        color: white;
        font-size: 11px;
        font-weight: 700;
        width: 25px;
        height: 25px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sticky-original-price {
        text-decoration: line-through;
        color: #999;
        font-size: 12px;
        font-weight: normal;
        line-height: 1.2;
    }
    
    .sticky-current-price {
        font-size: 16px;
        font-weight: 700;
        color: #2e7d32;
        line-height: 1.4;
    }
    
    /* وضعیت موجودی */
    .sticky-stock {
        font-size: 11px;
    }
    
    .sticky-stock .in-stock {
        color: #2e7d32;
    }
    
    .sticky-stock .in-stock i {
        margin-left: 4px;
    }
    
    .sticky-stock .out-of-stock {
        color: #ef394e;
    }
    
    .sticky-stock .out-of-stock i {
        margin-left: 4px;
    }
    
    /* بخش دکمه‌ها */
    .sticky-actions {
        display: flex;
        align-items: center;
    }
    
    /* دکمه افزودن به سبد خرید */
    .sticky-add-to-cart-btn {
        background-color: #2e7d32;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 20px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 150px;
    }
    
    .sticky-add-to-cart-btn:hover {
        background-color: #1b5e20;
    }
    
    /* دکمه موجود شد خبرم کن */
    .sticky-notify-me-btn {
        background-color: #f5f5f5;
        color: #333;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 8px 20px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 150px;
    }
    
    .sticky-notify-me-btn:hover {
        background-color: #eeeeee;
    }
    
    /* فضای اضافی در پایین صفحه برای جلوگیری از پوشانده شدن محتوا توسط نوار چسبنده */
    .product-tabs {
        margin-bottom: 80px;
    }
    
    /* مخفی کردن نوار چسبنده وقتی به بخش افزودن به سبد خرید اصلی می‌رسیم */
    .product-actions.visible {
        margin-bottom: 20px;
    }
    
    /* تنظیمات بهتر برای موبایل */
    .product-content {
        flex-direction: column;
    }
    
    /* بهبود سایز عکس محصولات برای موبایل متوسط */
    .product-card .product-image {
        height: 260px;
    }
}

@media (max-width: 576px) {
    .product-info {
        padding: 20px;
    }
    
    .product-info h1 {
        font-size: 24px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .gallery-thumbnails img {
        width: 60px;
        height: 60px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    #add-to-cart-form {
        grid-template-columns: 1fr;
    }
    
    .quantity {
        width: 100%;
    }
    
    .tab-header {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .related-products .products {
        grid-template-columns: 1fr;
    }
    
    /* بهبود سایز عکس محصولات برای موبایل کوچک */
    .product-card .product-image {
        height: 280px;
    }
    
    .product-card .product-image img {
        object-fit: cover;
        object-position: center;
    }
}

/* بهبود سایز عکس محصولات برای موبایل خیلی کوچک */
@media (max-width: 480px) {
    .product-card .product-image {
        height: 300px;
    }
    
    .product-card .product-image img {
        object-fit: cover;
        object-position: center;
    }
    
    /* تنظیم grid محصولات برای موبایل کوچک */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .product-card {
        border-radius: 12px;
        overflow: hidden;
    }
}

/* بهبود سایز عکس محصولات برای موبایل بسیار کوچک */
@media (max-width: 360px) {
    .product-card .product-image {
        height: 200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .product-card .product-info {
        padding: 10px;
    }
    
    .product-card h3 {
        font-size: 12px;
    }
}

/* تنظیمات برای نسخه دسکتاپ */
@media (min-width: 992px) {
    .sticky-add-to-cart {
        width: auto;
        bottom: 20px;
        left: 20px;
        right: auto;
        border-radius: 8px;
        padding: 15px 25px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    }
    
    .sticky-add-to-cart-btn,
    .sticky-notify-me-btn {
        height: 50px;
        min-width: 180px;
        font-size: 14px;
    }
    
    .sticky-price {
        display: none;
    }
    
    .sticky-stock {
        display: none;
    }
}

/* مخفی کردن منوی پایین در صفحه محصول */
body.shop-page .mobile-footer-nav {
    display: none !important;
} 