/* =========================================
   PRODUCT PAGE STYLES
   ========================================= */

main.product-page {
    padding: 50px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.product-container {
    display: flex;
    gap: 60px;
    margin-bottom: 100px;
}

/* Gallery Section */
.product-gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-gallery .main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    background-color: #fff;
    position: relative;
    /* For animation context */
}

.product-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    /* Smooth transition */
}

.product-gallery .main-image img.fade-out {
    opacity: 0;
}

.product-gallery .thumbnail-list {
    display: flex;
    gap: 15px;
}

.product-gallery .thumbnail {
    width: calc(33.333% - 10px);
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    background-color: #fff;
    cursor: pointer;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    /* Prepare for active state */
}

.product-gallery .thumbnail:hover {
    opacity: 0.8;
}

.product-gallery .thumbnail.active {
    border-color: var(--primary-color);
    /* Highlight active thumbnail */
}

.product-gallery .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details Section */
.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-title {
    font-family: var(--font-primary);
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--text-color);
}

.product-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
    font-weight: 400;
}

.product-description .scent-notes {
    margin-top: 20px;
}

.product-price {
    font-family: var(--font-primary);
    font-size: 64px;
    /* Much larger as requested */
    font-weight: 700;
    margin-bottom: 25px;
    color: #000;
    line-height: 1;
}

.add-to-cart-container {
    display: flex;
    gap: 20px;
    /* Increased gap */
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #1A1A1A;
    /* Darker, distinct border */
    border-radius: 20px 0 20px 0;
    /* Leaf shape top-left, bottom-right */
    padding: 0 10px;
    height: 55px;
    /* Taller */
    width: 140px;
    justify-content: space-between;
    background-color: transparent;
}

.quantity-selector .qty-btn {
    width: 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    /* Larger symbols */
    color: #1A1A1A;
    background: transparent;
    cursor: pointer;
    font-weight: 300;
}

.quantity-selector .qty-input {
    width: 40px;
    border: none;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    background: transparent;
    color: #1A1A1A;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.add-to-cart-btn {
    padding: 0 40px;
    background-color: #A0522D;
    /* Use primary color variable usually, hardcoded for now to match established brown */
    color: white;
    font-size: 16px;
    font-weight: 500;
    border-radius: 20px 0 20px 0;
    /* Matching Leaf shape */
    transition: all 0.3s ease;
    height: 55px;
    /* Match height */
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    flex: 1;
    /* Grow to fill space if needed, or fixed width? */
    max-width: 300px;
}

.add-to-cart-btn:hover {
    background-color: #8B4513;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(160, 82, 45, 0.3);
}

/* Similar Products Adjustments */
section.similar-products {
    padding: 50px 0;
    width: 100%;
}

section.similar-products .title-content {
    justify-content: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    /* Prevent wrapping */
}

section.similar-products .title-content p.title {
    white-space: nowrap;
    display: inline;
    margin: 0;
    /* Force single line on desktop */
}

/* Fix Heart spacing */
section.similar-products .title-content .heart {
    margin-left: 8px;
    /* Added spacing */
    vertical-align: middle;
    display: inline;
}

/* Keep "de" and heart together */
section.similar-products .title-content .de-heart {
    white-space: nowrap;
    display: inline;
    align-items: center;
}

section.similar-products .best-seller-content {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    /* Default to flex-start to allow accurate overflow behavior if needed, or center if fitting */
    flex-wrap: nowrap;
    /* Prevent wrapping by default to force row, but might need wrap for desktop grid if we want multi-row? User wants 4 in a row. */
    overflow-x: auto;
    /* Enable scroll if it overflows (mobile) */
    padding-bottom: 20px;
    /* Space for scrollbar if visible */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar IE */
    margin-bottom: 0;
    /* Remove potential default margins */
}

section.similar-products .more {
    margin-top: 20px !important;
    /* Force smaller margin top for the link */
}

/* Consistent sizing for consistent layout */
section.similar-products .sell-content {
    flex: 0 0 calc(25% - 15px);
    /* Force 4 items per row accounting for gap */
    width: auto;
    /* Overwrite width */
    max-width: none;
}


