@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&family=Fira+Code:wght@500;600;700&display=swap');

/* Design tokens: /assets/styles/theme-tokens.css */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background: var(--ap-bg-page);
    color: var(--ap-text-secondary);
    font-family: var(--ap-font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button {
    font-family: inherit;
    cursor: pointer;
}

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

/* ===================== Top bar ===================== */
.vt-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--ap-bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ap-border);
}

.vt-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ap-text-primary);
    font-weight: 700;
}

.vt-brand-img {
    width: 26px;
    height: 26px;
    border-radius: 7px;
}

.vt-brand-name {
    font-family: var(--ap-font-heading);
    font-size: 16px;
    letter-spacing: -0.01em;
}

.vt-secure-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ap-text-muted);
}

.vt-secure-chip svg {
    color: var(--ap-success);
}

/* ===================== Page ===================== */
.vt-page {
    flex: 1;
    display: grid;
    place-items: start center;
    padding: 40px 24px 80px;
}

.vt-product {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 48px;
    align-items: start;
}

/* ===================== Loading / Empty ===================== */
.vt-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.vt-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--ap-border);
    border-top-color: var(--ap-accent);
    border-radius: 50%;
    animation: vtSpin 0.7s linear infinite;
}

@keyframes vtSpin {
    to {
        transform: rotate(360deg);
    }
}

.vt-empty {
    text-align: center;
    padding: 100px 20px;
}

.vt-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.vt-empty h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ap-text-primary);
    margin-bottom: 8px;
}

.vt-empty p {
    color: var(--ap-text-muted);
    font-size: 14px;
}

/* ===================== Left column ===================== */
.vt-left {
    min-width: 0;
}

.vt-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.vt-category:empty {
    display: none;
    margin-bottom: 0;
}

.vt-category::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--ap-accent);
}

.vt-title {
    font-family: var(--ap-font-heading);
    font-size: 36px;
    font-weight: 700;
    color: var(--ap-text-primary);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 14px;
    text-wrap: balance;
}

.vt-desc {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ap-text-secondary);
    max-width: 60ch;
    text-wrap: pretty;
}

.vt-desc.clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vt-read-more {
    background: none;
    border: 0;
    padding: 0;
    margin-top: 8px;
    color: var(--ap-accent);
    font-weight: 600;
    font-size: 13.5px;
}

.vt-read-more:hover {
    text-decoration: underline;
}

/* ===================== Services ===================== */
.vt-services-section {
    margin-top: 40px;
}

.vt-services-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.vt-services-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.vt-services-count {
    font-size: 12.5px;
    color: var(--ap-text-muted);
    font-variant-numeric: tabular-nums;
}

.vt-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 12px;
    background: var(--ap-bg-card);
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    transition: border-color 0.15s;
}

.vt-search:focus-within {
    border-color: var(--ap-accent);
}

.vt-search svg {
    color: var(--ap-text-muted);
    flex-shrink: 0;
}

.vt-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 13.5px;
    color: var(--ap-text-primary);
    font-family: inherit;
}

.vt-search input::placeholder {
    color: var(--ap-text-placeholder);
}

.vt-services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.vt-services.scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.vt-services.scroll::-webkit-scrollbar {
    width: 6px;
}

.vt-services.scroll::-webkit-scrollbar-thumb {
    background: var(--ap-scrollbar-thumb);
    border-radius: 3px;
}

.vt-service {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--ap-bg-card);
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.vt-service:hover {
    border-color: var(--ap-border-hover);
    box-shadow: var(--ap-shadow-sm);
}

.vt-service-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--ap-bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vt-service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback letter icon — shown when image fails */
.vt-service-icon .vt-icon-letter {
    font-family: var(--ap-font-heading);
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    border-radius: 7px;
}

.vt-service-domain {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ap-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.vt-empty-search {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--ap-text-muted);
}

/* ===================== Checkout card ===================== */
.vt-checkout {
    position: sticky;
    top: 86px;
    background: var(--ap-bg-card);
    border: 1px solid var(--ap-border);
    border-radius: 16px;
    padding: 24px;
}

/* Price */
.vt-price-block {
    margin-bottom: 20px;
}

.vt-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}

.vt-price-currency {
    font-family: var(--ap-font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--ap-text-muted);
}

