﻿/* Product Detail Page Styles - Adapted from modal styles */
#product-details-container {
    max-width: 1500px;
    margin: 0 auto 1rem auto;
}

.product-detail-header {
    margin: 1.5rem 0 1rem 0;
}

    .product-detail-header h1 {
        font-size: 1.55rem;
        font-weight: 600;
        color: #333;
        margin-bottom: 0.55rem;
    }

.product-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-top: 0.5rem;
}

.product-detail-content {
    background-color: #fff;
    margin-bottom: 2rem;
    padding: 2rem;
}



.product-caveat {
    padding: 0 1rem 0 0rem;
    margin-top: 0.5rem;
}

    .product-caveat p {
        font-size: 1rem;
        line-height: 1.5;
        color: #856404;
        background-color: #fff3cd;
        border: 1px solid #ffeaa7;
        border-radius: 4px;
        padding: 10px 15px;
        margin: 0;
    }

    .product-caveat strong {
        color: #856404;
    }

/* Back Button */
.back-to-results {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #4F7942;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
}

    .back-to-results i {
        margin-right: 0.5rem;
    }

    .back-to-results:hover {
        color: #ec1c24;
        text-decoration: none;
    }

/* Product Top Section */
.product-top-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
}

.product-image-column {
    width: 30%;
    flex: 0 0 30%;
    box-sizing: border-box;
}

.product-desc-column {
    width: 70%;
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
}

.product-image-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid #e9ecef;
}

    .product-image-container img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.product-description {
    padding: 0 1rem 0 0rem;
}

    .product-description p {
        font-size: 1.1rem;
        line-height: 1.6;
        color: #333;
    }

.components h3 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    padding-bottom: 5px;
}

.component-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.component-card {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

    .component-card:hover {
        border-color: #dee2e6;
        background-color: #e9ecef;
    }

.component-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.component-model {
    font-size: 13px;
    color: #666;
}

/* Capacity Cards - Fix for overflow */
.capacity-cards {
    padding-top: 1rem;
    margin-top: auto;
    padding-top: 15px;
    display: flex;
}

.capacity-card {
    display: flex;
    align-items: center;
    margin-right: 20px;
    padding: 7px 12px;
    background-color: #f9f9f9;
    border: 1px solid #eeeeee;
}

.capacity-label {
    font-size: 15px;
    font-weight: 500;
    margin-right: 4px;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.room-size-text {
    font-size: 14px;
    color: #6c757d
}

.cooling-capacity .capacity-label, .cooling-capacity .capacity-value {
    color: #3b82f6;
}

.heating-capacity .capacity-label, .heating-capacity .capacity-value {
    color: #ef4444;
}

.airflow-capacity .capacity-label, .airflow-capacity .capacity-value {
    color: #10b981;
}

.capacity-value {
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Variant Sections */
.product-detail-content .variants-section {
    margin: 0 -2rem;
    padding: 1rem 2.5rem;
    background-color: #6c757d1f;
    padding-top: 2rem;
}

.variant-section:first-of-type {
    border-top: 1px solid #e9ecef;
}

.variant-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    cursor: pointer;
}

    .radio-option:hover {
        background-color: #f8f9fa;
    }

    .radio-option.active {
        background-color: #e7f1ff;
        border-color: #007bff;
        border-width: 2px;
    }

    .radio-option input[type="radio"] {
        margin-right: 10px;
    }

    .radio-option.disabled {
        opacity: 0.65;
        cursor: not-allowed;
        pointer-events: none;
        background-color: #f1f1f1;
        border-color: #d0d0d0;
    }

/* Specifications Section */
.spec-export-options .dropdown {
    margin-right: .5rem;
}


.product-full-specs {
    margin-top: 30px;
    border-top: 1px solid #e9ecef;
    padding-top: 25px;
}

.spec-section {
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.spec-section-header {
    background-color: #e6f0ff;
    color: #333;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 1px solid #c9d4e6;
    font-size: 17px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

    .specs-table tr {
        display: flex;
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }

        .specs-table tr:last-child {
            border-bottom: none;
        }

        .specs-table tr:nth-child(odd) {
            background-color: #f8f9fa;
        }

        .specs-table tr:nth-child(even) {
            background-color: #ffffff;
        }

    .specs-table td {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 10px 15px;
        box-sizing: border-box;
        position: relative;
    }

        .specs-table td:first-child {
            border-right: 2px solid #e9ecef;
        }

.spec-cell {
    display: flex;
    align-items: baseline;
    padding: 4px 0;
    box-sizing: border-box;
}

.spec-name {
    font-weight: 500;
    font-size: 16px;
    color: #495057;
    width: 40%;
    margin-right: 10px;
    position: relative;
    padding-left: 15px;
}

    .spec-name::before {
        content: "■";
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        color: #00000087;
        font-size: 10px;
    }

.spec-value {
    font-size: 15.5px;
    color: #212529;
    width: 60%;
    font-weight: 600;
}

.spec-subheader-row {
    background-color: #f0f5ff;
    padding: 10px 15px;
    font-weight: 600;
    color: #334155;
    border-radius: 0;
    font-size: 15px;
    letter-spacing: 0.5px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    display: block;
    border-bottom: 1px solid #c9d4e6;
    border-top: 1px solid #c9d4e6;
}

/* Notes List Styling */
.spec-notes-list {
    padding: 15px 20px;
    background-color: #fff;
}

    .spec-notes-list ol {
        margin: 0;
        padding-left: 20px;
        list-style-type: decimal;
    }

    .spec-notes-list li {
        font-size: 16.5px;
        font-weight: 500;
        color: #212529;
        line-height: 1.6;
        margin-bottom: 8px;
        padding-left: 5px;
    }

        .spec-notes-list li:last-child {
            margin-bottom: 0;
        }

/* Image Zoom Functionality */
.image-zoom-link {
    display: block;
    position: relative;
    cursor: zoom-in;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgb(0 0 0);
    color: white;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s;
    will-change: opacity;
}

.image-zoom-link:hover .zoom-indicator {
    opacity: 1;
}

.image-zoom-link:hover img {
    transform: scale(1.03);
    transition: transform 0.2s ease;
    will-change: transform;
}

/* Fullscreen Image Modal */
.fullscreen-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.2s ease;
    will-change: opacity;
    pointer-events: auto;
}

    .fullscreen-image-modal.active {
        opacity: 1;
    }

.fullscreen-image-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.fullscreen-image-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    padding: 20px;
    box-sizing: border-box;
}

.fullscreen-image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    transform: translateZ(0); /* Force GPU acceleration */
}

.fullscreen-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    width: auto;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    will-change: transform, opacity;
    margin: 0 auto;
    transform-origin: center center;
}

