/*
 * KSATRIA store: product detail page (/store/:slug).
 * Page-scoped on top of store.css. Uses only --st-* tokens from store.css;
 * no tokens are redefined here. Class prefix: .sp-
 */

.sp-page [hidden] {
    display: none !important;
}

.sp-main {
    padding: 24px 0 24px;
    outline: none;
}

/* ---------------------------------------------------------------- */
/* Breadcrumb                                                        */
/* ---------------------------------------------------------------- */
.sp-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    color: var(--st-muted);
    font-size: 14px;
}

.sp-crumbs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sp-crumbs li + li::before {
    content: '/';
    color: var(--st-subtle);
}

.sp-crumbs a {
    color: var(--st-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sp-crumbs a:hover {
    color: var(--st-ink);
}

.sp-crumbs [aria-current="page"] {
    overflow: hidden;
    max-width: 42ch;
    color: var(--st-ink-2);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Layout                                                            */
/* ---------------------------------------------------------------- */
.sp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 48px;
    align-items: start;
}

.sp-content {
    min-width: 0;
}

.sp-aside {
    position: sticky;
    top: var(--sp-sticky-top, 100px);
    min-width: 0;
}

/* ---------------------------------------------------------------- */
/* Media                                                             */
/* ---------------------------------------------------------------- */
.sp-art {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    border-radius: var(--st-radius);
}

.sp-art__icon {
    width: 104px;
    height: 104px;
    border-radius: 28px;
}

.sp-art__icon svg {
    width: 46px;
    height: 46px;
    stroke-width: 1.5;
}


.sp-gallery {
    display: grid;
    gap: 12px;
}

.sp-gallery__main {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: var(--st-surface);
}

.sp-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-gallery__thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.sp-thumb {
    flex: none;
    width: 88px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--st-surface);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.sp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-thumb[aria-pressed="true"] {
    border-color: var(--st-ink);
    opacity: 1;
}

.sp-thumb:focus-visible {
    outline: 2px solid var(--st-violet);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------- */
/* Title + facts                                                     */
/* ---------------------------------------------------------------- */
.sp-head {
    margin-top: 32px;
}

.sp-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.sp-title {
    max-width: 22ch;
    color: var(--st-ink);
    font-family: var(--st-font);
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.sp-facts {
    margin-top: 28px;
}

.sp-facts__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius-sm);
    background: var(--st-surface);
}

.sp-fact {
    min-width: 0;
    padding: 16px 18px;
}

.sp-fact + .sp-fact {
    border-left: 1px solid var(--st-line);
}

.sp-fact dt {
    color: var(--st-muted);
    font-size: 12px;
    font-weight: 500;
}

.sp-fact dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: var(--st-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.sp-avail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sp-avail::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--st-success);
}

.sp-avail--low::before {
    background: var(--st-warn);
}

.sp-avail--out::before {
    background: var(--st-danger);
}

/* ---------------------------------------------------------------- */
/* Content sections                                                  */
/* ---------------------------------------------------------------- */
.sp-section {
    margin-top: 56px;
}

.sp-h2 {
    margin-bottom: 18px;
    color: var(--st-ink);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.sp-prose {
    display: grid;
    gap: 14px;
    max-width: 66ch;
    color: var(--st-ink-2);
    font-size: 16px;
    line-height: 1.7;
}

/* How it works: horizontal 4-step timeline with a connecting rail. */
.sp-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: sp-step;
}

.sp-steps::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(90deg, var(--st-line-strong) 0 60%, transparent);
}

.sp-step {
    position: relative;
    counter-increment: sp-step;
}

.sp-step__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--st-line);
    border-radius: 14px;
    background: var(--st-surface);
    box-shadow: var(--st-shadow-sm);
    color: var(--st-ink);
}

.sp-step__icon svg {
    width: 20px;
    height: 20px;
}

.sp-step:first-child .sp-step__icon {
    border-color: transparent;
    background: var(--st-ink);
    color: #fff;
}

