/* ─── Single Product Page Styles ──────────────────────────── */

.jj-product-page {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-section);
}

/* ─── Product Layout (Two Column) ────────────────────────── */
.jj-product-layout {
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

/* ─── Product Gallery ────────────────────────────────────── */
.jj-product-gallery {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
}

.jj-product-gallery__main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--jj-ivory-dark);
    aspect-ratio: 4 / 5;
    margin-bottom: var(--space-md);
}

.jj-product-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--duration-base) var(--ease-out);
    cursor: zoom-in;
}

.jj-product-gallery__image.is-loading {
    opacity: 0.4;
}

/* Thumbnail Strip */
.jj-product-gallery__thumbs {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-xs);
}

.jj-product-gallery__thumbs::-webkit-scrollbar {
    display: none;
}

.jj-product-gallery__thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--duration-fast) var(--ease-out);
    padding: 0;
    background: none;
}

.jj-product-gallery__thumb:hover {
    opacity: 0.9;
}

.jj-product-gallery__thumb.is-active {
    border-color: var(--jj-mauve);
    opacity: 1;
}

.jj-product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Product Info ───────────────────────────────────────── */
.jj-product-info {
    padding-top: var(--space-sm);
}

.jj-product-info .jj-label {
    margin-bottom: var(--space-sm);
}

.jj-product-info__title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 500;
    color: var(--jj-charcoal);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-md);
    letter-spacing: -0.01em;
}

.jj-product-info__rating {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.jj-product-info__review-link {
    font-size: var(--text-sm);
    color: var(--jj-charcoal-lighter);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.jj-product-info__review-link:hover {
    color: var(--jj-mauve-dark);
}

.jj-product-info__price {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--jj-charcoal);
    margin-bottom: var(--space-md);
}

.jj-product-info__price del {
    color: var(--jj-charcoal-lighter);
    font-weight: 400;
    font-size: var(--text-lg);
    margin-right: var(--space-sm);
}

.jj-product-info__price ins {
    text-decoration: none;
    color: var(--jj-error);
}

.jj-product-info__desc {
    color: var(--jj-charcoal-light);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
    margin-bottom: var(--space-md);
}

.jj-product-info__desc p {
    margin-bottom: var(--space-sm);
}

.jj-product-info__desc p:last-child {
    margin-bottom: 0;
}

/* Subtle divider */
.jj-divider--subtle {
    background: var(--jj-rose-light);
    margin: var(--space-lg) 0;
    height: 1px;
}

/* ─── Size Selector ──────────────────────────────────────── */
.jj-size-selector {
    margin-bottom: var(--space-lg);
}

.jj-size-selector__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.jj-size-selector__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--jj-charcoal);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.jj-size-selector__guide {
    font-size: var(--text-xs);
    color: var(--jj-mauve-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.jj-size-selector__guide:hover {
    color: var(--jj-charcoal);
}

.jj-size-selector__options {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.jj-size-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--jj-charcoal);
    background: var(--jj-white);
    border: 1.5px solid var(--jj-rose-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.jj-size-btn:hover {
    border-color: var(--jj-mauve);
    background: var(--jj-rose-lighter);
}

.jj-size-btn.is-active {
    background: var(--jj-mauve);
    border-color: var(--jj-mauve);
    color: var(--jj-white);
}

.jj-size-btn.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ─── Quantity Selector ──────────────────────────────────── */
.jj-cart-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.jj-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--jj-rose-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--jj-white);
}

.jj-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--jj-charcoal);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
    padding: 0;
}

.jj-qty-btn:hover {
    background: var(--jj-rose-lighter);
}

.jj-qty-btn:active {
    background: var(--jj-rose-light);
}

.jj-qty-input {
    width: 48px;
    height: 44px;
    text-align: center;
    font-size: var(--text-base);
    font-weight: 500;
    border: none;
    background: transparent;
    -moz-appearance: textfield;
    color: var(--jj-charcoal);
}

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

.jj-qty-input:focus {
    outline: none;
}

/* Wishlist Button */
.jj-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--jj-rose-light);
    border-radius: var(--radius-md);
    background: var(--jj-white);
    color: var(--jj-charcoal-lighter);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
    padding: 0;
    margin-left: auto;
}

