/*----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------- PRODUCT DETAILS --------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800&display=swap');

* {
/*
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
*/
}

body {
    line-height: 1.5;
}

/* Fix promo block first */
.g-bg-position--center.js__parallax-window.s-promo-block-v4.about-promo-block {
    background-attachment: scroll !important;
    position: relative !important;
    z-index: 1;
}

/* This one is product information at the bottom */
.product-detail-wrapper .container {
    width: 100%;
    max-width: 1440px; /* Adjust based on your design */
    padding: 2rem 1.5rem 2rem 1.5rem;
    margin: 0 auto; /* Centers the container */
    margin-bottom: 3rem;
}

.product-detail-wrapper .card-wrapper {
    margin: 0 auto;
}

.product-detail-wrapper img {
    width: 100%;
    display: block;
}

/* Card layout - FIXED: Added gap property */
.product-detail-wrapper .card {
    display: flex;
    gap: 30px; /* CRITICAL: This was missing */
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    align-items: flex-start;
}

.product-detail-wrapper .product-imgs {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-detail-wrapper .product-content {
    flex: 0 0 30%;
    position: sticky;
    top: 20px;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}

/* Image display */
.product-detail-wrapper .img-display {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 300px;
}

.product-detail-wrapper .img-showcase {
    width: auto;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-detail-wrapper .img-showcase img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 600px;
    display: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-detail-wrapper .img-showcase img.active {
    display: block;
}

/* Thumbnail selectors */
.product-detail-wrapper .img-select {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

.product-detail-wrapper .img-item {
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 5 / 3; /* Perfect square */
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
    padding: 0; /* REMOVE padding - this was causing space */
    overflow: hidden; /* Hide any image overflow */
}

/* Make images cover the entire thumbnail */
.product-detail-wrapper .img-item img {
    width: 100%; /* Fill entire width */
    height: 100%; /* Fill entire height */
    object-fit: cover; /* This is the key - covers the whole area */
    border-radius: 4px;
    transition: transform 0.3s ease;
    display: block;
    max-height: none; /* Remove any height restrictions */
}

/* Ensure the link fills the entire thumbnail */
.product-detail-wrapper .img-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-detail-wrapper .img-item:hover {
    border-color: #ddd;
    background: #f0f4f8;
}

.product-detail-wrapper .img-item.active {
    border-color: #007bff;
    background: #f0f7ff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.product-detail-wrapper .img-item:hover img {
    transform: scale(1.08);
}

/* Placeholder styling */
.product-detail-wrapper .img-item:not(:has(img[src*="default.jpg"])) {
    background: linear-gradient(45deg, #f8f9fa 25%, #e9ecef 25%, #e9ecef 50%, #f8f9fa 50%, #f8f9fa 75%, #e9ecef 75%);
    background-size: 20px 20px;
}

/* For placeholder images, center them but still cover */
.product-detail-wrapper .img-item img[src*="default.jpg"] {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    background: linear-gradient(45deg, #f8f9fa 25%, #e9ecef 25%, #e9ecef 50%, #f8f9fa 50%, #f8f9fa 75%, #e9ecef 75%);
    background-size: 20px 20px;
}

/* Product content styles */
.product-detail-wrapper .product-title {
    font-size: 3rem;
    text-transform: capitalize;
    font-weight: 700;
    position: relative;
    color: #12263a;
    margin: 1rem 0;
}

.product-detail-wrapper .product-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 80px;
    background: #12263a;
}

.product-detail-wrapper .product-link {
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    background: #256eff;
    color: #fff;
    padding: 0 0.3rem;
    transition: all 0.5s ease;
}

.product-detail-wrapper .product-link:hover {
    opacity: 0.9;
}

.product-detail-wrapper .product-rating {
    color: #ffc107;
}

.product-detail-wrapper .product-rating span {
    font-weight: 600;
    color: #252525;
}

.product-detail-wrapper .product-price {
    margin: 1rem 0;
    font-size: 1rem;
    font-weight: 700;
}

.product-detail-wrapper .product-price span {
    font-weight: 400;
}

.product-detail-wrapper .last-price span {
    color: #f64749;
    text-decoration: line-through;
}

.product-detail-wrapper .new-price span {
    color: #256eff;
}

.product-detail-wrapper .product-detail h2 {
    text-transform: capitalize;
    color: #12263a;
    padding-bottom: 0.6rem;
}

.product-detail-wrapper .product-detail p {
    font-size: 0.9rem;
    padding: 0.3rem;
    opacity: 0.8;
}

.product-detail-wrapper .product-detail ul {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.product-detail-wrapper .product-detail ul li {
    list-style: none;
    background: url(https://fadzrinmadu.github.io/hosted-assets/product-detail-page-design-with-image-slider-html-css-and-javascript/checked.png) left center no-repeat;
    background-size: 18px;
    padding-left: 1.7rem;
    margin: 0.4rem 0;
    font-weight: 600;
    opacity: 0.9;
}

.product-detail-wrapper .alert{
    padding-left: 0px;
}

.product-detail-wrapper .btn-primary {
    background-color: #9ACD32;
    border-color: #9ACD32;
    cursor: pointer;                  /* pointer on hover */
    transition: all 0.3s ease-in-out; /* smooth animation */
}

/* Hover effect */
.product-detail-wrapper .btn-primary:hover {
    transform: scale(1.05);           /* grows slightly */
    background-color: #8FBC2A;        /* a little darker green */
    border-color: #8FBC2A;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* soft shadow */
}

.product-detail-wrapper .product-detail ul li span {
    font-weight: 400;
}

.product-detail-wrapper .purchase-info {
    margin: 1.5rem 0;
}

.product-detail-wrapper .purchase-info input,
.product-detail-wrapper .purchase-info .btn {
    border: 1.5px solid #ddd;
    border-radius: 25px;
    text-align: center;
    padding: 0.45rem 0.8rem;
    outline: 0;
    margin-right: 0.2rem;
    margin-bottom: 1rem;
}

.product-detail-wrapper .purchase-info input {
    width: 60px;
}

.product-detail-wrapper .purchase-info .btn {
    cursor: pointer;
    color: #fff;
}

.product-detail-wrapper .purchase-info .btn:first-of-type {
    background: #256eff;
}

.product-detail-wrapper .purchase-info .btn:last-of-type {
    background: #f64749;
}

.product-detail-wrapper .purchase-info .btn:hover {
    opacity: 0.9;
}


/* Remove overflow: hidden and use these responsive constraints instead */
.container.product-detail-wrapper {
    width: 100%;
    max-width: 1440px;
    padding: 3rem .5rem 2rem .5rem;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: #fff;
    /* REMOVE overflow: hidden */
}

/* Make all content flexible and responsive */
.product-detail-wrapper * {
    box-sizing: border-box; /* Essential for proper sizing */
}

/* Flexible images that scale down */
.product-detail-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive text that scales */
.product-detail-wrapper .product-title {
    font-size: 1.4rem; /* Scales between 2rem and 3rem */
    line-height: 1.2;
    word-wrap: break-word;
}

.product-detail-wrapper .product-detail p {
    font-size: clamp(0.8rem, 2vw, 0.9rem); /* Responsive font size */
}

/* Flexible grid for thumbnails */
.product-detail-wrapper .img-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* Flexible columns */
    gap: 12px;
    width: 100%;
}

/* Flexible card layout */
.product-detail-wrapper .card {
    display: flex;
    gap: 30px;
    max-width: 100%; /* Ensure it doesn't exceed wrapper */
    margin: 0 auto;
    padding: 20px;
    align-items: flex-start;
    flex-wrap: wrap; /* Allow wrapping if needed */
}

.product-detail-wrapper .product-imgs {
    flex: 1 1 600px; /* Flexible basis, can grow/shrink */
    min-width: 300px; /* Minimum width before wrapping */
}

.product-detail-wrapper .product-content {
    flex: 1 1 300px; /* Flexible basis, can grow/shrink */
    min-width: 250px; /* Minimum width before wrapping */
    position: sticky;
    top: 20px;
}

/* Responsive tables/lists */
.product-detail-wrapper table {
    width: 100%;
    table-layout: fixed; /* Prevents table from overflowing */
}

.product-detail-wrapper ul, 
.product-detail-wrapper ol {
    width: 100%;
}

/* Form elements that scale */
.product-detail-wrapper input,
.product-detail-wrapper textarea,
.product-detail-wrapper select {
    width: 100%;
    max-width: 100%;
}

/* Emergency wrap protection for very small screens */
@media (max-width: 480px) {
    .product-detail-wrapper .card {
        flex-direction: column; /* Stack on very small screens */
    }
    
    .product-detail-wrapper .product-imgs,
    .product-detail-wrapper .product-content {
        min-width: 100%; /* Full width on mobile */
        flex: 1 1 100%;
    }
}

/* Responsive design */
@media (max-width: 992px) {
    .product-detail-wrapper .card {
        flex-direction: column;
        gap: 20px;
    }
    
    .product-detail-wrapper .product-imgs,
    .product-detail-wrapper .product-content {
        flex: 0 0 100%;
        width: 100%;
        position: static;
    }
    
    .product-detail-wrapper .img-showcase img {
        max-height: 500px;
    }
    
    .product-detail-wrapper .img-item img {
        max-height: 70px;
    }
}

@media (max-width: 768px) {
    .product-detail-wrapper .img-display {
        min-height: 250px;
    }
    
    .product-detail-wrapper .img-showcase img {
        max-height: 400px;
    }
    
    .product-detail-wrapper .img-select {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .product-detail-wrapper .img-item img {
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .product-detail-wrapper .img-display {
        min-height: 200px;
    }
    
    .product-detail-wrapper .img-showcase img {
        max-height: 300px;
    }
    
    .product-detail-wrapper .img-select {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-detail-wrapper .img-item {
        min-height: 70px;
    }
    
    .product-detail-wrapper .img-item img {
        max-height: 50px;
    }
    
    .product-detail-wrapper .product-title {
        font-size: 2rem;
    }
}

/* Remove all the duplicate media queries at the end - they're redundant */


/* 1. Tiny devices (0 - 359px) */
@media (max-width: 359.98px) {}

/* 2. Small phones (360px - 575px) */
@media (min-width: 360px) and (max-width: 575.98px) {}

/* 3. Small tablets (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {}

/* 4. Medium tablets (768px - 899px) */
@media (min-width: 768px) and (max-width: 899.98px) {}

/* 5. Large tablets / small laptops (900px - 991px) */
@media (min-width: 900px) and (max-width: 991.98px) {}

/* 6. Small desktops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {}

/* 7. Large desktops (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439.98px) {}

/* 8. Extra large desktops (1440px and up) */
@media (min-width: 1440px) {}