.sp-step h3 {
    margin: 16px 0 6px;
    color: var(--st-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.sp-step h3::before {
    content: counter(sp-step) '. ';
    color: var(--st-subtle);
    font-variant-numeric: tabular-nums;
}

.sp-step p {
    color: var(--st-muted);
    font-size: 14px;
    line-height: 1.55;
}

.sp-content .st-faq a {
    color: var(--st-violet);
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- */
/* Purchase panel                                                    */
/* ---------------------------------------------------------------- */
.sp-panel {
    padding: 24px 26px 18px;
    box-shadow: var(--st-shadow);
}

.sp-panel__price {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--st-line);
}

.sp-price {
    gap: 6px 12px;
}

.sp-price .st-price__amount {
    font-size: 36px;
    letter-spacing: -0.035em;
}

.sp-price .st-price__was {
    font-size: 15px;
}

.sp-price .st-price__cadence {
    margin-top: 2px;
    font-size: 14px;
}

.sp-price-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 8px;
    color: var(--st-muted);
    font-size: 14px;
}

.sp-price-meta .st-badge {
    height: 24px;
}

.sp-avail-line {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--st-success);
    font-weight: 500;
}

.sp-avail-line svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.sp-avail-line--low {
    color: var(--st-warn);
}

.sp-avail-line--out {
    color: var(--st-danger);
}

.sp-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.sp-fields {
    display: grid;
    gap: 12px;
}

.sp-fields .st-field {
    gap: 5px;
}

.sp-fields .st-input {
    height: 44px;
}

/* Optional notes behind a disclosure keeps the panel within one viewport. */
.sp-notes summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--st-ink-2);
    font-size: 14px;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}

.sp-notes summary::-webkit-details-marker {
    display: none;
}

.sp-notes summary svg {
    width: 16px;
    height: 16px;
    color: var(--st-violet);
    transition: transform 0.25s var(--st-ease);
}

.sp-notes[open] summary svg {
    transform: rotate(45deg);
}

.sp-notes summary:focus-visible {
    outline: 2px solid var(--st-violet);
    outline-offset: 2px;
    border-radius: 6px;
}

.sp-notes .st-field {
    margin-top: 8px;
}

.sp-fields textarea.st-input {
    height: auto;
    min-height: 84px;
}

.sp-count {
    justify-self: end;
    font-size: 12px;
}

.sp-fields .st-field:last-child {
    gap: 6px;
}

/* Quantity stepper */
.sp-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sp-qty__label {
    display: grid;
    line-height: 1.3;
}

.sp-qty__label .st-help {
    font-size: 12px;
}

.sp-stepper {
    display: inline-grid;
    grid-template-columns: 42px 52px 42px;
    align-items: center;
    height: 44px;
    border: 1px solid var(--st-line-strong);
    border-radius: 999px;
    background: var(--st-surface);
}

.sp-stepper:focus-within {
    border-color: var(--st-violet);
    box-shadow: 0 0 0 4px rgba(91, 63, 214, 0.14);
}

.sp-stepper__btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--st-ink);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s var(--st-ease);
}

.sp-stepper__btn svg {
    width: 18px;
    height: 18px;
}

.sp-stepper__btn:hover:not(:disabled) {
    background: var(--st-bg-tint);
}

.sp-stepper__btn:active:not(:disabled) {
    transform: scale(0.92);
}

.sp-stepper__btn:disabled {
    color: var(--st-subtle);
    cursor: not-allowed;
}

.sp-stepper__btn:focus-visible {
    outline: 2px solid var(--st-violet);
    outline-offset: -2px;
}

.sp-stepper__input {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--st-ink);
    font: 600 16px/1 var(--st-font);
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.sp-stepper__input:focus {
    outline: none;
}

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

/* Summary */
.sp-summary {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--st-radius-sm);
    background: var(--st-bg);
    font-size: 14px;
}

.sp-summary__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.sp-summary dt {
    color: var(--st-muted);
}

.sp-summary dd {
    margin: 0;
    color: var(--st-ink-2);
    text-align: right;
}

.sp-summary__x {
    color: var(--st-muted);
}

.sp-summary__row--save dd {
    color: var(--st-success);
    font-weight: 500;
}

.sp-summary__row--total {
    align-items: center;
}

.sp-summary__row--total dt {
    display: grid;
    color: var(--st-ink);
    font-weight: 600;
    line-height: 1.3;
}

.sp-summary__row--total .sp-summary__x {
    color: var(--st-muted);
    font-size: 12px;
    font-weight: 400;
}

