/* ==========================================================
   Khoja – pagina Shop (layout ispirato alla pagina iPhone Apple)
   Tutto è isolato sotto #shop-apple per non toccare style.css.
   Caricare DOPO style.css.
   ========================================================== */

#shop-apple {
    --sa-ink: #1d1d1f;
    --sa-muted: #6e6e73;
    --sa-brand: #6F3619;
    --sa-bg: #F7F7F7;
    --sa-card: #fff;
    --sa-line: #e2e2e4;
    --sa-top: 0px;
    background: var(--sa-bg);
    color: var(--sa-ink);
    overflow-x: clip;
}

/* style.css mette font-weight:700 su tutto: qui riparto da 400 e scelgo io i pesi */
#shop-apple,
#shop-apple * {
    font-weight: 400;
}

#shop-apple h1,
#shop-apple h2,
#shop-apple h3,
#shop-apple p,
#shop-apple a,
#shop-apple button {
    letter-spacing: normal;
}

/* ---------- Titolo ---------- */
#shop-apple .sa-intro {
    text-align: center;
    padding: 56px 24px 28px;
    max-width: 760px;
    margin: 0 auto;
}
#shop-apple .sa-intro h1 {
    font-size: clamp(34px, 4.6vw, 52px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--sa-ink);
}
#shop-apple .sa-intro p {
    margin: 14px 0 0;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.4;
    color: var(--sa-muted);
}

/* ---------- Barra prodotti orizzontale ---------- */
#shop-apple .sa-wrapper {
    position: relative;
}
#shop-apple .sa-strip {
    position: sticky;
    top: var(--sa-top);
    z-index: 20;
    background: rgba(247, 247, 247, .86);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--sa-line);
    margin-top: 12px;
}
#shop-apple .sa-strip-list {
    position: relative;
    display: flex;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
#shop-apple .sa-strip-list::-webkit-scrollbar { display: none; }

#shop-apple .sa-strip-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px 10px;
    min-width: 92px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--sa-muted);
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
#shop-apple .sa-strip-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}
#shop-apple .sa-strip-item .sa-strip-name {
    display: block !important;
    font-size: 13px;
    line-height: 1.25;
    max-width: 110px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#shop-apple .sa-strip-item:hover { color: var(--sa-ink); }
#shop-apple .sa-strip-item.is-active {
    color: var(--sa-brand);
    border-bottom-color: var(--sa-brand);
}
#shop-apple .sa-strip-item.is-active .sa-strip-name { font-weight: 700; }

/* ---------- Prodotto grande ---------- */
#shop-apple .sa-stage {
    position: relative;
    max-width: 1400px;
    margin: 24px auto 0;
    padding: 0 24px;
}
#shop-apple .sa-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: var(--sa-card);
    border-radius: 28px;
    outline-offset: 4px;
}
#shop-apple .sa-track::-webkit-scrollbar { display: none; }

#shop-apple .sa-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 72px 0;
    min-height: 640px;
}
#shop-apple .sa-cat {
    margin: 0;
    font-size: 17px;
    color: var(--sa-muted);
}
#shop-apple .sa-name {
    margin: 6px 0 0;
    font-size: clamp(34px, 5.4vw, 64px);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.025em;
    color: var(--sa-ink);
}
#shop-apple .sa-arabic {
    margin: 8px 0 0;
    font-size: 20px;
    color: var(--sa-brand);
}
#shop-apple .sa-blurb {
    margin: 16px 0 0;
    max-width: 560px;
    font-size: clamp(16px, 1.8vw, 19px);
    line-height: 1.45;
    color: var(--sa-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#shop-apple .sa-rating {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--sa-brand);
}
#shop-apple .sa-rating .sa-rating-n { color: var(--sa-muted); }

#shop-apple .sa-price {
    margin: 18px 0 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 20px;
    color: var(--sa-ink);
}
#shop-apple .sa-price .sa-price-now { font-weight: 700; }
#shop-apple .sa-price .sa-price-old { color: var(--sa-muted); font-size: 17px; }
#shop-apple .sa-price .sa-price-off {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--sa-brand);
    padding: 2px 9px;
    border-radius: 999px;
}

