/**
 * Rosalynn Single Product - CSS
 *
 * Modern, minimalist single product page styles.
 *
 * @package Rosalynn
 * @since 1.0.0
 */

/* ==========================================================================
   Container
   ========================================================================== */

.rosalynn-single-product {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    font-family: 'ClarityCity', sans-serif;
}

.rosalynn-single-product__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

/* ==========================================================================
   Gallery - Thumbnails on Right (Vertical)
   ========================================================================== */

.rosalynn-single-product__gallery {
    position: sticky;
    top: 100px;
    align-self: start;
}

.rosalynn-single-product__gallery-inner {
    display: flex;
    gap: 16px;
}

.rosalynn-single-product__main-image {
    flex: 1;
    max-width: calc(100% - 96px); /* Consistent size: reserve space for thumbnails (80px + 16px gap) */
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f8f8;
}

.rosalynn-single-product__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.rosalynn-single-product__thumbnails {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    width: 80px;
    flex-shrink: 0;
    /* Match main image aspect-ratio for perfect 6-thumbnail alignment */
    aspect-ratio: 4 / 5;
    box-sizing: border-box; /* Force le padding à l'intérieur */
    padding-bottom: 1px; /* Espace interne pour corriger le bug de défilement */
    /* Scroll for 7+ images, no visible scrollbar */
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE/Edge */
    scrollbar-width: none;     /* Firefox */
    /* Snap scroll to each thumbnail */
    scroll-snap-type: y mandatory;
}

/* Hide scrollbar for Chrome/Safari/Opera */
.rosalynn-single-product__thumbnails::-webkit-scrollbar {
    display: none;
}

