/* =========================================
   PRODUCT DETAIL PAGE - COMPACT & CLEAN
   ========================================= */

.product-detail-page {
    background-color: #fff;
    padding: 30px 0;
    /* Reduced padding */
}

.container-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* --- Layout Grid --- */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Balanced 50/50 split */
    gap: 40px;
    /* Standard gap */
    margin-bottom: 50px;
}

/* --- Gallery Section --- */
.photo-gallery {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 4px;
    width: 80px;
    /* Fixed width for consistency */
    flex-shrink: 0;
}

.thumbnails::-webkit-scrollbar {
    width: 4px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #fff;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #ff6b00;
}

.main-image-container {
    flex: 1;
    text-align: center;
    position: relative;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    height: 500px;
    /* Fixed container height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.zoom-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    font-size: 12px;
    color: #999;
}

/* --- Zoom Modal --- */
.zoom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
}

.zoom-modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* --- Product Information --- */
.product-info-section {
    padding: 0 10px;
}

.product-name {
    font-size: 28px;
    /* Standard H1 */
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #111;
}

.product-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.product-meta strong {
    color: #333;
}

.product-pricing {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-label {
    font-size: 14px;
    color: #555;
}

.price-old {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.price-current {
    font-size: 32px;
    /* Adequately large but not huge */
    font-weight: 700;
    color: #ce0000;
    /* Standard red/orange for price */
}

.stock-badge {
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #008000;
}

.stock-badge.out-stock {
    color: #cc0000;
}

.quantity-section {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 16px;
}

.qty-btn:hover {
    background-color: #eee;
}

.qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 15px;
}

.btn-add-cart {
    width: 100%;
    max-width: 300px;
    /* Don't stretch infinitely */
    padding: 14px;
    background-color: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-add-cart:hover {
    background-color: #e55e00;
}

/* --- Description & Specs --- */
.product-description {
    margin-bottom: 50px;
}

.product-description h2,
.technical-data h2,
.reviews-section h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.description-content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.tech-reviews-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.specs-table td:first-child {
    font-weight: 600;
    width: 40%;
    color: #555;
    background: #fdfdfd;
}

/* --- Reviews --- */
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.reviews-header h2 {
    border-bottom: none;
    margin: 0;
    padding: 0;
}

.btn-write-review {
    font-size: 14px;
    padding: 8px 20px;
    color: #fff;
    background: #ff6b00;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(255, 107, 0, 0.2);
}

.btn-write-review:hover {
    background: #e55e00;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.3);
}

/* Average Rating Box */
.average-rating {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.rating-number {
    font-size: 48px;
    font-weight: 800;
    color: #333;
    line-height: 1;
}

.average-rating .stars {
    font-size: 24px;
    color: #ffc107;
    /* Gold */
    margin: 5px 0 10px;
}

.rating-text {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Review List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-card {
    background: #fff;
    padding: 25px;
    border: 1px solid #eee;
    border-radius: 12px;
    /* Smoother corner */
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.review-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* Hover lift */
    transform: translateY(-2px);
    border-color: transparent;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.review-header strong {
    font-size: 16px;
    color: #1a1a1a;
}

.review-stars {
    color: #ffc107;
    /* Gold stars */
    font-size: 14px;
}

.review-date {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

.review-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333;
}

.review-text {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #28a745;
    background: #e6f9e6;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 15px;
    font-weight: 600;
}

/* No Reviews State */
.no-reviews-container {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-reviews {
    color: #666;
    font-size: 15px;
    margin-bottom: 20px;
}

.btn-write-review-large {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid #ff6b00;
    color: #ff6b00;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-write-review-large:hover {
    background: #ff6b00;
    color: #fff;
}

/* Purchase Required Message */
.purchase-required-msg {
    font-size: 13px;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.purchase-required-msg i {
    font-size: 14px;
}


/* =========================================
   RESPONSIVE
   ========================================= */

/* Prevent horizontal scroll on all screens */
.product-detail-page {
    overflow-x: hidden;
}

.container-product {
    overflow: hidden;
}

/* Tablet (Portrait) & Mobile (< 992px) */
@media (max-width: 992px) {

    .product-layout,
    .tech-reviews-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Move gallery below image and make horizontal */
    .photo-gallery {
        flex-direction: column-reverse;
        overflow: hidden;
    }

    .thumbnails {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 0;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .thumbnail {
        width: 65px;
        min-width: 65px;
        height: 65px;
        flex-shrink: 0;
    }

    .main-image-container {
        height: 400px;
    }

    .product-name {
        font-size: 22px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Mobile Small (< 576px) */
@media (max-width: 576px) {
    .product-detail-page {
        padding: 15px 0;
    }

    .container-product {
        padding: 0 15px;
    }

    .product-name {
        font-size: 20px;
    }

    .price-current {
        font-size: 26px;
    }

    .main-image-container {
        height: 280px;
    }

    .thumbnail {
        width: 55px;
        min-width: 55px;
        height: 55px;
    }

    .btn-add-cart {
        max-width: 100%;
    }

    .product-info-section {
        padding: 0;
    }
}