#shop-apple .sa-actions {
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}
#shop-apple .sa-btn {
    display: inline-block;
    padding: 13px 30px;
    border-radius: 999px;
    background: var(--sa-brand);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid var(--sa-brand);
    transition: background .2s, color .2s, transform .15s;
}
#shop-apple .sa-btn:hover { background: #55290f; border-color: #55290f; }
#shop-apple .sa-btn:active { transform: scale(.98); }
#shop-apple .sa-btn--ghost {
    background: transparent;
    color: var(--sa-brand);
}
#shop-apple .sa-btn--ghost:hover { background: var(--sa-brand); color: #fff; }
#shop-apple .sa-btn--light {
    background: #fff;
    color: var(--sa-brand);
    border-color: #fff;
}
#shop-apple .sa-btn--light:hover { background: #f1e6df; border-color: #f1e6df; }

#shop-apple .sa-wish {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--sa-line);
    background: #fff;
    color: var(--sa-brand);
    font-size: 18px;
    cursor: pointer;
    transition: border-color .2s;
}
#shop-apple .sa-wish:hover { border-color: var(--sa-brand); }
#shop-apple .sa-wish i { font-weight: 900; }
#shop-apple .far { font-weight: 400 !important; }
#shop-apple .fas { font-weight: 900 !important; }
#shop-apple .fa-star.far, #shop-apple .fa-heart.far { font-weight: 400 !important; }

/* messaggio wishlist (riusa la classe alert-wrapper dello stile vecchio) */
#shop-apple .sa-msg.alert-wrapper {
    height: auto;
    display: block;
    min-height: 22px;
    margin: 10px 0 0;
    font-size: 14px;
}
#shop-apple .sa-msg.alert-success { color: #2e7d32; }
#shop-apple .sa-msg.alert-danger { color: #b3261e; }

#shop-apple .sa-visual {
    position: relative;
    display: block;
    width: min(820px, 100%);
    margin-top: auto;
    aspect-ratio: 16 / 10;
}
#shop-apple .sa-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    transition: opacity .35s ease;
}
#shop-apple .sa-img--alt { opacity: 0; }
@media (hover: hover) {
    #shop-apple .sa-visual:hover .sa-img--main { opacity: 0; }
    #shop-apple .sa-visual:hover .sa-img--alt { opacity: 1; }
}

/* frecce ai lati */
#shop-apple .sa-arrow {
    position: absolute;
    top: 52%;
    transform: translateY(-50%);
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 0;
    background: rgba(29, 29, 31, .08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--sa-ink);
    font-size: 18px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
#shop-apple .sa-arrow:hover { background: var(--sa-brand); color: #fff; }
#shop-apple .sa-arrow--prev { left: 44px; }
#shop-apple .sa-arrow--next { right: 44px; }

/* pallini */
#shop-apple .sa-dots {
    display: flex;
    justify-content: center;
    gap: 9px;
    padding: 20px 0 4px;
}
#shop-apple .sa-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #c7c7cc;
    cursor: pointer;
    transition: width .25s, background .25s;
}
#shop-apple .sa-dot.is-active { width: 26px; background: var(--sa-brand); }

/* ---------- Tutti gli articoli ---------- */
#shop-apple .sa-all {
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 24px 24px;
    text-align: center;
}
#shop-apple .sa-all h2 {
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.02em;
}
#shop-apple .sa-all .sa-all-sub {
    max-width: 560px;
    margin: 12px auto 0;
    font-size: 18px;
    line-height: 1.45;
    color: var(--sa-muted);
}
#shop-apple .sa-tiles {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
#shop-apple .sa-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 30px;
    background: var(--sa-card);
    border-radius: 24px;
    color: var(--sa-ink);
    text-decoration: none;
    transition: transform .25s ease;
}
#shop-apple .sa-tile:hover { transform: translateY(-4px); }
#shop-apple .sa-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}
#shop-apple .sa-tile h3 {
    margin: 18px 0 0;
    font-size: 21px;
    font-weight: 700;
}
#shop-apple .sa-tile .sa-tile-price {
    margin: 8px 0 0;
    display: flex;
    gap: 8px;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 17px;
}
#shop-apple .sa-tile .sa-price-old { color: var(--sa-muted); font-size: 15px; }
#shop-apple .sa-tile .sa-price-off {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--sa-brand);
    padding: 1px 8px;
    border-radius: 999px;
}

