/* --- Product Page Styles --- */

:root {
    --primary-green: #4da93c;
    --dark-green: #3d8b2f;
    --link-blue: #2a6fb6;
    --text-dark: #222222;
    --text-gray: #555555;
    --star-color: #f59e0b;
    --bg-light-blue: #f2f7fc;
    --bg-gray: #f9f9f9;
    --border-color: #e0e0e0;
}

.product-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- TOP SECTION GRID --- */
.product-top {
    display: grid;
    grid-template-columns: 450px 1fr 380px;
    gap: 50px;
    margin-bottom: 60px;
    align-items: start;
}

/* Image Gallery */
.gallery {
    position: relative;
    display: flex;
}

.gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-right: 20px;
}

.thumb {
    width: 70px;
    height: 70px;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s ease;
}

.thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumb.active {
    border: 2px solid #333;
    transform: translateY(-1px);
}

.thumb:hover {
    border-color: #6b7280;
    transform: translateY(-1px);
}

.main-image {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: visible;
    cursor: zoom-in;
}

.main-image img {
    width: 100%;
    max-width: 400px;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.image-zoom-pane {
    display: none;
    position: absolute;
    left: calc(100% + 18px);
    top: 0;
    width: 340px;
    height: 340px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    z-index: 5;
}

.image-zoom-pane.active {
    display: block;
}

.image-zoom-pane img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(2);
    transform-origin: center;
}

/* Product Info Center */
.product-details h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--text-dark);
}

.brand-line {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.brand-line a {
    color: var(--link-blue);
}

.rating-stars {
    color: var(--star-color);
    font-size: 14px;
    margin: 0 5px;
}

.rating-count {
    color: var(--link-blue);
}

.rating-value {
    font-weight: 600;
    color: var(--text-dark);
    margin-left: 5px;
}

.stock-status {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.stock-status.in-stock {
    color: var(--primary-green);
}

.stock-status.out-of-stock {
    color: #dc2626;
}

.stock-status i {
    margin-right: 8px;
    font-size: 16px;
}

.why-buy {
    margin-top: 20px;
}

.why-buy h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.why-buy ul {
    list-style: none;
}

.why-buy li {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-dark);
    display: flex;
    align-items: flex-start;
}

.why-buy li i {
    color: var(--primary-green);
    margin-right: 12px;
    margin-top: 4px;
    font-size: 14px;
}

.description-link {
    display: inline-block;
    margin-top: 15px;
    font-size: 14px;
    border-bottom: 1px dotted var(--link-blue);
    color: var(--link-blue);
}

/* Buy Box Right */
.buy-box {
    border: 1px solid #ddd;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.price-row {
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.price {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-dark);
}

.original-price {
    font-size: 18px;
    color: #888;
    text-decoration: line-through;
}

.return-info {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 25px;
    display: block;
}

.preference-picker {
    margin-bottom: 14px;
}

.preference-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.preference-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preference-option {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.preference-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.preference-option.selected {
    border-color: #1d4ed8;
    background: #eff6ff;
}

.preference-option.disabled {
    border-color: #e5e7eb;
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.buy-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.qty-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 44px;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #e0e0e0;
}

.qty-btn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.qty-btn:disabled:hover {
    background: #f3f4f6;
}

.qty-input {
    width: 50px;
    height: 44px;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* View Cart Button - shown when product is in cart */
.view-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    background: var(--primary-blue, #3467ce);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.view-cart-btn:hover {
    background: var(--dark-blue, #0f1e4f);
}

.view-cart-btn i {
    font-size: 16px;
}

.stock-warning {
    background: none;
    color: #b45309;
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    margin-top: 10px;
    margin-bottom: 0;
    display: block;
}

.stock-warning i {
    display: none;
}

.add-btn {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    flex-grow: 1;
    transition:
        background 0.2s,
        transform 0.1s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.add-btn:hover {
    background-color: var(--dark-green);
}

.add-btn:active {
    transform: translateY(1px);
}

.add-btn.out-of-stock-btn,
.add-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.add-btn.out-of-stock-btn:hover,
.add-btn:disabled:hover {
    background: #9ca3af;
}

.delivery-meta {
    font-size: 13px;
    color: var(--text-gray);
    border-top: 1px solid #eee;
    padding-top: 15px;
    line-height: 1.8;
}

.delivery-meta strong {
    color: var(--text-dark);
}

/* --- SECTIONS COMMON --- */
.section-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 30px;
    margin-top: 60px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-gray);
}

/* --- DESCRIPTION SECTION --- */
.desc-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
}

.desc-text h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
}

.desc-text p {
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 15px;
    line-height: 1.7;
}

.desc-text h4 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 700;
    margin-top: 25px;
}

.desc-text ul {
    list-style-type: disc;
    padding-left: 25px;
    margin-bottom: 20px;
}

.desc-text ol {
    list-style-type: decimal;
    padding-left: 25px;
    margin-bottom: 20px;
}

