/* LEPISTESEVI - PRODUCT.CSS */
/* Synced with modals.css for Identical Look */

/* 🌑 MODERN GRAY THEME BASE */
body#productPage {
    background-color: var(--bg);
    color: var(--text);
}

/* URUN CONTAINER */
.product-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

#productPage {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

/* URUN GALERISI & BILGI - Modern Gray Cards */
/* URUN GALERISI & BILGI - Modern Gray Cards */
.product-gallery,
.product-info {
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.product-gallery {
    background: var(--surface-light);
}

.product-info {
    background: var(--surface);
}

/* URUN GALERISI */
.product-gallery {
    margin-bottom: 20px;
}

.product-gallery .main-image {
    position: relative;
    text-align: center;
    margin-bottom: 15px;
}

.product-gallery .main-image img {
    max-width: 100%;
    max-height: 400px !important;
    /* REVERTED from 550px */
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-card);
    padding: 10px;
    margin: 0 auto;
    /* Removed bottom margin kept */
    display: block !important;
}

.image-title-overlay {
    display: none !important;
}

/* URUN BILGILERI */
.product-info {
    text-align: center;
    margin-bottom: 20px;
}

/* Title Styling matches .modal-product-title */
.product-page-title.right-title {
    color: #4db8ff !important;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
    text-align: center;
    /* Fixed: Center alignment to match Index Modal */
    display: block;
    white-space: normal !important;
    overflow: visible !important;
}

.product-page-title.left-title {
    display: block !important;
    /* Fixed: Show on desktop too (Index Modal Match) */
    text-align: center;
    color: #4db8ff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 15px;
    width: 100%;
}

.product-info .desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.product-info .price-block {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
    /* Reduced from 70px to move buttons up 1 line */
    margin-top: 20px;
}

.product-info .old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 1.1rem;
}

.product-info .new-price {
    color: #4db8ff;
    font-size: 1.6rem;
    font-weight: 700;
}

/* URUN BUTONLARI */
.product-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 0;
}

.product-actions .action-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

/* Buttons match #productModal styles */
.product-actions .btn {
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(77, 184, 255, 0.3);
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-actions .btn.success,
.product-actions .add-cart-btn {
    background: #4db8ff;
    border: 2px solid #4db8ff !important;
    color: #fff;
}

.product-actions .btn.success:hover,
.product-actions .add-cart-btn:hover {
    background: #fff;
    border-color: #4db8ff !important;
    color: #4db8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(77, 184, 255, 0.3);
    /* Synced with User Menu */
}

.product-actions .btn.close,
.product-actions .btn.close-btn {
    background: #555;
    /* Dark Grey Match */
    border: 2px solid #555;
    color: #fff !important;
    /* Enforce White */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-actions .btn.close:hover,
.product-actions .btn.close-btn:hover {
    background: #4db8ff;
    border-color: #4db8ff;
    color: #fff;
    transform: translateY(-2px);
}

/* THUMBNAIL CAROUSEL (Synced with Modals) */

/* Thumbnail Row - Chrome Fix */
.thumbnail-row,
#thumbnailRow,
.product-gallery .thumbnail-row,
.product-gallery #thumbnailRow {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    justify-content: flex-start;
    align-items: center;
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto;
    /* Removed top/bottom margin */
    padding: 5px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.thumbnail-row img,
#thumbnailRow img {
    min-width: 60px;
    max-width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.thumbnail-row img:hover,
#thumbnailRow img:hover {
    opacity: 1;
    border-color: rgba(77, 184, 255, 0.5);
    transform: scale(1.05);
}

.thumbnail-row img.active,
#thumbnailRow img.active {
    opacity: 1;
    border-color: #4db8ff;
    box-shadow: 0 0 12px rgba(77, 184, 255, 0.6);
}

.thumb-carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    /* width: 300px !important;  REMOVED to allow full width on product page */
    width: 100%;
    /* Modal width fixed */
    max-width: 100%;
    margin: 25px auto 5px;
    padding: 0 40px;
    box-sizing: content-box;
}

.thumb-track {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 8px;
    overflow: hidden !important;
    /* Modal style */
    scroll-behavior: smooth;
    padding: 5px;
    margin: 0;
    width: 100%;
    justify-content: flex-start;
}

.thumb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--hover-bg) !important;
    color: var(--text-primary) !important;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    z-index: 20;
    opacity: 1 !important;
}

.thumb-nav:hover {
    background: #4db8ff !important;
    color: #fff !important;
}

.thumb-nav.left {
    left: 0;
}

.thumb-nav.right {
    right: 0;
}

