/* ===================================
   SINGLE PRODUCT PAGE STYLES
   COS-inspired design with 60-65% gallery, 35-40% info sidebar
   =================================== */
/* Main Layout */
.single-product-layout {
    display: grid;
    grid-template-columns: 1fr 0.6fr;
    gap: 4rem;
    margin-bottom: 4rem;
    min-height: 80vh;
}

/* ===================================
   PRODUCT GALLERY (LEFT SIDE 60-65%)
   =================================== */
.single-product-gallery {
    position: relative;
}

.product-gallery-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.product-gallery-main {
    /* Remove internal scrolling - let page scroll handle it */
    flex: 1;
    overflow: visible;

    /* Stack images vertically for natural page scrolling */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-image-item {
    width: 100%;

    /* Remove margin-bottom since we're using gap in parent */
    margin-bottom: 0;

    /* Make images visible by default for natural scrolling */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;

    /* Add minimum height for better spacing */
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.product-image-item.active,
.product-image-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

.product-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;

    /* Ensure images fill their containers nicely */
    object-fit: cover;
    max-height: 80vh;
}
/* 
.product-image:hover {
    transform: scale(1.02);
} */

/* Gallery Pagination (reusing hero slider style) */
.product-gallery-pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.pagination-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--linegrey);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.pagination-dot:hover {
    background: var(--dark);
    transform: scale(1.2);
}

.pagination-dot.active {
    background: var(--dark);
    transform: scale(1.3);
}

.pagination-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 1px solid var(--dark);
    border-radius: 50%;
    opacity: 0.3;
}

/* ===================================
   PRODUCT INFO SIDEBAR (RIGHT SIDE 35-40%)
   =================================== */
.single-product-info {
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding: 2rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Always Visible Header Section */
.product-info-header {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--linegrey);
    margin-bottom: 2rem;
}

.product-brand {
    margin-bottom: 0.5rem;
}

.product-brand span {
    font-size: 0.875rem;
    color: var(--text-color-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.product-title {
    margin-bottom: 2rem;
    color: var(--dark);
    line-height: 1.2;
}

/* Quantity Selector */
.product-quantity {
    margin-bottom: 2rem;
}

.product-quantity label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--dark);
    font-weight: 500;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--linegrey);
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--white);
    color: var(--dark);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--light);
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--linegrey);
    border-right: 1px solid var(--linegrey);
    text-align: center;
    font-size: 0.875rem;
    background: var(--white);
}

.quantity-input:focus {
    outline: none;
    background: var(--light);
}

/* Add to Favorites Button */
.btn-add-to-favorites {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-to-favorites:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================================
   ACCORDION SECTIONS
   =================================== */
.product-accordion-sections {
    /* Let accordion sections expand freely within the sticky container */
}

.accordion-item {
    border-bottom: 1px solid var(--linegrey);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    padding: 1.5rem 0;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
    text-align: left;
    transition: color 0.2s ease;
}

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

.accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--text-color-grey);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
    color: var(--dark);
}

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

.accordion-item.active .accordion-content {
    max-height: 500px;

    /* Adjust based on content */
}

.accordion-body {
    padding-bottom: 1.5rem;
    color: var(--text-color-grey);
    line-height: 1.6;
}

.accordion-body p {
    margin-bottom: 1rem;
}

.accordion-body ul {
    list-style: none;
    padding: 0;
}

.accordion-body li {
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
}

.accordion-body li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Dimensions Table */
.dimensions-table {
    width: 100%;
    border-collapse: collapse;
}

.dimensions-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--linegrey);
}

.dimensions-table td:first-child {
    font-weight: 500;
    color: var(--dark);
    width: 40%;
}

/* Document Downloads */
.document-downloads {
    margin-bottom: 1.5rem;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid var(--linegrey);
}

.download-link:hover {
    color: var(--accent);
}

.download-link:last-child {
    border-bottom: none;
}

.download-icon {
    font-size: 1.2rem;
}

/* Video Embeds */
.product-videos {
    margin-top: 1rem;
}

.video-embed {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;

    /* 16:9 aspect ratio */
    border-radius: 8px;
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Availability Info */
.availability-info {
    /* Styling for availability section */
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--linegrey);
}

.status-indicator.available {
    background: #22c55e;

    /* Green */
}

.status-indicator.limited {
    background: #f59e0b;

    /* Orange */
}

.status-indicator.unavailable {
    background: #ef4444;

    /* Red */
}

.delivery-info p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* ===================================
   RELATED PRODUCTS SECTION
   =================================== */
.related-products-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid var(--linegrey);
}

.related-products-section h3 {
    margin-bottom: 2rem;
    color: var(--dark);
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}


/* ===================================
   MOBILE RESPONSIVE STYLES
   =================================== */
@media (max-width: 1024px) {
    .single-product-layout {
        grid-template-columns: 1fr 0.7fr;
        gap: 3rem;
    }

    .single-product-info {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .single-product-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-gallery-container {
        position: relative;
        height: 60vh;
    }

    .single-product-info {
        /* Remove sticky positioning on mobile */
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    /* Mobile Sticky Bottom Bar */
    .product-info-header {
        position: relative;
    }

    .mobile-sticky-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        border-top: 1px solid var(--linegrey);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: none;

        /* Show via JavaScript when scrolling */
    }

    .mobile-sticky-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        max-width: 100%;
    }

    .mobile-product-info {
        flex: 1;
        margin-right: 1rem;
    }

    .mobile-product-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--dark);
        margin: 0;
        line-height: 1.2;
    }

    .mobile-product-brand {
        font-size: 0.75rem;
        color: var(--text-color-grey);
        text-transform: uppercase;
    }

    .mobile-add-to-favorites {
        padding: 0.75rem 1.5rem;
        background: var(--dark);
        color: var(--white);
        border: none;
        border-radius: 6px;
        font-size: 0.875rem;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
    }

    /* Adjust accordion for mobile */
    .accordion-header {
        padding: 1rem 0;
    }

    .accordion-body {
        padding-bottom: 1rem;
    }

    /* Related products mobile */
    .related-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .product-gallery-container {
        height: 50vh;
    }

    .single-product-info {
        padding: 1rem;
    }

    .product-info-header {
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .product-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .quantity-controls {
        width: 100%;
        justify-content: center;
    }

    .quantity-btn {
        flex: 1;
        max-width: 50px;
    }

    .quantity-input {
        flex: 1;
        max-width: 80px;
    }

    .related-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .product-card-info {
        padding: 1rem;
    }
}

/* ===================================
   LOADING STATES
   =================================== */
.product-loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */
.accordion-header:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.pagination-dot:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-add-to-favorites:focus,
.mobile-add-to-favorites:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .product-image-item,
    .accordion-content,
    .product-image,
    .product-card {
        transition: none;
    }

    .pagination-dot {
        transition: background-color 0.2s ease;
    }
}
