/* ==========================================================
   ShopNova – homepage product spotlight
   Self-contained: every class is prefixed with .sn-
   Theme colours are switched by js/shopnova-section.js
   ========================================================== */

.sn-section {
    --sn-bg: #0a2540;
    --sn-line: rgba(255, 255, 255, 0.12);
    --sn-text: #ffffff;
    --sn-muted: rgba(255, 255, 255, 0.68);
    --sn-faint: rgba(255, 255, 255, 0.45);
    /* theme-driven (defaults = ShopNova) */
    --sn-tint: #fbefe6;
    --sn-ring: #f07a5f;
    --sn-panel-ink: #1a1a2e;
    --sn-panel-muted: rgba(26, 26, 46, 0.62);

    position: relative;
    padding: 110px 0 100px;
    background: var(--sn-bg);
    color: var(--sn-text);
    overflow: hidden;
}

.sn-section *:focus-visible {
    outline: 2px solid var(--sn-ring);
    outline-offset: 3px;
}

/* ---------- top: intro + stage ---------- */
.sn-wrap {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
    align-items: center;
}

.sn-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.sn-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #d4492f;
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.sn-brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.sn-brand-kind {
    padding-left: 12px;
    border-left: 1px solid var(--sn-line);
    color: var(--sn-muted);
    font-size: 0.875rem;
}

.sn-intro h2 {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 700;
    margin-bottom: 20px;
    max-width: 14ch;
}

.sn-lead {
    color: var(--sn-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 46ch;
    margin-bottom: 32px;
}

.sn-points {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    border-top: 1px solid var(--sn-line);
}

.sn-points li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--sn-line);
    font-size: 0.925rem;
    line-height: 1.55;
    color: var(--sn-muted);
}

.sn-points i {
    margin-top: 3px;
    color: var(--sn-ring);
    font-size: 0.95rem;
    transition: color 0.5s ease;
}

.sn-points strong {
    display: block;
    color: #fff;
    font-weight: 600;
}

/* PageSpeed rings */
.sn-speed {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 34px;
}

.sn-ring {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sn-ring svg {
    width: 48px;
    height: 48px;
    transform: rotate(-90deg);
}

.sn-ring circle {
    fill: none;
    stroke-width: 4;
}

.sn-ring .sn-ring-track { stroke: rgba(12, 206, 107, 0.18); }
.sn-ring .sn-ring-value { stroke: #0cce6b; stroke-linecap: round; }

.sn-ring-num {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.sn-ring-num span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0cce6b;
    font-variant-numeric: tabular-nums;
}

.sn-ring-label {
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--sn-muted);
}

.sn-ring-label b {
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

.sn-speed-src {
    font-size: 0.75rem;
    color: var(--sn-faint);
    max-width: 20ch;
    line-height: 1.35;
}

/* Buttons */
.sn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sn-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sn-btn--solid {
    background: #fff;
    color: #0a2540;
}

.sn-btn--solid:hover { background: #e8eef6; }

.sn-btn--line {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
}

.sn-btn--line:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sn-btn i { font-size: 0.8rem; }

/* ---------- stage (browser preview) ---------- */
.sn-panel {
    background: var(--sn-tint);
    border-radius: 22px;
    padding: 28px 28px 18px;
    transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

.sn-section[data-panel="dark"] .sn-panel {
    box-shadow: inset 0 0 0 1px rgba(183, 243, 59, 0.22);
}

.sn-browser {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 24px 50px -18px rgba(10, 37, 64, 0.45);
}

.sn-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 40px;
    padding: 0 14px;
    background: #f1f3f6;
    border-bottom: 1px solid #e3e7ec;
}

.sn-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.sn-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d5dae1;
}

.sn-url {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    padding: 0 12px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid #e3e7ec;
    color: #5b6573;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sn-url i { color: #0cce6b; font-size: 0.7rem; }

.sn-screen {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f6f6f6;
    cursor: ns-resize;
}

.sn-shot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: block;
    transform: translateY(0);
    transition-property: transform, opacity;
    transition-duration: 1s, 0.25s;
    transition-timing-function: cubic-bezier(0.45, 0, 0.25, 1), ease;
    will-change: transform;
}

.sn-shot.is-switching { opacity: 0; }

.sn-caption {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    color: var(--sn-panel-ink);
    transition: color 0.6s ease;
}

.sn-cap-name {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sn-cap-desc {
    display: block;
    font-size: 0.85rem;
    color: var(--sn-panel-muted);
    transition: color 0.6s ease;
}

.sn-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--sn-panel-muted);
    white-space: nowrap;
}

/* ---------- theme picker ---------- */
.sn-themes {
    margin-top: 72px;
    padding-top: 40px;
    border-top: 1px solid var(--sn-line);
}

.sn-themes-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.sn-themes-head h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.sn-themes-head p {
    margin: 0;
    color: var(--sn-muted);
    font-size: 0.9rem;
    max-width: 52ch;
    text-align: right;
}

.sn-theme-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 14px;
}

.sn-theme {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 8px 12px;
    border: 1px solid var(--sn-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.sn-theme:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.sn-theme.is-active {
    border-color: var(--sn-ring);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 0 1px var(--sn-ring);
}

.sn-theme-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.sn-theme-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.sn-theme-name {
    display: block;
    padding: 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.sn-theme-sector {
    display: block;
    padding: 0 4px;
    margin-top: -6px;
    font-size: 0.75rem;
    color: var(--sn-faint);
}

/* "+5 more" tile */
.sn-theme--more .sn-theme-thumb {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
}

.sn-more-stack img {
    position: absolute;
    width: 62%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    object-fit: cover;
}

.sn-more-stack img:nth-child(1) { left: 6%;  top: 10%; }
.sn-more-stack img:nth-child(2) { left: 20%; top: 22%; }
.sn-more-stack img:nth-child(3) { left: 34%; top: 34%; }

.sn-theme--more .sn-theme-name i {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.7;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .sn-wrap { gap: 44px; }
    .sn-theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .sn-section { padding: 80px 0 72px; }
    .sn-wrap { grid-template-columns: 1fr; }
    .sn-intro h2 { max-width: 18ch; }
    .sn-themes { margin-top: 56px; }
    .sn-themes-head { flex-direction: column; gap: 6px; }
    .sn-themes-head p { text-align: left; }
}

@media (max-width: 640px) {
    .sn-panel { padding: 14px 14px 12px; border-radius: 16px; }
    .sn-bar { height: 34px; }
    .sn-dots { display: none; }
    .sn-hint { display: none; }
    .sn-brand-kind { display: none; }
    .sn-speed { flex-wrap: wrap; gap: 16px; }
    .sn-speed-src { max-width: none; flex-basis: 100%; }
    .sn-btn { flex: 1 1 auto; justify-content: center; }

    /* horizontal, swipeable picker */
    .sn-theme-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 10px;
        margin: 0 -1.5rem;
        padding: 2px 1.5rem 10px;
        scroll-padding-left: 1.5rem;
        scrollbar-width: none;
    }
    .sn-theme-grid::-webkit-scrollbar { display: none; }
    .sn-theme {
        flex: 0 0 42%;
        scroll-snap-align: start;
    }
}

/* Touch devices: the preview is scrolled by the finger, not by hover */
@media (hover: none) {
    .sn-screen {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        cursor: auto;
    }
    .sn-shot {
        position: static;
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sn-panel,
    .sn-caption,
    .sn-cap-desc,
    .sn-points i { transition: none; }
    .sn-screen { overflow-y: auto; }
    .sn-shot {
        position: static;
        transform: none !important;
        transition: none;
    }
}