.fullscreen-image-modal.active .fullscreen-image {
    transform: scale(1);
    opacity: 1;
}

.fullscreen-image-close {
    position: absolute;
    top: -22px;
    right: -22px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #666;
    color: white;
    font-size: 25px;
    cursor: pointer;
    z-index: 2002;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s;
    padding: 0;
    margin: 0;
}

    .fullscreen-image-close:hover {
        color: #de1919;
    }


/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 30px;
    text-align: center;
}

    .loading-spinner i {
        color: #007bff;
        margin-bottom: 15px;
    }

    .loading-spinner p {
        font-size: 1.1rem;
        color: #666;
    }

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 30px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    display: none;
    z-index: 1000;
    animation: slideIn 0.5s, fadeOut 0.5s 2.5s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

    .toast-notification.show {
        display: flex;
        align-items: center;
    }

    .toast-notification i {
        margin-right: 10px;
        color: #4CAF50;
    }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

    .error-message h2 {
        color: #dc3545;
        margin-bottom: 15px;
    }

    .error-message p {
        color: #6c757d;
        margin-bottom: 20px;
    }

/* Related Products Section */
.related-products {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.related-products-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

    .products-grid .product-card {
        border: 1px solid #e9ecef;
        border-radius: 8px;
        overflow: hidden;
        background-color: white;
        transition: all 0.3s ease;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        height: 100%;
        display: flex;
        flex-direction: column;
        cursor: pointer;
        text-decoration: none;
        color: inherit;
    }

        .products-grid .product-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 15px rgba(0,0,0,0.1);
            border-color: #007bff;
        }

.product-card .product-image-container {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.product-card .product-title {
    margin: 0;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #343a40;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.4;
}

.product-card .product-key-specs {
    padding: 12px 15px;
    flex-grow: 1;
}

.product-card .spec-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
    margin-bottom: 8px;
}

.product-card .spec-label {
    font-weight: 500;
    color: #6c757d;
    margin-right: 10px;
}

.product-card .spec-item.cooling {
    color: #2b4bdbbd;
}

.product-card .spec-item.heating {
    color: #cc1e1eb8;
}

.product-card .spec-item.airflow {
    color: #10b981bd;
}

/* Room size filter */
.filter-container {
    margin-bottom: 1.5rem;
}

.filter-label {
    font-weight: 500;
    margin-right: 10px;
}

#room-size-filter {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    min-width: 180px;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .product-top-section {
        flex-direction: column;
    }

    .product-image-column,
    .product-desc-column {
        width: 100%;
        flex: 0 0 100%;
    }

    .product-image-column {
        margin-bottom: 30px;
    }

    .component-cards {
        flex-wrap: wrap;
    }

    .component-card {
        min-width: 45%;
    }

    .capacity-cards {
        flex-wrap: wrap;
    }

    .capacity-card {
        min-width: 45%;
    }

    .radio-option {
        min-width: 45%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0px !important;
        padding-right: 0px !important;
    }

    .product-detail-content {
        padding: .5rem;
    }

    .product-image-container {
        height: 300px;
    }

    .component-card,
    .capacity-card {
        min-width: 100%;
    }

    .radio-option {
        min-width: 100%;
    }

    .specs-table tr {
        flex-wrap: wrap;
    }

    .specs-table td {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 8px 10px;
        border-right: none !important;
    }

        .specs-table td:first-child {
            border-bottom: 1px solid #e9ecef;
        }

    .product-actions {
        flex-direction: column;
    }

        .product-actions .enquiry-btn,
        .product-actions .usefilters-btn {
            width: 100%;
            justify-content: center;
        }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .product-detail-header h1 {
        padding: 0 .5rem 0 .5rem;
        font-size: 1.5rem;
    }

    .product-subtitle {
        padding: 0 .5rem 0 .5rem;
    }

    .product-detail-content {
        padding: 20px 15px;
    }

    .product-top-section{
        gap:0px;
    }

    .product-image-container {
        height: 250px;
    }

    .spec-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .spec-name,
    .spec-value {
        width: 100%;
    }

    .spec-export-options {
        display: none;
    }

    .spec-name {
        padding-left: 0px;
        margin-bottom: 4px;
    }

        .spec-name:before {
            content: '';
        }

    .fullscreen-image-close {
        top: 10px;
        right: 10px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}
