/* ============================================
   Page produit boutique
   ============================================ */

.shop-product-main {
    padding-top: 48px;
}

.shop-product-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.shop-product-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.shop-product-back:hover {
    opacity: 0.85;
    transform: translateX(-2px);
}

.shop-product-back__icon {
    font-size: 1.25rem;
    line-height: 1;
}

.shop-product-not-found h1 {
    margin: 0;
}

.shop-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 40px 48px;
    align-items: start;
    min-width: 0;
}

.shop-product-gallery,
.shop-product-info,
.shop-product-long {
    min-width: 0;
}

/* Galerie */
.shop-product-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shop-product-gallery__stage {
    position: relative;
}

.shop-product-gallery__viewport {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.shop-product-gallery__viewport:focus-visible .shop-product-gallery__image,
.shop-product-gallery__viewport:focus-visible .shop-product-gallery__video {
    outline: 2px solid var(--color-darkpurple-medium);
    outline-offset: 4px;
}

.shop-product-gallery__slide {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.shop-product-gallery__slide.shop-product-gallery__slide--active:not([hidden]) {
    display: flex;
}

.shop-product-gallery__slide[hidden] {
    display: none !important;
}

.shop-product-gallery__image,
.shop-product-gallery__video {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(70vh, 560px);
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(44, 18, 59, 0.14);
}

.shop-product-gallery__video {
    pointer-events: none;
}

.shop-product-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-darkpurple);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(44, 18, 59, 0.15);
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.shop-product-gallery__nav:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.shop-product-gallery__nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.shop-product-gallery__nav--prev {
    left: 12px;
}

.shop-product-gallery__nav--next {
    right: 12px;
}

.shop-product-gallery__counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.shop-product-gallery__thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.shop-product-gallery__thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    scroll-snap-align: start;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

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

.shop-product-gallery__thumb:hover {
    transform: translateY(-2px);
}

.shop-product-gallery__thumb--active {
    border-color: var(--color-darkpurple-medium);
    box-shadow: 0 4px 12px rgba(76, 46, 139, 0.2);
}

.shop-product-gallery__thumb-video {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.shop-product-gallery__thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 18, 59, 0.35);
    color: #fff;
    font-size: 1.25rem;
}

.shop-product-gallery__empty {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(76, 46, 139, 0.12);
}

/* Infos produit */
.shop-product-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 28px 32px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(76, 46, 139, 0.12);
    box-shadow: 0 12px 32px rgba(44, 18, 59, 0.08);
}

.shop-product-title {
    margin: 0;
    font-size: 2.25rem;
    line-height: 1.15;
}

.shop-product-short-desc {
    margin: 0;
    line-height: 1.55;
}

.shop-product-attributes {
    margin: 0;
    padding: 16px 0 0;
    border-top: 1px solid rgba(76, 46, 139, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-product-attributes__row {
    display: grid;
    grid-template-columns: minmax(100px, 0.4fr) 1fr;
    gap: 8px 16px;
    margin: 0;
}

.shop-product-attributes__label,
.shop-product-attributes__value {
    margin: 0;
}

.shop-product-purchase {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(76, 46, 139, 0.1);
}

.shop-product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shop-product-price__row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.shop-product-price__row .coin-display {
    line-height: 1;
}

.shop-product-price__row .shop-price-usd {
    font-size: 2.5rem;
}

@media (max-width: 768px) {
    .shop-product-price__row .shop-price-usd {
        font-size: 1.9rem;
    }
}

.shop-product-price__label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    opacity: 0.85;
}

.shop-product-buy {
    width: 100%;
    min-width: 0;
    padding: 14px 24px;
    font-size: 1rem;
}

.shop-product-owned {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
}

.shop-product-wallet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--color-coin-bg);
    border: 1px solid var(--color-coin-border);
}

/* Description longue */
.shop-product-long {
    padding: 32px 36px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(76, 46, 139, 0.12);
    box-shadow: 0 12px 32px rgba(44, 18, 59, 0.06);
}

.shop-product-long__heading {
    margin: 0 0 20px 0;
}

.shop-product-long__body {
    margin: 0;
    line-height: 1.65;
    white-space: pre-wrap;
}

.shop-product-long__body br {
    display: block;
    content: '';
    margin-top: 0.5em;
}

/* Cartes shop cliquables */
.shop-card--clickable {
    position: relative;
    cursor: pointer;
}

.shop-card__overlay-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.shop-card__overlay-link:focus-visible {
    outline: 2px solid var(--color-darkpurple-medium);
    outline-offset: 2px;
}

.shop-card--clickable .shop-card__footer .shop-card__cta,
.shop-card--clickable .shop-card__footer .shop-card__owned {
    position: relative;
    z-index: 2;
}

.shop-card--clickable .shop-card__cta--view:focus-visible {
    outline: 2px solid var(--color-darkpurple-medium);
    outline-offset: 2px;
}

@media (max-width: 960px) {
    .shop-product-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .shop-product-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .shop-product-main {
        padding-top: 32px;
    }

    .shop-product-container {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .shop-product-layout {
        width: 100%;
        gap: 24px;
    }

    .shop-product-gallery__stage,
    .shop-product-gallery__viewport {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .shop-product-gallery__slide {
        min-width: 0;
    }

    .shop-product-gallery__image,
    .shop-product-gallery__video {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: min(55vh, 420px);
    }

    .shop-product-gallery__nav--prev {
        left: 6px;
    }

    .shop-product-gallery__nav--next {
        right: 6px;
    }

    .shop-product-gallery__thumbs {
        max-width: 100%;
    }

    .shop-product-info,
    .shop-product-long {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .shop-product-info {
        padding: 20px;
    }

    .shop-product-long {
        padding: 24px 20px;
    }

    .shop-product-title {
        font-size: clamp(1.35rem, 5vw, 1.75rem);
        overflow-wrap: break-word;
    }

    .shop-product-short-desc,
    .shop-product-long__body {
        overflow-wrap: anywhere;
    }

    .shop-product-attributes__row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .shop-product-get-coins {
        flex-wrap: wrap;
    }

    .shop-product-wallet {
        flex-wrap: wrap;
    }

    .shop-product-gallery__nav {
        width: 38px;
        height: 38px;
        font-size: 1.5rem;
    }
}
