/* ============================================================
   SHARE PAGE - minimalis, modern, halus
   ============================================================ */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --muted: #6b7280;
    --line: #e8eaee;
    --accent: #2563eb;
    --accent-ink: #ffffff;
    --danger: #e11d48;
    --success: #059669;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .14);
    --radius: 20px;
    --radius-sm: 12px;
    --skel-a: #eceef1;
    --skel-b: #f6f7f9;
    --ease: cubic-bezier(.22, .8, .28, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0e15;
        --surface: #121824;
        --surface-2: #171f2e;
        --text: #e9eef6;
        --muted: #93a1b5;
        --line: #202b3c;
        --accent: #3b82f6;
        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -18px rgba(0, 0, 0, .8);
        --skel-a: #1a2231;
        --skel-b: #222c3e;
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------------- topbar ---------------- */
.sp-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease);
}

.sp-topbar.is-stuck {
    border-bottom-color: var(--line);
}

.sp-topbar__inner {
    max-width: 620px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sp-brand__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
    flex: none;
}

.sp-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.sp-brand__text strong {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -.01em;
}

.sp-brand__text small {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sp-iconbtn {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}

.sp-iconbtn:hover {
    background: var(--surface-2);
}

.sp-iconbtn:active {
    transform: scale(.94);
}

/* ---------------- layout ---------------- */
.sp-main {
    max-width: 620px;
    margin: 0 auto;
    padding: 14px 18px calc(104px + env(safe-area-inset-bottom));
}

.sp-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sp-card__body {
    padding: 20px;
}

/* ---------------- media ---------------- */
.sp-media {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
}

.sp-media__ph {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, var(--skel-a) 30%, var(--skel-b) 50%, var(--skel-a) 70%);
    background-size: 220% 100%;
    animation: sp-shimmer 1.25s linear infinite;
    transition: opacity .45s var(--ease);
}

.sp-media__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.03);
    filter: blur(10px);
    transition: opacity .55s var(--ease), transform .8s var(--ease), filter .55s var(--ease);
}

.sp-media.is-ready .sp-media__img {
    opacity: 1;
    transform: none;
    filter: none;
}

.sp-media.is-ready .sp-media__ph {
    opacity: 0;
}

.sp-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 12px;
    font-weight: 650;
    padding: 5px 10px;
    border-radius: 999px;
    letter-spacing: .01em;
    backdrop-filter: blur(6px);
}

.sp-badge--discount {
    background: var(--danger);
    color: #fff;
}

.sp-badge--soldout {
    left: auto;
    right: 12px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
}

/* ---------------- teks ---------------- */
.sp-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: -.02em;
}

.sp-pricerow {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sp-price {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.03em;
}

.sp-price-old {
    font-size: 14px;
    color: var(--muted);
    text-decoration: line-through;
}

.sp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.sp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 11px;
}

.sp-chip strong {
    color: var(--text);
    font-weight: 600;
}

.sp-chip--ok strong {
    color: var(--success);
}

.sp-chip--off strong {
    color: var(--danger);
}

.sp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

@media (max-width:340px) {
    .sp-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sp-stat {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
}

.sp-stat b {
    display: block;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.sp-stat span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

.sp-section {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 4px;
}

.sp-section__title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.sp-desc {
    font-size: 14.5px;
    color: color-mix(in srgb, var(--text) 88%, transparent);
    white-space: pre-line;
    word-break: break-word;
}

.sp-desc p {
    margin: 0 0 8px;
}

/* ---------------- seller ---------------- */
.sp-seller {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: transform .2s var(--ease), border-color .2s var(--ease);
}

.sp-seller__icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    object-fit: cover;
    background: var(--line);
    flex: none;
}

.sp-seller__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sp-seller__info strong {
    font-size: 14.5px;
    font-weight: 620;
}

.sp-seller__info small {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- action bar ---------------- */
.sp-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    animation: sp-slide-up .45s var(--ease) both;
}

.sp-actionbar__inner {
    max-width: 620px;
    margin: 0 auto;
    padding: 11px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-actionbar__price {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    margin-right: auto;
    min-width: 0;
}

.sp-actionbar__price small {
    font-size: 11px;
    color: var(--muted);
}

.sp-actionbar__price strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 44px;
    padding: 0 20px;
    border-radius: 13px;
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 620;
    font-family: inherit;
    cursor: pointer;
    transition: transform .18s var(--ease), opacity .18s var(--ease), background .18s var(--ease);
}

.sp-btn:active {
    transform: scale(.97);
}

.sp-btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}

