/* =====================================================
   PRODUCT DETAIL PAGE STYLES
   ===================================================== */

.product-detail-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

/* Main Container */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Gallery */
.product-gallery {
    position: sticky;
    top: 80px;
    align-self: start;
}

.gallery-main {
    position: relative;
    aspect-ratio: 1;
    background: var(--card-bg, #fff);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-main:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 16px;
}

.gallery-nav.next {
    right: 16px;
}

.gallery-nav svg {
    width: 24px;
    height: 24px;
}

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.gallery-thumb:hover {
    transform: scale(1.05);
}

.gallery-thumb.active {
    border-color: var(--primary-color, #667eea);
}

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

/* Product Info */
.product-info {
    padding: 20px 0;
}

.product-category-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--badge-bg, #f0f0f0);
    color: var(--text-muted, #666);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.product-title {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary, #1a1a1a);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

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

.product-rating .star {
    font-size: 18px;
}

.product-rating .star.filled {
    color: #fbbf24;
}

.product-rating .star.empty {
    color: #d1d5db;
}

.rating-value {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.reviews-count {
    color: var(--text-muted, #666);
    font-size: 14px;
}

/* Price Section */
.product-price-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color, #667eea);
}

.product-stock {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-stock.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.product-stock.sold-out {
    background: #fee2e2;
    color: #991b1b;
}

/* Description */
.product-description {
    margin-bottom: 24px;
    line-height: 1.7;
    color: var(--text-secondary, #444);
    font-size: 15px;
}

/* Meta Info */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted, #666);
    font-size: 14px;
}

.meta-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Seller Section */
.product-seller {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.seller-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.seller-details {
    display: flex;
    flex-direction: column;
}

.seller-label {
    font-size: 12px;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seller-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    display: flex;
    align-items: center;
    gap: 6px;
}

.seller-info:hover .seller-name {
    color: var(--primary-color, #667eea);
}

.verified-badge {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23667eea"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') center/contain no-repeat;
}

/* Actions */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-add-cart svg {
    width: 22px;
    height: 22px;
}

.btn-add-cart:hover {
    background: var(--primary-hover, #5a6fd6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-add-cart.in-cart {
    background: #10b981;
}

.btn-add-cart.in-cart:hover {
    background: #059669;
}

.btn-sold-out {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background: #e5e7eb;
    color: #6b7280;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
}

/* Owner Actions */
.product-owner-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-edit-product,
.btn-delete-product {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-edit-product {
    background: var(--card-bg, #fff);
    color: var(--text-primary, #1a1a1a);
    border: 1px solid var(--border-color, #e0e0e0);
}

.btn-edit-product:hover {
    border-color: var(--primary-color, #667eea);
    color: var(--primary-color, #667eea);
}

.btn-delete-product {
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.btn-delete-product:hover {
    background: #fecaca;
}

.btn-edit-product svg,
.btn-delete-product svg {
    width: 18px;
    height: 18px;
}

/* Related Video */
.product-related-video {
    margin-bottom: 40px;
    padding: 24px;
    background: var(--card-bg, #fff);
    border-radius: 16px;
}

.product-related-video h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

.related-video-card {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
}

.related-video-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.related-video-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.related-video-card:hover .play-icon {
    background: var(--primary-color, #667eea);
    transform: translate(-50%, -50%) scale(1.1);
}

.related-video-card .play-icon svg {
    width: 28px;
    height: 28px;
}

.related-video-card .video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.related-video-card .video-title {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* Reviews Section */
.product-reviews-section {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 24px;
}

.section-title {
    margin: 0 0 24px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
}

/* Review Form */
.review-form {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--input-bg, #f9f9f9);
    border-radius: 12px;
}

.review-form h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
}

.star-rating-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.star-input {
    font-size: 28px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.star-input:hover,
.star-input.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.review-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 16px;
    background: var(--card-bg, #fff);
}

.review-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
}

.btn-submit-review {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit-review:hover {
    background: var(--primary-hover, #5a6fd6);
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    background: var(--input-bg, #f9f9f9);
    border-radius: 12px;
}

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

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.review-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.review-author:hover .author-name {
    color: var(--primary-color, #667eea);
}

.review-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

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

.review-stars .star {
    font-size: 14px;
}

.review-stars .star.filled {
    color: #fbbf24;
}

.review-stars .star.empty {
    color: #d1d5db;
}

.review-time {
    font-size: 12px;
    color: var(--text-muted, #666);
}

.review-content {
    line-height: 1.6;
    color: var(--text-secondary, #444);
}

.no-reviews {
    text-align: center;
    padding: 40px;
    color: var(--text-muted, #666);
}

/* Night Mode */
.night-mode .product-detail-page {
    color: #e0e0e0;
}

.night-mode .product-title,
.night-mode .section-title,
.night-mode .seller-name,
.night-mode .author-name,
.night-mode .rating-value {
    color: #e0e0e0;
}

.night-mode .product-price-section,
.night-mode .product-meta,
.night-mode .product-seller,
.night-mode .product-reviews-section,
.night-mode .product-related-video,
.night-mode .gallery-main {
    background: #1a1a2e;
}

.night-mode .review-form,
.night-mode .review-item {
    background: #16213e;
}

.night-mode .product-category-badge {
    background: #2a2a4e;
    color: #a0a0a0;
}

.night-mode .gallery-nav {
    background: rgba(30, 30, 50, 0.9);
    color: #e0e0e0;
}

.night-mode .btn-edit-product {
    background: #1a1a2e;
    border-color: #2a2a4e;
    color: #e0e0e0;
}

.night-mode .review-form textarea {
    background: #1a1a2e;
    border-color: #2a2a4e;
    color: #e0e0e0;
}

.night-mode .status-badge.pending {
    background: #451a03;
    color: #fcd34d;
}

/* Responsive */
@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product-gallery {
        position: static;
    }
}

@media (max-width: 768px) {
    .product-detail-page {
        padding: 12px;
    }

    .product-title {
        font-size: 22px;
    }

    .product-price {
        font-size: 26px;
    }

    .gallery-thumb {
        width: 60px;
        height: 60px;
    }

    .product-owner-actions {
        flex-direction: column;
    }

    .review-header {
        flex-direction: column;
        gap: 12px;
    }

    .review-meta {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .product-price-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .product-meta {
        flex-direction: column;
    }

    .star-input {
        font-size: 24px;
    }
}