.rosalynn-single-product__thumbnail {
    width: 80px;
    /* Height calculated: (100% - 5 gaps of 8px) / 6 thumbnails */
    height: calc((100% - 40px) / 6);
    min-height: 60px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f8f8f8;
    /* Snap point for each thumbnail */
    scroll-snap-align: start;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

/* Last thumbnail snaps to end so it's fully visible */
.rosalynn-single-product__thumbnail:last-child {
    scroll-snap-align: end;
    flex-shrink: 0;
}

.rosalynn-single-product__thumbnail.is-active {
    border-color: #1B1B1B;
}

.rosalynn-single-product__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Product Info
   ========================================================================== */

.rosalynn-single-product__info {
    padding-top: 20px;
}

/* Title */
.rosalynn-single-product__title {
    font-size: 42px;
    font-weight: 600;
    color: #1B1B1B;
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Meta */
.rosalynn-single-product__meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.rosalynn-single-product__meta .separator {
    margin: 0 8px;
    color: #ccc;
}

/* Price */
.rosalynn-single-product__price {
    font-size: 24px;
    font-weight: 500;
    color: #1B1B1B;
    margin-bottom: 24px;
}

.rosalynn-single-product__price del {
    color: #999;
    font-weight: 400;
    font-size: 22px;
    margin-right: 12px;
}

.rosalynn-single-product__price ins {
    text-decoration: none;
}

/* Short Description */
.rosalynn-single-product__short-desc {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.7;
    color: #1B1B1B;
    margin-bottom: 32px;
}

.rosalynn-single-product__short-desc p {
    margin: 0 0 12px;
}

/* ==========================================================================
   Add to Cart Form
   ========================================================================== */

.rosalynn-single-product__form {
    margin-bottom: 32px;
}

/* Variations */
.rosalynn-single-product__variations {
    margin-bottom: 24px;
}

.rosalynn-single-product__variation {
    margin-bottom: 16px;
}

.rosalynn-single-product__variation label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1B1B1B;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rosalynn-single-product__select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'ClarityCity', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.rosalynn-single-product__select:focus {
    outline: none;
    border-color: #1B1B1B;
}

/* Quantity - Same style as cart preview popup */
.rosalynn-single-product__quantity {
    margin-bottom: 24px;
}

.rosalynn-single-product__quantity .quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.rosalynn-single-product__quantity .qty-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 400;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
    line-height: 1;
}

.rosalynn-single-product__quantity .qty-btn:first-child {
    border-right: 1px solid #ddd;
}

.rosalynn-single-product__quantity .qty-btn:last-child {
    border-left: 1px solid #ddd;
}



.rosalynn-single-product__quantity .qty-input {
    width: 50px;
    min-width: 50px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    font-family: 'ClarityCity', sans-serif;
    background: transparent;
    color: #000;
    padding: 0;
    -moz-appearance: textfield;
}

.rosalynn-single-product__quantity .qty-input::-webkit-inner-spin-button,
.rosalynn-single-product__quantity .qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rosalynn-single-product__quantity .qty-input:focus {
    outline: none;
}

/* Add to Cart Button - Uses cart-preview-btn classes from cart-shopify.css */
.rosalynn-add-to-cart-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rosalynn-add-to-cart-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.rosalynn-add-to-cart-btn.is-loading {
    pointer-events: none;
}

.rosalynn-add-to-cart-btn.is-success {
    background: #2e7d32;
    border-color: #2e7d32;
}

/* Out of Stock */
.rosalynn-single-product__out-of-stock {
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #c62828;
    background: #ffebee;
    border-radius: 8px;
    margin-bottom: 32px;
}

/* ==========================================================================
   Product Meta
   ========================================================================== */

.rosalynn-single-product__product-meta {
    padding-top: 24px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.rosalynn-single-product__sku,
.rosalynn-single-product__categories {
    margin-bottom: 8px;
}

.rosalynn-single-product__product-meta .label {
    font-weight: 600;
    color: #1B1B1B;
    margin-right: 8px;
}

.rosalynn-single-product__categories a {
    color: #666;
    text-decoration: none;
}

/* ==========================================================================
   Accordions
   ========================================================================== */

.rosalynn-single-product__accordions {
    margin-top: 32px;
    border-top: 1px solid #1B1B1B;
}

.rosalynn-accordion {
    border-bottom: 1px solid #1B1B1B;
}

.rosalynn-accordion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    font-family: 'ClarityCity', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #1B1B1B;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.rosalynn-accordion__header:hover {
    color: #1B1B1B;
}

.rosalynn-accordion__title {
    flex: 1;
}

.rosalynn-accordion__icon {
    font-size: 20px;
    font-weight: 300;
    color: #1B1B1B;
    transition: transform 0.3s ease;
    line-height: 1;
}

.rosalynn-accordion.is-open .rosalynn-accordion__icon {
    transform: rotate(45deg);
}

.rosalynn-accordion__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.rosalynn-accordion.is-open .rosalynn-accordion__content {
    max-height: 500px;
}

.rosalynn-accordion__inner {
    padding: 0 0 24px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.7;
    color: #1B1B1B;
}

.rosalynn-accordion__inner p {
    margin: 0 0 12px;
}

.rosalynn-accordion__inner p:last-child {
    margin-bottom: 0;
}

/* Specs Table */
.rosalynn-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.rosalynn-specs-table th,
.rosalynn-specs-table td {
    padding: 8px 0;
    text-align: left;
    font-size: 14px;
}

.rosalynn-specs-table th {
    font-weight: 500;
    color: #1B1B1B;
    width: 120px;
}

.rosalynn-specs-table td {
    color: #1B1B1B;
}

/* ==========================================================================
   Related Products
   ========================================================================== */

.rosalynn-single-product__related {
    margin-top: 80px;
}

.rosalynn-single-product__related-title {
    font-size: 24px;
    font-weight: 600;
    color: #1B1B1B;
    text-align: center;
    margin-bottom: 40px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .rosalynn-single-product__container {
        gap: 40px;
    }

    .rosalynn-single-product__title {
        font-size: 38px;
    }

    .rosalynn-single-product__price {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .rosalynn-single-product {
        padding: 20px 16px 60px;
    }

    .rosalynn-single-product__container {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 60px;
    }

    .rosalynn-single-product__gallery {
        position: static;
    }

    /* On mobile, thumbnails go below the main image */
    .rosalynn-single-product__gallery-inner {
        flex-direction: column;
    }

    .rosalynn-single-product__thumbnails {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .rosalynn-single-product__main-image {
        max-width: 100%; /* Reset on mobile - thumbnails are below */
        aspect-ratio: 1 / 1;
    }

    .rosalynn-single-product__thumbnail {
        width: 60px;
        height: 75px;
        flex-shrink: 0;
    }

    .rosalynn-single-product__info {
        padding-top: 0;
    }

    .rosalynn-single-product__title {
        font-size: 34px;
    }

    .rosalynn-single-product__price {
        font-size: 18px;
    }

    .rosalynn-single-product__related-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .rosalynn-single-product__title {
        font-size: 32px;
    }

    .rosalynn-single-product__price {
        font-size: 16px;
    }

    .rosalynn-single-product__quantity .qty-btn {
        width: 36px;
        min-width: 36px;
        height: 36px;
    }

    .rosalynn-single-product__quantity .qty-input {
        width: 44px;
        min-width: 44px;
        height: 36px;
    }
}