/* ---------- Vantaggi ---------- */
#shop-apple .sa-perks {
    max-width: 1200px;
    margin: 0 auto;
    padding: 72px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
#shop-apple .sa-perk {
    background: var(--sa-card);
    border-radius: 24px;
    padding: 36px 30px 40px;
    text-align: left;
}
#shop-apple .sa-perk i {
    font-size: 26px;
    color: var(--sa-brand);
}
#shop-apple .sa-perk h3 {
    margin: 18px 0 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
}
#shop-apple .sa-perk p {
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--sa-muted);
}
#shop-apple .sa-perk p strong { font-weight: 700; color: var(--sa-ink); }

/* ---------- Banner scarsità ---------- */
#shop-apple .sa-scarcity {
    max-width: 1200px;
    margin: 0 auto 72px;
    padding: 72px 24px;
    /* background: var(--sa-brand); */
    background-image: url(img/banner/b10.webp);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 28px;
    text-align: center;
    color: #fff;
}
#shop-apple .sa-scarcity h2 {
    color: #fff;
    font-size: clamp(30px, 4.4vw, 50px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.02em;
}
#shop-apple .sa-scarcity p {
    color: rgba(255, 255, 255, .85);
    margin: 14px auto 28px;
    max-width: 520px;
    font-size: 18px;
    line-height: 1.45;
}

/* ---------- Focus tastiera ---------- */
#shop-apple a:focus-visible,
#shop-apple button:focus-visible,
#shop-apple .sa-track:focus-visible {
    outline: 3px solid var(--sa-brand);
    outline-offset: 3px;
}

/* ---------- Shop chiuso (overlay già definito in style.css) ---------- */
#shop-apple .shop-lock .sa-content {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}
#shop-apple .shop-lock .sa-strip { position: static; }
#shop-apple .shop-lock .sa-content { min-height: 720px; }
#shop-apple .shop-mask-overlay { border-radius: 28px; }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 900px) {
    #shop-apple .sa-stage { padding: 0 12px; }
    #shop-apple .sa-slide { padding: 40px 28px 0; min-height: 600px; }
    #shop-apple .sa-arrow { width: 42px; height: 42px; font-size: 15px; }
    #shop-apple .sa-arrow--prev { left: 20px; }
    #shop-apple .sa-arrow--next { right: 20px; }
}
@media (max-width: 600px) {
    #shop-apple .sa-intro { padding: 36px 20px 20px; }
    #shop-apple .sa-strip-list { justify-content: flex-start; width: 100%; padding: 0 8px; }
    #shop-apple .sa-strip-item { min-width: 84px; padding: 10px 10px 8px; }
    #shop-apple .sa-strip-item img { width: 44px; height: 44px; }
    #shop-apple .sa-stage { margin-top: 14px; }
    #shop-apple .sa-track { border-radius: 22px; }
    #shop-apple .sa-slide { padding: 32px 16px 0; min-height: 560px; }
    #shop-apple .sa-visual { aspect-ratio: 4 / 3; }
    #shop-apple .sa-arrow { top: 50%; width: 38px; height: 38px; }
    #shop-apple .sa-arrow--prev { left: 18px; }
    #shop-apple .sa-arrow--next { right: 18px; }
    #shop-apple .sa-all { padding-top: 64px; }
    #shop-apple .sa-perks { padding: 48px 12px; }
    #shop-apple .sa-all { padding-left: 12px; padding-right: 12px; }
    #shop-apple .sa-scarcity { margin: 0 12px 48px; padding: 56px 20px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    #shop-apple * { transition: none !important; }
}