.sp-summary__row--total dd {
    color: var(--st-ink);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Pay button with loading state */
.sp-pay {
    position: relative;
    padding: 0 20px;
}

.sp-pay__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-pay__spinner {
    display: none;
    width: 18px;
    height: 18px;
    flex: none;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 0.8s linear infinite;
}

.sp-pay.is-loading .sp-pay__spinner {
    display: inline-block;
}

.sp-pay.is-loading:disabled {
    background: var(--st-ink-2);
    cursor: progress;
}

@keyframes sp-spin {
    to {
        transform: rotate(360deg);
    }
}

.sp-secure {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin-top: -4px !important;
    color: var(--st-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

.sp-secure svg {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 1px;
    color: var(--st-success);
}

/* Trust facts under the timeline (allowed copy only, see spec). */
.sp-assure {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.sp-assure li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--st-radius-sm);
    background: var(--st-bg-tint);
    color: var(--st-ink-2);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.sp-assure svg {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
    color: var(--st-violet);
}

.sp-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    justify-self: center;
    min-height: 36px;
    margin-top: -6px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--st-ink-2) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.sp-wa svg {
    width: 18px;
    height: 18px;
}

.sp-wa:hover {
    background: var(--st-bg-tint);
}

.sp-wa:focus-visible,
.sp-link:focus-visible,
.sp-copy:focus-visible,
.sp-icon-btn:focus-visible,
.sp-rel:focus-visible,
.sp-crumbs a:focus-visible {
    outline: 2px solid var(--st-violet);
    outline-offset: 2px;
}

.sp-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--st-violet);
    font: 600 14px/1.4 var(--st-font);
    text-decoration: underline;
    text-decoration-color: rgba(91, 63, 214, 0.35);
    text-underline-offset: 4px;
    cursor: pointer;
}

.sp-link:hover {
    text-decoration-color: currentColor;
}

/* Pending order note inside the panel */
.sp-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--st-violet-soft);
    font-size: 13px;
}

.sp-pending__text {
    display: grid;
    min-width: 0;
}

.sp-pending__text strong {
    color: var(--st-ink);
    font-weight: 600;
}

.sp-pending__text span {
    overflow-wrap: anywhere;
    color: var(--st-muted);
}

/* Out of stock */
.sp-panel.is-disabled .sp-panel__price {
    opacity: 0.6;
}

