/* Skin store extras (skin-store-extras.js): skin preview, on-sale carousel, pack quantity stepper.
   Rarity colours match store.css; gold accents match the site (#c9a96e / #eddfc0 / #ffbf00). */

/* =====================
   SKIN PREVIEW
   ===================== */
.skin-preview-overlay { z-index: 2050; padding: 16px; box-sizing: border-box; }

.skin-preview-card {
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px 22px 22px;
    gap: 10px;
    background: linear-gradient(180deg, #1c1a16, #111 70%);
    border-color: rgba(201, 169, 110, 0.35);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.skin-preview-card.sp-RARE    { border-color: rgba(33, 150, 243, 0.55); }
.skin-preview-card.sp-EPIC    { border-color: rgba(171, 71, 188, 0.6); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 28px rgba(171, 71, 188, 0.25); }
.skin-preview-card.sp-ANCIENT { border-color: rgba(255, 152, 0, 0.6); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 32px rgba(255, 152, 0, 0.3); }

.skin-preview-art {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(255, 191, 0, 0.09), transparent 75%), #0b0907;
    max-height: min(56vh, 520px);
}

/* The whole skin, at its real shape */
.skin-preview-art img {
    display: block;
    max-width: 100%;
    max-height: min(56vh, 520px);
    width: auto;
    height: auto;
    object-fit: contain;
    -webkit-user-drag: none;
}

.skin-preview-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.skin-preview-type,
.skin-preview-status {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(237, 223, 192, 0.6);
}

.skin-preview-status { color: #c9a96e; }

.skin-preview-name {
    font-size: 20px;
    line-height: 1.25;
    color: #eddfc0;
    overflow-wrap: anywhere;
}

.skin-preview-card-name {
    margin-top: -6px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(240, 236, 230, 0.55);
}

.skin-preview-card .modal-buttons { width: 100%; }

/* =====================
   ON-SALE CAROUSEL
   ===================== */
.sale-carousel {
    max-width: 1300px;
    margin: 16px auto 0;
    padding: 0 16px;
    box-sizing: border-box;
    min-width: 0;
}

.sale-carousel[hidden] { display: none; }

.sale-carousel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sale-carousel-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'DragonSlayer', serif;
    font-size: 1.25rem;
    letter-spacing: 1px;
    color: #eddfc0;
}

.sale-carousel-label i { font-size: 0.85rem; color: #ff6b4a; }

.sale-carousel-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(201, 169, 110, 0.45), transparent);
}

.sale-carousel-count {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.75rem;
    color: rgba(237, 223, 192, 0.55);
}

.sale-carousel-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(201, 169, 110, 0.28);
    background:
        radial-gradient(ellipse 55% 90% at 22% 50%, rgba(255, 170, 60, 0.14), transparent 70%),
        linear-gradient(120deg, #17120b, #0d0b08 55%, #120d14);
    touch-action: pan-y;
}

.sale-carousel-track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.3, 1);
    will-change: transform;
}

.sale-slide {
    flex: 0 0 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    padding: 22px 64px;
    box-sizing: border-box;
    min-height: 300px;
}

.sale-slide-art {
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.sale-slide-art img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.65));
    transition: transform 0.35s ease;
    -webkit-user-drag: none;
}

.sale-slide-art:hover img { transform: scale(1.03); }

.sale-slide.sr-RARE    .sale-slide-art img { filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 14px rgba(33, 150, 243, 0.35)); }
.sale-slide.sr-EPIC    .sale-slide-art img { filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 16px rgba(171, 71, 188, 0.4)); }
.sale-slide.sr-ANCIENT .sale-slide-art img { filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 18px rgba(255, 152, 0, 0.45)); }

.sale-slide-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.sale-slide-off {
    padding: 4px 12px;
    border-radius: 999px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, #ff6b4a, #d63a2a);
    box-shadow: 0 0 16px rgba(255, 90, 60, 0.35);
}

.sale-slide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.sale-slide-type {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(237, 223, 192, 0.6);
}

.sale-slide-name {
    margin: 0;
    max-width: 100%;
    font-family: 'DragonSlayer', serif;
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
    font-weight: normal;
    line-height: 1.1;
    color: #eddfc0;
    overflow-wrap: anywhere;
    cursor: zoom-in;
}

.sale-slide-price .gem-pill-lg { font-size: 1.05rem; }

.sale-slide-info .modal-value { margin: -4px 0 0; }

.sale-slide-buy {
    height: auto;
    min-width: 150px;
    padding: 12px 28px;
    font-size: 0.95rem;
    letter-spacing: 2px;
}

.sale-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(201, 169, 110, 0.45);
    background: rgba(10, 8, 5, 0.7);
    color: #eddfc0;
    font-size: 0.9rem;
    z-index: 2;
}

.sale-carousel-arrow:hover { background: rgba(201, 169, 110, 0.22); }
.sale-prev { left: 12px; }
.sale-next { right: 12px; }

.sale-carousel-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sale-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 999px;
    background: rgba(237, 223, 192, 0.25);
    transition: width 0.25s ease, background 0.25s ease;
}

.sale-dot.active { width: 26px; background: #c9a96e; }

@media (prefers-reduced-motion: reduce) {
    .sale-carousel-track { transition: none; }
    .sale-slide-art img { transition: none; }
}

@media (max-width: 767px) {
    .sale-slide {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 16px 16px 18px;
        min-height: 0;
        text-align: center;
    }
    .sale-carousel { padding: 0 14px; }
    .sale-slide-art { height: 190px; width: 100%; }
    .sale-slide-info { align-items: center; gap: 8px; }
    .sale-slide-meta { justify-content: center; }
    .sale-slide-name { font-size: 1.35rem; }
    .sale-carousel-arrow { top: 105px; width: 34px; height: 34px; }
    .sale-prev { left: 6px; }
    .sale-next { right: 6px; }
}

/* =====================
   PACK QUANTITY STEPPER
   ===================== */
.qty-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2px;
}

.qty-stepper .qty-step {
    height: auto;
    min-width: 44px;
    padding: 6px 14px;
    font-size: 1.1rem;
}

.qty-stepper .qty-step:disabled { opacity: 0.35; cursor: default; }

.qty-input {
    width: 84px;
    height: auto;
    padding: 7px 6px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 191, 0, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffbf00;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 1.3rem;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.qty-input:focus { border-color: #ffbf00; box-shadow: 0 0 0 2px rgba(255, 191, 0, 0.2); }

.qty-max {
    min-height: 1em;
    margin-bottom: 6px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: rgba(240, 236, 230, 0.45);
}