.vt-price-amount {
    font-family: var(--ap-font-heading);
    font-weight: 800;
    font-size: 36px;
    color: var(--ap-text-primary);
    letter-spacing: -0.025em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.vt-price-period {
    font-size: 13.5px;
    color: var(--ap-text-muted);
    font-weight: 500;
}

.vt-price-billing {
    font-size: 12.5px;
    color: var(--ap-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.vt-billing-dot {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.6;
}

/* Breakdown */
.vt-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    border-top: 1px solid var(--ap-border);
    border-bottom: 1px solid var(--ap-border);
    margin-bottom: 20px;
}

.vt-brk-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.vt-brk-lbl {
    color: var(--ap-text-muted);
}

.vt-brk-val {
    font-family: var(--ap-font-data);
    color: var(--ap-text-secondary);
    font-variant-numeric: tabular-nums;
}

.vt-brk-total {
    margin-top: 4px;
}

.vt-brk-total .vt-brk-lbl {
    color: var(--ap-text-primary);
    font-weight: 700;
    font-size: 14px;
}

.vt-brk-total .vt-brk-val {
    color: var(--ap-text-primary);
    font-weight: 700;
    font-size: 14px;
}

/* Stock */
.vt-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ap-text-secondary);
    margin-bottom: 16px;
}

.vt-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
    position: relative;
}

.vt-stock-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.22;
}

.vt-stock.ok .vt-stock-dot {
    background: var(--ap-success);
    color: var(--ap-success);
}

.vt-stock.warn .vt-stock-dot {
    background: var(--ap-warning);
    color: var(--ap-warning);
}

.vt-stock.out .vt-stock-dot {
    background: var(--ap-danger);
    color: var(--ap-danger);
}

.vt-stock b {
    color: var(--ap-text-primary);
    font-weight: 700;
}

.vt-stock.warn b {
    color: var(--ap-warning-text);
}

.vt-stock.out b {
    color: var(--ap-danger-text);
}

/* Stock progress (limited stock) */
.vt-stock-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.vt-stock-track {
    width: 100%;
    height: 5px;
    background: var(--ap-bg-muted);
    border-radius: 3px;
    overflow: hidden;
}

.vt-stock-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--ap-success);
    transition: width 0.5s ease;
}

.vt-stock-fill.warning {
    background: var(--ap-warning);
}

.vt-stock-fill.depleted {
    background: var(--ap-danger);
}

.vt-stock-label {
    font-size: 12px;
    color: var(--ap-text-muted);
}

.vt-stock-label strong {
    color: var(--ap-text-secondary);
    font-weight: 600;
}

/* CTA Button */
.vt-cta {
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--ap-accent);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s, opacity 0.15s, background 0.15s, box-shadow 0.15s;
}

.vt-cta:hover:not(:disabled) {
    background: var(--ap-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.3);
}

.vt-cta:active:not(:disabled) {
    transform: translateY(0);
}

.vt-cta:disabled {
    background: var(--ap-bg-muted);
    color: var(--ap-text-muted);
    cursor: not-allowed;
}

/* CTA sub-label */
.vt-cta-sub {
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--ap-text-muted);
    text-align: center;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.vt-cta-sub svg {
    color: var(--ap-success);
    flex-shrink: 0;
}

/* Seller */
.vt-seller {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ap-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.vt-seller-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ap-font-heading);
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.vt-seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.vt-seller-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.vt-seller-meta {
    font-size: 11.5px;
    color: var(--ap-text-muted) !important;
    margin-top: 1px;
}

/* ===================== Responsive ===================== */
@media (max-width: 880px) {
    .vt-product {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .vt-checkout {
        position: static;
    }

    .vt-title {
        font-size: 30px;
    }
}

@media (max-width: 600px) {
    .vt-page {
        padding: 24px 16px 48px;
    }

    .vt-topbar {
        padding: 12px 16px;
    }

    .vt-title {
        font-size: 26px;
    }

    .vt-price-amount {
        font-size: 32px;
    }
}

/* ===================== Reduced Motion ===================== */
@media (prefers-reduced-motion: reduce) {
    .vt-spinner {
        animation-duration: 2s;
    }

    .vt-cta,
    .vt-service {
        transition: none;
    }
}