.sp-btn--ghost {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text);
}

.sp-btn--icon {
    width: 44px;
    padding: 0;
}

.sp-btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}

/* ---------------- tombol download aplikasi ---------------- */
.sp-cta {
    margin-top: 18px;
}

.sp-btn--store {
    width: 100%;
    height: 48px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
    color: var(--accent);
    font-weight: 640;
}

.sp-btn--store:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.sp-btn--store svg {
    flex: none;
}

/* ---------------- state kosong / error ---------------- */
.sp-state {
    text-align: center;
    padding: 56px 24px;
    animation: sp-fade-up .5s var(--ease) both;
}

.sp-state__icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
}

.sp-state__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 650;
}

.sp-state__text {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

/* ---------------- toast ---------------- */
.sp-toast {
    position: fixed;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom));
    transform: translate(-50%, 14px);
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s var(--ease), transform .28s var(--ease);
    z-index: 40;
}

.sp-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------------- skeleton ---------------- */
.sk {
    background: linear-gradient(100deg, var(--skel-a) 30%, var(--skel-b) 50%, var(--skel-a) 70%);
    background-size: 220% 100%;
    animation: sp-shimmer 1.25s linear infinite;
    border-radius: 8px;
}

.sk-media {
    aspect-ratio: 4 / 3;
    border-radius: 0;
}

.sk-line {
    height: 13px;
    margin-bottom: 10px;
}

.sk-line.w100 {
    width: 100%;
}

.sk-line.w90 {
    width: 90%;
}

.sk-line.w70 {
    width: 70%;
}

.sk-line.w60 {
    width: 60%;
}

.sk-line.w40 {
    width: 40%;
}

.sk-price {
    height: 28px;
    width: 45%;
    border-radius: 10px;
    margin: 14px 0 18px;
}

.sk-chips {
    display: flex;
    gap: 7px;
    margin-bottom: 18px;
}

.sk-chip {
    height: 28px;
    width: 96px;
    border-radius: 999px;
}

.sk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 22px;
}

@media (max-width:340px) {
    .sk-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sk-box {
    height: 56px;
    border-radius: 12px;
}

.sk-seller {
    height: 66px;
    border-radius: 12px;
    margin-top: 18px;
}

.sk-cta {
    height: 48px;
    border-radius: 13px;
    margin-top: 18px;
}

/* ---------------- animasi ---------------- */
@keyframes sp-shimmer {
    from {
        background-position: 140% 0;
    }

    to {
        background-position: -40% 0;
    }
}

@keyframes sp-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes sp-slide-up {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.sp-content {
    animation: sp-fade-up .5s var(--ease) both;
}

.sp-content .sp-card__body>* {
    animation: sp-fade-up .5s var(--ease) both;
}

.sp-content .sp-card__body>*:nth-child(1) {
    animation-delay: .04s;
}

.sp-content .sp-card__body>*:nth-child(2) {
    animation-delay: .08s;
}

.sp-content .sp-card__body>*:nth-child(3) {
    animation-delay: .12s;
}

.sp-content .sp-card__body>*:nth-child(4) {
    animation-delay: .16s;
}

.sp-content .sp-card__body>*:nth-child(5) {
    animation-delay: .2s;
}

.sp-content .sp-card__body>*:nth-child(6) {
    animation-delay: .24s;
}

.sp-skeleton {
    animation: sp-fade-up .35s var(--ease) both;
}

.sp-skeleton.is-out {
    opacity: 0;
    transition: opacity .25s var(--ease);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