.jj-wishlist-btn:hover {
    border-color: var(--jj-rose-dark);
    color: var(--jj-rose-dark);
}

.jj-wishlist-btn.is-active {
    background: var(--jj-rose-lighter);
    border-color: var(--jj-rose-dark);
    color: var(--jj-error);
}

.jj-wishlist-btn.is-active svg {
    fill: currentColor;
}

/* ─── Add to Cart Button ─────────────────────────────────── */
.jj-add-to-cart {
    margin-bottom: var(--space-sm);
}

.jj-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Product Accordion ──────────────────────────────────── */
.jj-product-accordion {
    margin-top: var(--space-sm);
}

.jj-product-accordion .jj-accordion__trigger {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.jj-product-accordion .jj-accordion__inner {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.jj-apply-steps {
    list-style: decimal;
    padding-left: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.jj-apply-steps li {
    padding-left: var(--space-xs);
}

.jj-shipping-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.jj-shipping-list li {
    position: relative;
    padding-left: var(--space-lg);
}

.jj-shipping-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-circle);
    background: var(--jj-rose-dark);
}

/* ─── Related Products ───────────────────────────────────── */
.jj-related-products {
    padding-top: var(--space-section);
    border-top: 1px solid var(--jj-rose-light);
    margin-top: var(--space-section);
}

.jj-related-products__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 500;
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--jj-charcoal);
}

/* ─── Sticky Mobile Bottom Bar ───────────────────────────── */
.jj-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--jj-white);
    border-top: 1px solid var(--jj-rose-light);
    box-shadow: 0 -4px 20px rgba(58, 46, 48, 0.1);
    padding: var(--space-md) var(--gutter);
    transform: translateY(100%);
    transition: transform var(--duration-base) var(--ease-out);
}

.jj-sticky-bar.is-visible {
    transform: translateY(0);
}

.jj-sticky-bar__inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: var(--container-max);
    margin: 0 auto;
}

.jj-sticky-bar__price {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--jj-charcoal);
    white-space: nowrap;
}

.jj-sticky-bar__price del {
    font-size: var(--text-sm);
    color: var(--jj-charcoal-lighter);
    font-weight: 400;
}

.jj-sticky-bar__price ins {
    text-decoration: none;
    color: var(--jj-error);
}

.jj-sticky-bar__btn {
    flex: 1;
    padding: 14px 24px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .jj-product-layout {
        grid-template-columns: 50% 1fr;
        gap: var(--space-xl);
    }

    .jj-product-gallery {
        position: static;
    }
}

@media (max-width: 768px) {
    .jj-product-page {
        padding-top: var(--space-md);
        padding-bottom: calc(var(--space-section) + 80px);
    }

    .jj-product-layout {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .jj-product-gallery {
        position: static;
    }

    .jj-product-gallery__main {
        border-radius: var(--radius-md);
    }

    .jj-product-gallery__thumb {
        width: 60px;
        height: 60px;
    }

    .jj-product-info__title {
        font-size: var(--text-xl);
    }

    .jj-product-info__price {
        font-size: var(--text-lg);
    }

    /* Show sticky bar on mobile */
    .jj-sticky-bar {
        display: block;
    }

    /* Related products: horizontal scroll on mobile */
    .jj-related-products__grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: var(--space-md);
        padding-bottom: var(--space-sm);
    }

    .jj-related-products__grid::-webkit-scrollbar {
        display: none;
    }

    .jj-related-products__grid > * {
        flex: 0 0 70%;
        max-width: 70%;
        scroll-snap-align: start;
    }
}

@media (max-width: 480px) {
    .jj-product-gallery__thumb {
        width: 52px;
        height: 52px;
    }

    .jj-size-btn {
        min-width: 44px;
        height: 44px;
        font-size: var(--text-xs);
    }

    .jj-qty-btn {
        width: 44px;
        height: 44px;
    }

    .jj-qty-input {
        width: 44px;
        height: 44px;
    }

    .jj-related-products__grid > * {
        flex: 0 0 75%;
        max-width: 75%;
    }
}