/* Responsive Styles */
@media (min-width: 1201px) {

    /* Ensure no scroll on large screens if content fits, but flex-wrap might be safer if we want rows */
    section.similar-products .best-seller-content {
        justify-content: center;
        /* Center them on large screens */
        overflow-x: hidden;
        /* No scroll needed usually */
    }
}

@media (max-width: 1200px) {
    .product-container {
        gap: 40px;
    }

    /* Carousel behavior starts effectively here or earlier depending on content width */
    section.similar-products .best-seller-content {
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        padding-left: 5%;
        /* Align with page padding */
        padding-right: 5%;
    }

    section.similar-products .sell-content {
        flex: 0 0 calc(33.333% - 14px);
        /* 3 items visible */
        scroll-snap-align: start;
    }
}

@media (max-width: 900px) {
    .product-container {
        flex-direction: column;
        gap: 40px;
    }

    .product-gallery,
    .product-details {
        flex: auto;
    }

    section.similar-products .sell-content {
        flex: 0 0 calc(50% - 10px);
        /* 2 items visible */
    }
}

@media (max-width: 600px) {

    /* Fix header height issue on mobile */
    /* Accessing global header to ensure it doesn't take 100vh */
    body header {
        height: auto !important;
        min-height: auto !important;
    }

    /* Fix Add to Cart Button Layout */
    .add-to-cart-container {
        flex-direction: row;
        /* Keep row direction */
        align-items: center;
        flex-wrap: wrap;
        /* Allow wrapping if absolutely necessary, but try to fit */
        gap: 10px;
        /* Reduce gap */
    }

    .quantity-selector {
        width: 120px;
        /* Reducing width slightly */
        flex-shrink: 0;
        /* Prevent shrinking if possible */
    }

    .add-to-cart-btn {
        flex: 1;
        /* Take remaining space */
        min-width: 150px;
        /* Minimum width to be readable */
        font-size: 14px;
        /* Slightly smaller text if needed */
        padding: 0 10px;
    }

    section.similar-products .title-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    section.similar-products .title .title-content p.title {
        font-size: 28px !important;
        /* Much larger text on mobile */
        line-height: 1.3;
        max-width: none !important;
        width: 100% !important;
        white-space: normal !important;
        /* Allow text wrapping */
        overflow: visible;
        display: block;
        text-align: center;
        margin: 0;
    }

    section.similar-products .title .title-content {
        display: block;
        text-align: center;
        width: 100%;
    }

    section.similar-products .title .title-content .de-heart {
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    section.similar-products .title .title-content img.heart {
        width: 28px;
        /* Match larger text size */
        height: auto;
        vertical-align: middle;
        margin-left: 5px;
    }

    section.similar-products .sell-content {
        flex: 0 0 calc(85% - 10px);
        /* 1 item mostly visible with peek */
    }
}

/* Product Options */
.product-options {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-group label {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-left: 5px;
}

.option-select {
    width: 100%;
    max-width: 350px;
    height: 55px;
    padding: 0 20px;
    border-radius: 20px 0 20px 0;
    /* Leaf shape matching buttons */
    border: 1px solid #1A1A1A;
    /* Matching quantity selector */
    font-family: var(--font-secondary);
    font-size: 16px;
    color: #1a1a1a;
    background-color: transparent;
    /* Transparent to show page background */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Style the options within the dropdown */
.option-select option {
    background-color: #F8F5F1;
    /* Start with a light beige/theme color */
    color: #1a1a1a;
    padding: 10px;
}

.option-select:focus {
    outline: none;
    background-color: rgba(160, 82, 45, 0.05);
    border-color: #A0522D;
}

.option-select:hover {
    background-color: rgba(26, 26, 26, 0.02);
}

@media (max-width: 600px) {
    .option-select {
        max-width: 100%;
    }
}

/* =========================================
   ACCORDION STYLES
   ========================================= */

.product-accordions {
    margin-bottom: 40px;
    border-top: 1px solid #e0e0e0;
}

.accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.accordion-header:hover {
    color: var(--primary-color);
}

.accordion-header h3 {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.accordion-header .icon {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    color: var(--primary-color);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.accordion-content .content-inner {
    padding-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
}

.accordion-content p {
    margin-bottom: 10px;
}

.accordion-content p:last-child {
    margin-bottom: 0;
}