﻿/* ========= Page container ========= */
.product-details-container {
    margin: 2rem auto;
    max-width: 1200px;
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* ========= Main image wrapper ========= */
.main-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #fff;
    cursor: zoom-in;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex; /* center main image */
    align-items: center;
    justify-content: center;
    
}

    /* make the main image keep aspect ratio and center */
    .main-image-wrapper img.main-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
        transition: transform 0.05s ease-out;
    }

/* ========= Magnifying glass (lens) ========= */
/* lens container */
.zoom-lens {
    position: absolute;
    pointer-events: none; /* avoid interfering with mouse events on image */
    border: 2px solid rgba(13,110,253,0.95);
    background: rgba(255,255,255,0.02);
    .zoom-lens
    width: auto; 
    height: auto; 
    border-radius: 6px; /* square with slight rounding; change to 50% for circle */
    overflow: hidden;
    display: none; /* shown on hover/mouseenter */
    z-index: 9999;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    /* keep zoomed image centered inside */
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* the zoomed image inside the lens */
    .zoom-lens img {
        position: absolute;
        top: 0;
        left: 0;
        -webkit-user-drag: none;
        user-select: none;
        pointer-events: none;
    }

/* ========= Zoom result (if your theme still uses it elsewhere) ========= */
/* keep but hidden — lens is preferred */
.zoom-result {
    display: none;
}

/* ========= Thumbnails (kept as you have them) ========= */
.thumbnail-images {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto; /* scroll if more than 4 */
    white-space: nowrap;
    padding-bottom: 5px;
    scrollbar-width: thin;
}

    .thumbnail-images::-webkit-scrollbar {
        height: 6px;
    }

    .thumbnail-images::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

    .thumbnail-images::-webkit-scrollbar-track {
        background: transparent;
    }

    .thumbnail-images img.thumbnail-img {
        flex: 0 0 auto;
        width: 60px !important;
        height: 60px !important;
        object-fit: cover;
        border: 2px solid transparent;
        border-radius: 6px;
        cursor: pointer;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .thumbnail-images img.thumbnail-img.active,
        .thumbnail-images img.thumbnail-img:hover {
            border-color: #0d6efd;
            box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
        }

/* ========= Info column ========= */
.product-title {
    font-weight: 700;
    font-size: 2.15rem;
    margin-bottom: .75rem;
    color: #2d4c2f;
    text-align: center;
}

.price-section {
    margin-bottom: .75rem;
    text-align: center;
}

    .price-section .original-price {
        font-size: 1.15rem;
        color: #888;
        text-decoration: line-through;
        margin-right: 8px;
    }

    .price-section .discounted-price {
        font-size: 1.6rem;
        color: #4caf50;
        font-weight: 700;
    }

    .price-section .badge {
        font-size: .95rem;
        vertical-align: middle;
    }

.stock-status {
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

/* ========= Quantity selector ========= */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 1rem 0 1.5rem;
    justify-content: center;
}

    .quantity-selector label {
        font-weight: 600;
        min-width: 70px;
        margin: 0;
    }

    .quantity-selector .btn-qty-change {
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
        padding: 0;
        text-align: center;
        line-height: 1;
    }

.qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 1.15rem;
}

/* ========= Action buttons ========= */
.action-buttons {
    margin-bottom: 2rem;
}

    .action-buttons button {
        min-width: 140px;
        padding: .6rem 1.25rem;
        font-size: 1.05rem;
    }

/* ========= Description & specs ========= */
.product-short-description {
    margin-bottom: 2rem;
}

.product-specifications {
    border-top: 1px solid #e6e6e6;
    padding-top: 1rem;
}

    .product-specifications h5 {
        font-weight: 700;
        margin-bottom: 1rem;
    }

    .product-specifications table th {
        width: 180px;
        background: #f0f9f0;
    }

/* ========= Related products ========= */
.related-products {
    margin-top: 3rem;
}

.related-products-title {
    font-weight: 700;
    margin-bottom: .5rem;
    color: #2d4c2f;
    text-align: center;
}

.related-products-underline {
    border: none;
    border-bottom: 2px solid #4caf50;
    width: 100%;
    margin: 0 0 1.25rem 0;
}

.product-details-container #relatedProductsContainer .card {
    background-color: #f8fff4;
    border: 1px solid #c2e1c2;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(60, 80, 60, 0.1);
    transition: transform 0.2s ease;
    text-align: center;
    height: 100%;
}

    .product-details-container #relatedProductsContainer .card:hover {
        transform: translateY(-2px);
    }

    .product-details-container #relatedProductsContainer .card img {
        width: 100%;
        height: 150px;
        object-fit: contain;
        margin-bottom: .5rem;
    }

    .product-details-container #relatedProductsContainer .card .card-title {
        font-weight: 700;
        color: #2d4c2f;
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: .5rem;
    }

.product-details-container #relatedProductsContainer .text-success.fw-bold {
    color: #4caf50 !important;
}

/* ========= Responsive adjustments ========= */
@media (max-width: 992px) {
    .product-title {
        font-size: 1.9rem;
    }

    .price-section .discounted-price {
        font-size: 1.45rem;
    }
}

@media (max-width: 768px) {
    .product-title {
        font-size: 1.75rem;
    }

    .quantity-selector .btn-qty-change {
        width: 30px;
        height: 30px;
        font-size: 1.15rem;
    }

    .product-details-container {
        padding: 1rem;
    }

    /* smaller lens on small screens */
    .zoom-lens {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 1.55rem;
    }

    .product-details-container {
        padding: 1rem;
        margin: 1rem;
    }

        .product-details-container #relatedProductsContainer .card img {
            height: 120px;
        }

    .zoom-lens {
        width: 70px;
        height: 70px;
    }
}
