:root {
    --admin-white: #ffffff;
    --admin-light-gray: #f5f5f5;
    --admin-dark: #333333;
    --admin-blue: #0288d1;
    --admin-gold: #ffca28;
    --admin-error: #d32f2f;
    --admin-success: #2e7d32;
    --admin-gradient: linear-gradient(135deg, #0288d1, #ffca28);
}

/* انیمیشن‌ها */
@keyframes adminFadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes adminFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes adminScaleIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* تنظیمات کلی صفحه */
.product-detail {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 20px auto;
    background: var(--admin-white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: adminFadeInUp 0.5s ease-out forwards;
}

/* کنترل‌های هدر */
.product-header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.return-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-blue);
    color: var(--admin-white);
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.return-btn:hover {
    background: var(--admin-gradient);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* عنوان اصلی */
.product-detail h1 {
    color: var(--admin-blue);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
}

/* چیدمان محصول */
.product-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

/* بخش تصاویر */
.product-images {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.main-image {
    width: 100%;
    height: 300px;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.main-image:hover {
    transform: scale(1.03);
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* برچسب وضعیت محصول */
.product-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: adminFadeInUp 0.5s ease;
}

.product-status-available {
    background: var(--admin-success);
    color: var(--admin-white);
    box-shadow: 0 0 6px rgba(46, 125, 50, 0.4);
}

.product-status-unavailable {
    background: var(--admin-error);
    color: var(--admin-white);
    box-shadow: 0 0 6px rgba(211, 47, 47, 0.4);
}

/* گالری تصاویر کوچک */
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid var(--admin-light-gray);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.thumbnail:hover {
    border-color: var(--admin-gold);
    transform: scale(1.1);
}

/* بخش اطلاعات محصول */
.product-info {
    flex: 2;
    min-width: 300px;
    padding: 15px;
}

.product-meta p {
    font-size: 1rem;
    color: var(--admin-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.category-link {
    color: var(--admin-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.category-link:hover {
    color: var(--admin-gold);
}

.product-meta .price {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    min-height: 60px;
}

.original-price {
    color: var(--admin-error);
    text-decoration: line-through;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.final-price {
    color: var(--admin-dark);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* دکمه‌های سبد خرید */
.cart-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.add-to-cart-btn,
.remove-from-cart-btn {
    background: var(--admin-blue);
    color: var(--admin-white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.add-to-cart-btn:hover,
.remove-from-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
    background: var(--admin-gradient);
}

.add-to-cart-btn.disabled {
    background: var(--admin-light-gray);
    color: var(--admin-dark);
    cursor: not-allowed;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background: transparent;
    color: var(--admin-blue);
    border: 2px solid var(--admin-blue);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.quantity-btn:hover {
    background: var(--admin-blue);
    color: var(--admin-white);
    border-color: var(--admin-blue);
}

.quantity {
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-dark);
    min-width: 25px;
    text-align: center;
}

/* سرتیترهای بخش‌ها */
.product-info h2 {
    color: var(--admin-blue);
    font-size: 1.6rem;
    margin: 20px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* لیست ویژگی‌ها */
.features-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.features-list li {
    font-size: 0.95rem;
    color: var(--admin-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* محصولات مرتبط */
.related-products {
    margin-top: 40px;
}

.related-products h2 {
    color: var(--admin-blue);
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    justify-content: center;
    font-weight: 600;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 220px);
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

.related-card {
    background: var(--admin-white);
    border: 2px solid var(--admin-light-gray);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 300px;
    width: 220px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.related-image {
    width: 100%;
    height: 180px;
    aspect-ratio: 1/1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.related-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: adminFadeInUp 0.5s ease;
}

.related-status-available {
    background: var(--admin-success);
    color: var(--admin-white);
    box-shadow: 0 0 6px rgba(46, 125, 50, 0.4);
}

.related-status-unavailable {
    background: var(--admin-error);
    color: var(--admin-white);
    box-shadow: 0 0 6px rgba(211, 47, 47, 0.4);
}

.related-card h3 {
    color: var(--admin-dark);
    font-size: 0.98rem;
    font-weight: 600;
    margin: 10px;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-price {
    background: var(--admin-light-gray);
    color: var(--admin-dark);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px;
    border-radius: 0 0 12px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 60px;
}

.related-price .original-price {
    color: var(--admin-error);
    text-decoration: line-through;
    font-size: 0.85rem;
}

.related-price .final-price {
    color: var(--admin-dark);
    font-size: 1rem;
}

/* مودال تصویر */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--admin-white);
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    transition: background 0.3s ease, transform 0.3s ease;
    font-size: 1.2rem;
}

.image-nav:hover {
    background: var(--admin-blue);
    transform: translateY(-50%) scale(1.1);
}

.image-nav.prev {
    left: 15px;
}

.image-nav.next {
    right: 15px;
}

.close-modal {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    color: var(--admin-dark);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--admin-error);
}

/* مودال پروفایل */
.profile-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    padding: 10px;
    animation: adminFadeInUp 0.3s ease-out;
}

.profile-modal-content {
    background: var(--admin-white);
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: adminScaleIn 0.3s ease-out;
    border: 2px solid var(--admin-gold);
}

.profile-modal-close {
    position: absolute;
    top: -30px;
    right: -10px;
    color: var(--admin-error);
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    background: var(--admin-white);
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-modal-close:hover {
    transform: scale(1.2);
    color: var(--admin-dark);
}

.profile-modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--admin-success);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-modal-header h3 {
    font-size: 1.8rem;
    color: var(--admin-dark);
    font-weight: 700;
    margin: 0;
}

.profile-modal-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-modal-stats p {
    font-size: 1.1rem;
    color: var(--admin-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.profile-modal-stats p i {
    color: var(--admin-blue);
    font-size: 1.2rem;
}

.profile-modal-stats p span {
    font-weight: 600;
    color: var(--admin-success);
}

/* مودال اطلاع‌رسانی */
.notification-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px;
    width: 90%;
    max-width: 400px;
}

.notification-modal.show {
    display: block;
    animation: adminScaleIn 0.3s ease-out, adminFadeOut 0.3s ease-in 1.7s forwards;
}

.notification-content {
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-white);
    background: var(--admin-blue);
    text-align: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.notification-content.success {
    background: var(--admin-success);
}

.notification-content.error {
    background: var(--admin-error);
}

.notification-content i {
    font-size: 1.2rem;
}

/* بخش نظرات */
.comments-section {
    margin-top: 40px;
}

.comments-section h2 {
    color: var(--admin-blue);
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    justify-content: center;
    font-weight: 600;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid var(--admin-light-gray);
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.comment-form textarea:focus {
    border-color: var(--admin-blue);
    outline: none;
}

.submit-comment-btn {
    background: var(--admin-blue);
    color: var(--admin-white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.submit-comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
    background: var(--admin-gradient);
}

.comment-error, .comment-success {
    font-size: 0.95rem;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-error {
    background: var(--admin-error);
    color: var(--admin-white);
}

.comment-success {
    background: var(--admin-success);
    color: var(--admin-white);
}

.comment-login-prompt {
    font-size: 0.95rem;
    color: var(--admin-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.comment-login-prompt a {
    color: var(--admin-blue);
    text-decoration: none;
    font-weight: 600;
}

.comment-login-prompt a:hover {
    color: var(--admin-gold);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-card {
    display: flex;
    gap: 12px;
    background: var(--admin-white);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.comment-card:hover {
    transform: translateY(-3px);
}

.comment-profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--admin-light-gray);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.comment-profile-img:hover {
    transform: scale(1.1);
}

.comment-content {
    flex: 1;
}

.comment-user {
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-dark);
    margin-bottom: 6px;
}

.comment-text {
    font-size: 0.95rem;
    color: var(--admin-dark);
    line-height: 1.5;
    margin-bottom: 6px;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--admin-light-gray);
    font-weight: 500;
}

.admin-reply {
    margin-top: 8px;
    padding: 8px;
    background: var(--admin-light-gray);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--admin-dark);
}

.no-comments {
    font-size: 0.95rem;
    color: var(--admin-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* واکنش‌گرایی برای تبلت */
@media (max-width: 768px) {
    .product-detail {
        padding: 30px 15px;
    }

    .product-container {
        flex-direction: column;
        gap: 20px;
    }

    .main-image {
        height: 280px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
    }

    .product-detail h1 {
        font-size: 2.2rem;
    }

    .product-info h2 {
        font-size: 1.4rem;
    }

    .product-meta p {
        font-size: 0.95rem;
    }

    .product-meta .price {
        font-size: 1.1rem;
        min-height: 55px;
    }

    .original-price {
        font-size: 0.8rem;
    }

    .final-price {
        font-size: 0.9rem;
    }

    .cart-actions {
        flex-direction: column;
    }

    .add-to-cart-btn,
    .remove-from-cart-btn,
    .quantity-controls {
        width: 100%;
        justify-content: center;
    }

    .return-btn {
        width: 100%;
        justify-content: center;
    }

    .related-grid {
        grid-template-columns: repeat(auto-fit, 180px);
    }

    .related-card {
        min-height: 280px;
        width: 180px;
        max-width: 180px;
    }

    .related-image {
        height: 150px;
    }

    .related-card h3 {
        font-size: 0.84rem;
    }

    .related-price {
        font-size: 0.9rem;
        min-height: 55px;
    }

    .related-price .original-price {
        font-size: 0.75rem;
    }

    .related-price .final-price {
        font-size: 0.9rem;
    }

    .profile-modal-content {
        max-width: 95%;
        padding: 15px;
    }

    .profile-modal-icon {
        width: 60px;
        height: 60px;
    }

    .profile-modal-header h3 {
        font-size: 1.5rem;
    }

    .profile-modal-stats p {
        font-size: 1rem;
    }

    .profile-modal-close {
        top: -25px;
        right: -5px;
        font-size: 1.5rem;
    }

    .comment-profile-img {
        width: 35px;
        height: 35px;
    }

    .comment-form textarea {
        font-size: 0.95rem;
    }

    .submit-comment-btn {
        font-size: 0.95rem;
    }

    .notification-modal {
        bottom: 15px;
        padding: 8px;
        max-width: 350px;
    }

    .notification-content {
        font-size: 0.95rem;
        padding: 10px 15px;
    }

    .notification-content i {
        font-size: 1.1rem;
    }
}

/* واکنش‌گرایی برای موبایل */
@media (max-width: 480px) {
    .product-detail {
        padding: 20px 10px;
    }

    .main-image {
        height: 260px;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .product-detail h1 {
        font-size: 1.8rem;
    }

    .product-info h2 {
        font-size: 1.2rem;
    }

    .product-meta p {
        font-size: 0.9rem;
    }

    .product-meta .price {
        font-size: 1rem;
        min-height: 50px;
    }

    .original-price {
        font-size: 0.75rem;
    }

    .final-price {
        font-size: 0.85rem;
    }

    .related-grid {
        grid-template-columns: repeat(auto-fit, 150px);
    }

    .related-card {
        min-height: 260px;
        width: 150px;
        max-width: 150px;
    }

    .related-image {
        height: 120px;
    }

    .related-card h3 {
        font-size: 0.77rem;
    }

    .related-price {
        font-size: 0.85rem;
        min-height: 50px;
    }

    .related-price .original-price {
        font-size: 0.7rem;
    }

    .related-price .final-price {
        font-size: 0.85rem;
    }

    .profile-modal-content {
        max-width: 90%;
        padding: 12px;
    }

    .profile-modal-icon {
        width: 50px;
        height: 50px;
    }

    .profile-modal-header h3 {
        font-size: 1.3rem;
    }

    .profile-modal-stats p {
        font-size: 0.9rem;
    }

    .profile-modal-close {
        top: -20px;
        right: -5px;
        font-size: 1.3rem;
    }

    .comment-profile-img {
        width: 30px;
        height: 30px;
    }

    .comment-form textarea {
        font-size: 0.9rem;
    }

    .submit-comment-btn {
        font-size: 0.9rem;
    }

    .notification-modal {
        bottom: 10px;
        padding: 5px;
        max-width: 300px;
    }

    .notification-content {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .notification-content i {
        font-size: 1rem;
    }
}