.thumb {
    min-width: 60px;
    max-width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.thumb:hover {
    opacity: 1;
    border-color: rgba(77, 184, 255, 0.5);
    transform: scale(1.05);
}

.thumb.active {
    opacity: 1;
    border-color: #4db8ff;
    box-shadow: 0 0 12px rgba(77, 184, 255, 0.6);
}

/* LAYOUT & GRID (Masaustu) - Synced with Modal Grid */
@media (min-width: 768px) {
    .product-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        align-items: stretch;
        /* EQUAL HEIGHT COLUMNS */
        height: auto;
        min-height: 500px;
        /* REVERTED from 650px */
        grid-template-areas:
            "gallery info";
    }

    .product-gallery {
        grid-area: gallery;
        border: 1px solid var(--border-medium);
        background: var(--surface-light);
        padding: 20px 40px;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        /* Center Content Vertical */
        height: 100%;
        overflow: visible !important;
        position: relative;
        gap: 20px;
        /* Use Gap instead of margins */
    }

    .product-info {
        grid-area: info;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Center Content Vertical */
        align-items: center;
        padding: 30px 20px;
        height: 100%;
        /* Nested actions will flow naturally here */
    }

    .product-actions {
        width: 100%;
        margin-top: 20px;
        display: flex;
        justify-content: center;
        gap: 12px;
    }
}

/* MOBIL DUZENLEMELER */
@media (max-width: 768px) {
    .product-page-title.right-title {
        display: none !important;
    }

    .product-page-title.left-title {
        display: block !important;
    }

    .thumb-carousel-wrapper {
        width: 100% !important;
        max-width: 320px !important;
        padding: 0 35px !important;
    }
}

/* DEGERLENDIRME ALANI */
#productReviewSection {
    color: var(--text);
    width: min(560px, 92vw);
    margin: 0 auto;
    padding: 0 6px;
    margin-bottom: calc(110px + env(safe-area-inset-bottom));
}

#productPage #publicReviewCardModal {
    width: 100%;
}

.review-card {
    background: var(--review-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 0 0 1px var(--border);
}

.review-head {
    text-align: center;
    font-weight: 700;
    color: #4db8ff;
    margin-bottom: 8px;
}

.review-comment {
    width: 100%;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid var(--border-medium);
    background: var(--review-input-bg);
    color: var(--text);
    outline: none;
    resize: vertical;
}

.btn-save-review,
.btn-edit-review {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: #4db8ff;
    color: #0b0b0b;
    font-weight: 700;
}

.review-summary {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    color: var(--text);
}

.pending-review-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffa04d;
    color: #0b0b0b;
    font-weight: 900;
    font-size: 12px;
    margin-left: 8px;
    vertical-align: middle;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 22px;
    margin: 10px 0;
    user-select: none;
}

.rating-stars span {
    color: var(--text-faintest);
    cursor: pointer;
    transition: color .15s ease, opacity .15s ease;
}

.rating-stars span.hovered {
    color: #ffd24d;
    opacity: .7;
}

.rating-stars span.active {
    color: #ffd24d;
    opacity: 1;
}

.rating-stars.readonly span {
    pointer-events: none;
    cursor: default;
    opacity: .9;
}

/* 🏷️ MODAL PRODUCT CODE (User Feedback) */
.modal-product-code {
    font-size: 0.75rem;
    color: #aaa;
    /* Default Dark Mode */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 500;
}

/* ☀️ Light Theme Overrides */
[data-theme="light"] .modal-product-code {
    color: #444 !important;
    /* Darker for readability */
    font-weight: 700 !important;
}

/* 🏹 THUMBNAIL ARROWS (Isolated Class from products.js) */
.thumb-nav-isolated {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.thumb-nav-isolated:hover {
    color: #4db8ff;
    transform: scale(1.1);
}

/* ☀️ Light Theme Thumbnail Arrows Fix */
[data-theme="light"] .thumb-nav-isolated,
[data-theme="light"] .thumb-nav {
    color: #222 !important;
    /* Forces Dark Arrow in Light Mode */
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .thumb-nav-isolated:hover,
[data-theme="light"] .thumb-nav:hover {
    color: #4db8ff !important;
}

/* ☀️ Light Theme Specific Visibility Enhancements for Product Modal */
[data-theme="light"] .product-gallery,
[data-theme="light"] .product-info {
    border: 2px solid var(--text-faintest);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .product-gallery {
    background: #f1f3f5;
    /* Slightly darker gray for better contrast */
}

[data-theme="light"] .product-info {
    background: #ffffff;
}

/* 🖼️ Main Image & Thumbnails Border Fix for Light Theme */
[data-theme="light"] .product-gallery .main-image img,
[data-theme="light"] .thumb,
[data-theme="light"] .thumbnail-row img,
[data-theme="light"] #thumbnailRow img {
    border: 2px solid var(--text-faintest) !important;
}