.sp-out {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.sp-out p {
    color: var(--st-muted);
    font-size: 14px;
}

/* ---------------------------------------------------------------- */
/* Related                                                           */
/* ---------------------------------------------------------------- */
.sp-related {
    margin-top: 88px;
    padding: 56px 0 8px;
    border-top: 1px solid var(--st-line);
}

.sp-related__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.sp-related__head .st-h2 {
    font-size: clamp(22px, 2.4vw, 28px);
}

.sp-related__head .sp-link {
    text-decoration: none;
}

.sp-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sp-rel {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: var(--st-surface);
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s var(--st-ease), box-shadow 0.3s var(--st-ease), border-color 0.2s ease;
}

.sp-rel:hover {
    transform: translateY(-2px);
    border-color: var(--st-line-strong);
    box-shadow: var(--st-shadow-lg);
}

.sp-rel__art {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    color: var(--st-ink);
}

.sp-rel__art svg {
    width: 26px;
    height: 26px;
}

.sp-rel__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sp-rel__cat {
    color: var(--st-muted);
    font-size: 12px;
}

.sp-rel__name {
    overflow: hidden;
    color: var(--st-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sp-rel__price {
    margin-top: 2px;
    color: var(--st-ink-2);
    font-size: 14px;
    font-weight: 600;
}

.sp-rel__price s {
    margin-left: 6px;
    color: var(--st-subtle);
    font-weight: 400;
}

.sp-rel__arrow {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--st-line-strong);
    border-radius: 999px;
    color: var(--st-ink);
    transition: transform 0.3s var(--st-ease), background-color 0.2s ease, color 0.2s ease;
}

.sp-rel__arrow svg {
    width: 16px;
    height: 16px;
}

.sp-rel:hover .sp-rel__arrow {
    transform: translateX(3px);
    border-color: var(--st-ink);
    background: var(--st-ink);
    color: #fff;
}

/* ---------------------------------------------------------------- */
/* Not found / closed / error                                        */
/* ---------------------------------------------------------------- */
.sp-state {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: 48px;
    margin: 8px 0 40px;
    padding: 24px;
}

.sp-state__art {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
}

.sp-state__copy {
    padding: 16px 24px 16px 0;
}

.sp-state__title {
    color: var(--st-ink);
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.sp-state__copy p {
    max-width: 46ch;
    margin-top: 14px;
    color: var(--st-muted);
    font-size: 16px;
}

.sp-state__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* ---------------------------------------------------------------- */
/* Skeleton                                                          */
/* ---------------------------------------------------------------- */
.sp-sk--crumb {
    display: inline-block;
    width: 160px;
    height: 14px;
}

.sp-sk--art {
    aspect-ratio: 16 / 9;
    border-radius: var(--st-radius);
}

.sp-sk--badge {
    width: 140px;
    height: 26px;
    margin-top: 32px;
    border-radius: 999px;
}

.sp-sk--title {
    width: 80%;
    height: 40px;
    margin-top: 14px;
}

.sp-sk--short {
    width: 45%;
    margin-top: 10px;
}

.sp-sk-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
}

.sp-sk--tile {
    height: 70px;
    border-radius: var(--st-radius-sm);
}

.sp-panel--skeleton {
    display: grid;
    gap: 16px;
    padding: 28px;
}

.sp-sk--price {
    width: 60%;
    height: 40px;
}

.sp-sk--line {
    width: 40%;
    height: 16px;
}

.sp-sk--field {
    height: 46px;
    border-radius: 12px;
}

.sp-sk--btn {
    height: 56px;
    border-radius: 999px;
}

/* ---------------------------------------------------------------- */
/* Mobile bottom bar                                                 */
/* ---------------------------------------------------------------- */
.sp-bar {
    display: none;
}

/* ---------------------------------------------------------------- */
/* QRIS dialog                                                       */
/* ---------------------------------------------------------------- */
.sp-modal {
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 24px;
    background: var(--st-surface);
    box-shadow: 0 40px 100px -30px rgba(38, 24, 94, 0.5);
    color: var(--st-ink-2);
    overscroll-behavior: contain;
}

.sp-modal::backdrop {
    background: rgba(17, 16, 19, 0.48);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sp-modal[open] {
    animation: sp-modal-in 0.32s var(--st-ease);
}

@keyframes sp-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
}

html.sp-modal-open {
    overflow: hidden;
}

.sp-modal__inner {
    padding: 24px 28px 28px;
}

.sp-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sp-modal__title {
    color: var(--st-ink);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.sp-icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--st-ink);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sp-icon-btn:hover {
    background: var(--st-bg-tint);
}

.sp-icon-btn svg {
    width: 20px;
    height: 20px;
}

.sp-modal__body {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}

.sp-modal__amount {
    color: var(--st-ink);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.sp-status {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 8px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.sp-status--wait {
    background: var(--st-violet-soft);
    color: var(--st-violet);
}

.sp-status--ok {
    justify-self: center;
    background: var(--st-success-soft);
    color: var(--st-success);
}

.sp-status--bad {
    background: var(--st-danger-soft);
    color: var(--st-danger);
}

/* Live indicator: conveys real polling state, so the dot is semantic. */
.sp-status__pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
    .sp-status__pulse::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: currentColor;
        animation: sp-pulse 1.6s var(--st-ease) infinite;
    }
}

@keyframes sp-pulse {
    from {
        opacity: 0.6;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(2.6);
    }
}

.sp-qr {
    display: grid;
    place-items: center;
    margin: 0;
    padding: 20px;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: #fff;
    box-shadow: inset 0 0 0 6px var(--st-bg);
}

.sp-qr img {
    width: 100%;
    max-width: 240px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    image-rendering: pixelated;
}

.sp-qr--empty {
    gap: 12px;
    padding: 32px 24px;
    text-align: center;
}

.sp-qr--empty svg {
    width: 40px;
    height: 40px;
    color: var(--st-subtle);
}

.sp-qr--empty p {
    max-width: 30ch;
    color: var(--st-ink-2);
    font-size: 14px;
    font-weight: 500;
}

.sp-ordno {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 12px;
    padding: 12px 12px 12px 16px;
    border-radius: var(--st-radius-sm);
    background: var(--st-bg);
}

.sp-ordno__label {
    grid-column: 1;
    color: var(--st-muted);
    font-size: 12px;
}

.sp-ordno__value {
    grid-column: 1;
    overflow-wrap: anywhere;
    color: var(--st-ink);
    font: 600 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sp-copy {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--st-line-strong);
    border-radius: 999px;
    background: var(--st-surface);
    color: var(--st-ink);
    font: 600 13px/1 var(--st-font);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.sp-copy svg {
    width: 16px;
    height: 16px;
}

.sp-copy:hover {
    border-color: var(--st-ink);
}

.sp-copy.is-done {
    border-color: var(--st-success);
    color: var(--st-success);
}

.sp-howto {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: sp-howto;
    font-size: 14px;
}

.sp-howto li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: baseline;
    gap: 10px;
    counter-increment: sp-howto;
}

.sp-howto li::before {
    content: counter(sp-howto);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--st-bg-tint);
    color: var(--st-ink);
    font-size: 12px;
    font-weight: 600;
    transform: translateY(-1px);
}

.sp-modal__note,
.sp-modal__desc {
    color: var(--st-muted);
    font-size: 13px;
    line-height: 1.5;
}

.sp-modal__desc {
    font-size: 14px;
}

.sp-modal__actions {
    display: grid;
    gap: 10px;
}

.sp-modal .st-btn--ghost svg {
    width: 16px;
    height: 16px;
}

.sp-done {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.sp-done .sp-ordno {
    width: 100%;
    text-align: left;
}

.sp-done__check {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: var(--st-success);
    color: #fff;
    box-shadow: 0 0 0 8px var(--st-success-soft);
}

.sp-done__check svg {
    width: 30px;
    height: 30px;
    stroke-width: 2.25;
}

@media (prefers-reduced-motion: no-preference) {
    .sp-done__check {
        animation: sp-pop 0.5s var(--st-ease);
    }
}

@keyframes sp-pop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .sp-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 36px;
    }

    .sp-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 28px;
    }

    .sp-steps::before {
        display: none;
    }

    .sp-assure {
        grid-template-columns: minmax(0, 1fr);
    }

    .sp-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sp-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .sp-aside {
        position: static;
        scroll-margin-top: 88px;
    }

    .sp-panel {
        scroll-margin-top: 88px;
    }

    .sp-sk-tiles,
    .sp-facts__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-fact:nth-child(3) {
        border-left: 0;
    }

    .sp-fact:nth-child(n + 3) {
        border-top: 1px solid var(--st-line);
    }

    .sp-state {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .sp-state__art {
        aspect-ratio: 16 / 9;
    }

    .sp-state__copy {
        padding: 0 8px 16px;
    }

    /* Bottom bar */
    .sp-bar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--st-line);
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        box-shadow: 0 -12px 32px -20px rgba(38, 24, 94, 0.35);
        transform: translateY(110%);
        visibility: hidden;
        transition: transform 0.35s var(--st-ease), visibility 0s linear 0.35s;
    }

    .sp-bar.is-visible {
        transform: none;
        visibility: visible;
        transition: transform 0.35s var(--st-ease), visibility 0s;
    }

    .sp-bar__price {
        display: grid;
        min-width: 0;
        line-height: 1.2;
    }

    .sp-bar__label {
        color: var(--st-muted);
        font-size: 12px;
    }

    .sp-bar__amount {
        overflow: hidden;
        color: var(--st-ink);
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.02em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sp-bar .st-btn {
        flex: none;
        height: 46px;
    }

    body.has-sp-bar .st-footer {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 767.98px) {
    .sp-main {
        padding-top: 16px;
    }

    .sp-crumbs ol {
        margin-bottom: 16px;
        font-size: 13px;
    }

    .sp-crumbs [aria-current="page"] {
        max-width: 24ch;
    }

    .sp-art__icon {
        width: 80px;
        height: 80px;
        border-radius: 22px;
    }

    .sp-art__icon svg {
        width: 36px;
        height: 36px;
    }


    .sp-head {
        margin-top: 24px;
    }

    .sp-section {
        margin-top: 44px;
    }

    /* Timeline becomes a vertical rail. */
    .sp-steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .sp-step {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        column-gap: 16px;
        padding-bottom: 22px;
    }

    .sp-step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 48px;
        bottom: 4px;
        left: 22px;
        width: 1px;
        background: var(--st-line-strong);
    }

    .sp-step__icon {
        grid-row: 1 / span 2;
    }

    .sp-step h3 {
        margin: 2px 0 4px;
    }

    .sp-panel {
        padding: 22px 20px;
    }

    .sp-price .st-price__amount {
        font-size: 32px;
    }

    .sp-related {
        margin-top: 64px;
        padding-top: 40px;
    }

    .sp-related__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .sp-state {
        padding: 16px;
    }

    .sp-state__actions .st-btn {
        flex: 1 1 100%;
    }

    .sp-modal {
        width: 100%;
        max-height: calc(100dvh - 24px);
        margin: auto 0 0;
        border-radius: 24px 24px 0 0;
    }

    .sp-modal__inner {
        padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    }

    .sp-modal__amount {
        font-size: 30px;
    }
}

@media (max-width: 380px) {
    .sp-fact {
        padding: 14px;
    }

    .sp-bar .st-btn {
        padding: 0 18px;
    }
}