.desc-text li {
    margin-bottom: 8px;
    font-size: 15px;
}

.desc-text li[data-list="bullet"] {
    list-style-type: disc;
}

.desc-text img {
    max-width: 320px;
    width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
    object-fit: contain;
}

.details-table-container h4 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 700;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.details-table tr:nth-child(odd) {
    background-color: var(--bg-light-blue);
}

.details-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.details-table td:first-child {
    font-weight: 700;
    width: 30%;
    color: var(--text-dark);
}

.details-table td:last-child {
    color: var(--link-blue);
}

.details-table td:last-child span {
    color: var(--text-dark);
}

/* --- REVIEWS SECTION --- */
.review-summary-box {
    background-color: var(--bg-gray);
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.histogram-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 15px;
    flex-wrap: wrap;
}

.verified-badge {
    color: var(--primary-green);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.review-form-alerts {
    margin-bottom: 14px;
}

.review-alert {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-alert.success {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.review-alert.error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.review-form-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 22px;
}

.review-form-box h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.review-form-note {
    font-size: 13px;
    color: var(--text-gray);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.review-form-note a {
    color: var(--link-blue);
    font-weight: 600;
}

.review-form {
    display: grid;
    gap: 12px;
}

.review-form-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 12px;
}

.review-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.review-form-group .required {
    color: #dc2626;
}

.review-form-group select,
.review-form-group input,
.review-form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.review-form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.btn-review-submit {
    justify-self: flex-start;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-review-submit:hover {
    background: #1d4ed8;
}

.review-verification {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

.review-verification.verified {
    color: var(--primary-green);
}

.review-edited-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.overall-rating {
    margin-bottom: 15px;
    font-size: 15px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.star-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.star-label {
    width: 35px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.star-icon {
    color: var(--star-color);
    font-size: 12px;
}

.bar-container {
    flex-grow: 1;
    height: 12px;
    background-color: #fff;
    margin-right: 15px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bar-fill {
    height: 100%;
    background-color: #e67e22;
}

.review-count {
    width: 80px;
    text-align: right;
    color: var(--text-dark);
}

/* Highest Rated Review */
.featured-review {
    background: #fff;
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.featured-header {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 15px;
}

.featured-content {
    display: flex;
    gap: 30px;
}

.featured-meta {
    font-size: 13px;
    min-width: 120px;
    line-height: 1.8;
}

.featured-text {
    font-size: 15px;
    color: var(--text-dark);
    font-style: italic;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0;
}

.filter-title {
    font-weight: 700;
    font-size: 16px;
}

.sort-controls {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-controls select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    font-size: 14px;
    border-radius: 4px;
    background: #fff;
}

/* Review List */
.review-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    padding: 30px 20px;
    border-bottom: 1px solid #eee;
}

.review-item:nth-child(odd) {
    background-color: var(--bg-light-blue);
}

.review-item:nth-child(even) {
    background-color: #fff;
}

.review-meta {
    font-size: 13px;
    line-height: 1.8;
}

.review-meta strong.author {
    display: block;
    font-size: 14px;
    margin: 8px 0 4px;
    color: #000;
}

.sold-by-link {
    color: var(--link-blue);
    font-weight: 600;
}

.review-body {
    font-size: 15px;
    color: var(--text-dark);
    padding-left: 20px;
    line-height: 1.6;
}

/* No Reviews */
.no-reviews {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.no-reviews i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 50px 0;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-dark);
}

.page-link.active {
    background-color: var(--link-blue);
    color: white;
    font-weight: bold;
}

.page-link:hover:not(.active) {
    background-color: #f0f0f0;
    text-decoration: none;
}

.page-arrow {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--link-blue);
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    text-decoration: none;
}

.page-arrow:hover {
    border-color: var(--link-blue);
    color: #fff;
    background: var(--link-blue);
    text-decoration: none;
}

/* Recommended Section */
.recommended-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .product-top {
        grid-template-columns: 400px 1fr;
        gap: 40px;
    }

    .buy-box {
        position: static;
        grid-column: 1 / -1;
        max-width: 500px;
    }

    .image-zoom-pane {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .product-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .gallery {
        flex-direction: column-reverse;
    }

    .gallery-thumbs {
        flex-direction: row;
        margin-right: 0;
        margin-top: 15px;
    }

    .main-image img {
        max-width: 100%;
    }

    .buy-box {
        max-width: 100%;
    }

    .desc-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .review-summary-box {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .review-form-row {
        grid-template-columns: 1fr;
    }

    .review-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .review-body {
        padding-left: 0;
    }
}

@media (max-width: 600px) {
    .product-container {
        padding: 20px 15px;
    }

    .product-details h1 {
        font-size: 22px;
    }

    .price {
        font-size: 32px;
    }

    .buy-actions {
        flex-direction: column;
    }

    .qty-select {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .featured-content {
        flex-direction: column;
        gap: 15px;
    }
}
