/* ════════════════════════════════════════════════
   STREAD PREM — GLOBAL STYLES
   globals.css
════════════════════════════════════════════════ */

:root {
    --color-bg:          #0a0a0f;
    --color-bg-2:        #0f0f1a;
    --color-bg-3:        #13131f;
    --color-surface:     #16161f;
    --color-surface-2:   #1c1c28;
    --color-border:      rgba(255, 255, 255, 0.08);
    --color-border-2:    rgba(255, 255, 255, 0.12);
    --color-primary:     #6c63ff;
    --color-primary-2:   #8b5cf6;
    --color-accent:      #06d6a0;
    --color-gold:        #f59e0b;
    --color-text:        #f0f0fa;
    --color-text-2:      #a0a0c0;
    --color-text-3:      #6060a0;
    --color-success:     #06d6a0;
    --color-warning:     #f59e0b;
    --color-error:       #ef4444;
    --gradient-primary:  linear-gradient(135deg, #6c63ff 0%, #8b5cf6 50%, #06d6a0 100%);
    --gradient-card:     linear-gradient(145deg, #16161f, #1c1c28);
    --shadow-sm:         0 2px 8px rgba(0,0,0,0.4);
    --shadow-md:         0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow:       0 0 40px rgba(108,99,255,0.25);
    --radius-sm:         8px;
    --radius-md:         12px;
    --radius-lg:         20px;
    --radius-xl:         28px;
    --radius-full:       9999px;
    --font-body:         'Inter', -apple-system, sans-serif;
    --font-display:      'Space Grotesk', 'Inter', sans-serif;
    --ease-out:          cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast:     150ms;
    --duration-base:     250ms;
    --duration-slow:     400ms;
    --max-width:         1200px;
    --header-height:     70px;
}

/* ── LIGHT THEME OVERRIDES ── */
[data-theme="light"] {
    --color-bg:          #f8fafc;
    --color-bg-2:        #f1f5f9;
    --color-bg-3:        #e2e8f0;
    --color-surface:     #ffffff;
    --color-surface-2:   #f8fafc;
    --color-border:      rgba(0, 0, 0, 0.08);
    --color-border-2:    rgba(0, 0, 0, 0.12);
    --color-primary:     #6366f1;
    --color-primary-2:   #8b5cf6;
    --color-text:        #0f172a;
    --color-text-2:      #475569;
    --color-text-3:      #64748b;
    --gradient-card:     linear-gradient(145deg, #ffffff, #f8fafc);
    --shadow-sm:         0 2px 8px rgba(0,0,0,0.05);
    --shadow-md:         0 8px 30px rgba(0,0,0,0.08);
    --shadow-glow:       0 0 40px rgba(99,102,241,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 680px; }
.container-md { max-width: 860px; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.15;
    font-weight: 700;
    color: var(--color-text);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.5); }
.btn-ghost {
    background: transparent;
    color: var(--color-text-2);
    border: 1px solid var(--color-border-2);
}
.btn-ghost:hover { color: var(--color-text); border-color: var(--color-primary); background: rgba(108,99,255,0.08); }
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}
.btn-outline:hover { background: rgba(108,99,255,0.12); transform: translateY(-1px); }
.btn-telegram { background: #26a5e4; color: #fff; box-shadow: 0 4px 20px rgba(38,165,228,0.35); }
.btn-telegram:hover { background: #1a96d5; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(38,165,228,0.5); }
.btn-whatsapp { background: #25d366; color: #fff; box-shadow: 0 4px 20px rgba(37,211,102,0.35); }
.btn-whatsapp:hover { background: #1db954; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(37,211,102,0.5); }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--color-text-2); }
.form-group small { font-size: 0.8rem; color: var(--color-text-3); }
.form-group .required { color: var(--color-error); }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg-3);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    outline: none;
}
input:focus, textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
input::placeholder { color: var(--color-text-3); }

/* ── Section ── */
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(108,99,255,0.12);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.section-desc { color: var(--color-text-2); font-size: 1.05rem; }

/* ── Product Card ── */
.product-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;                  /* kompak untuk 5-kolom */
    transition: all var(--duration-base) var(--ease-out);
    cursor: pointer;
    position: relative;
    overflow: visible;
    /* Auto-layout: flex column agar tombol selalu di bawah */
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card:hover {
    border-color: rgba(108,99,255,0.45);
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px rgba(108,99,255,0.18), var(--shadow-glow);
}
.product-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
/* Gambar: aspect-ratio kotak (1:1) agar konsisten di semua perangkat */
.product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    background: var(--color-bg-3);
    display: block;
    flex-shrink: 0;
}
.product-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--color-border);
}
.product-category-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    background: rgba(108,99,255,0.15);
    border-radius: var(--radius-full);
    font-size: 0.68rem; font-weight: 600; color: var(--color-primary);
}
.product-stock-badge { font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.stock-high  { background: rgba(6,214,160,0.15); color: var(--color-accent); }
.stock-low   { background: rgba(245,158,11,0.15); color: var(--color-gold); }
.stock-empty { background: rgba(239,68,68,0.15);  color: var(--color-error); }
/* Nama: maks 2 baris, tinggi konsisten di semua kartu */
.product-name {
    font-size: 0.9rem;              /* kompak untuk 5-kolom */
    font-weight: 700;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.4em;
    flex-shrink: 0;
}
/* Deskripsi: maks 2 baris, flex:1 mengisi ruang tersisa */
.product-desc {
    font-size: 0.78rem;
    color: var(--color-text-2);
    margin-bottom: 12px;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
    /* Ellipsis jika teks terlalu panjang */
    text-overflow: ellipsis;
}
/* Footer: di 5-kolom → stack vertikal, tombol full-width */
.product-footer {
    display: flex;
    flex-direction: column;          /* Stack: harga atas, tombol bawah */
    align-items: flex-start;
    gap: 8px;
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}
.product-price {
    font-size: 1rem; font-weight: 800; font-family: var(--font-display);
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    white-space: nowrap;
}
.product-buy-btn {
    width: 100%;                     /* Tombol memenuhi lebar kartu */
    padding: 8px 10px;
    font-size: 0.8rem;
    justify-content: center;
    text-align: center;
}

/* Footer row-layout: kembali ke samping saat ≤1280px (4 kolom ke bawah) */
@media (max-width: 1280px) {
    .product-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 6px;
    }
    .product-buy-btn {
        width: auto;
        padding: 7px 14px;
        font-size: 0.78rem;
    }
}

/* ── Tombol "Habis" / Out-of-Stock State ── */
/* Kartu stok habis: sedikit redup agar tidak mencolok */
.product-card.out-of-stock {
    opacity: 0.72;
}
.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-border);
}
/* Tombol "Habis": abu-abu elegan, tidak merusak estetika neon */
.product-buy-btn:disabled,
.product-buy-btn.disabled,
.btn-sold-out {
    background: rgba(255,255,255,0.06) !important;
    color: var(--color-text-3) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    border: 1px solid var(--color-border);
    transform: none !important;
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* ── Skeleton ── */
.product-skeleton {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    height: 220px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity var(--duration-base);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border-2);
    border-radius: var(--radius-xl);
    width: 100%; max-width: 480px;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform var(--duration-base) var(--ease-out);
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-bg-3);
    color: var(--color-text-2);
    font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--duration-fast);
    border: 1px solid var(--color-border);
    line-height: 1;
    z-index: 10;
    cursor: pointer;
    flex-shrink: 0;
}
.modal-close:hover { background: var(--color-error); color: #fff; }
.modal-header { padding: 28px 28px 0; }
.modal-header h2 { font-size: 1.4rem; }
.modal-body { padding: 20px 28px 28px; }
.modal-product-info {
    background: var(--color-bg-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px; margin-bottom: 20px;
}
.modal-product-info .product-name { font-size: 1rem; margin-bottom: 4px; }
.modal-product-info .product-price { font-size: 1.25rem; }
.payment-result { text-align: center; padding: 20px 0; }
.payment-success svg { margin: 0 auto 16px; color: var(--color-success); }
.payment-success h3 { font-size: 1.3rem; margin-bottom: 8px; }
.payment-success p { color: var(--color-text-2); margin-bottom: 20px; font-size: 0.9rem; }

/* ── Spinner ── */
.spinner { width: 20px; height: 20px; animation: rotate 1.2s linear infinite; }
.spinner circle { stroke: #fff; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; fill: none; }
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0%   { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50%  { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* ── Page Hero ── */
.page-hero {
    position: relative;
    padding: calc(var(--header-height) + 64px) 0 64px;
    text-align: center; overflow: hidden;
}
.page-hero-bg { position: absolute; inset: 0; z-index: 0; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero-title { font-size: clamp(2rem, 5vw, 3rem); margin: 12px 0; }
.page-hero-desc { font-size: 1.05rem; color: var(--color-text-2); max-width: 500px; margin: 0 auto; }

/* ── Orbs ── */
.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.hero-orb-1 { width: 500px; height: 500px; background: rgba(108,99,255,0.18); top: -100px; right: -100px; }
.hero-orb-2 { width: 400px; height: 400px; background: rgba(6,214,160,0.10); bottom: -50px; left: -80px; }
.hero-orb-3 { width: 300px; height: 300px; background: rgba(139,92,246,0.12); top: 40%; left: 40%; }

/* ── Utility ── */
.hidden { display: none !important; }
.mono { font-family: 'Courier New', monospace; font-size: 0.9em; letter-spacing: 0.03em; }
.bold { font-weight: 700; }
.text-center { text-align: center; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .section-header { margin-bottom: 36px; }
    .btn { padding: 11px 20px; font-size: 0.9rem; }
    .modal-body, .modal-header { padding-left: 20px; padding-right: 20px; }
}

/* ── Product Card Mobile Compact ── */
@media (max-width: 600px) {
    .product-card {
        padding: 10px;
        border-radius: var(--radius-md);
    }
    .product-card-image {
        aspect-ratio: 1 / 1;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    .product-card-header { margin-bottom: 6px; gap: 3px; }
    .product-category-badge { font-size: 0.63rem; padding: 2px 6px; }
    .product-stock-badge    { font-size: 0.63rem; padding: 2px 6px; }
    .product-name {
        font-size: 0.82rem;
        min-height: 2.2em;
        margin-bottom: 3px;
    }
    .product-desc {
        font-size: 0.72rem;
        margin-bottom: 8px;
        min-height: 2.1em;
        -webkit-line-clamp: 2;
    }
    .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .product-price { font-size: 0.9rem; }

    /* Action buttons on mobile — stack vertically */
    .product-actions {
        flex-direction: column;
        gap: 5px;
    }
    .btn-add-cart,
    .btn-buy-now {
        flex: unset;
        width: 100%;
        padding: 7px 10px;
        font-size: 0.74rem;
        border-radius: var(--radius-sm);
    }
}

/* ── product-actions base fix at ≤1280px ── */
@media (max-width: 1280px) {
    .product-actions {
        flex-direction: row;
    }
    .btn-add-cart,
    .btn-buy-now {
        flex: 1;
        padding: 7px 10px;
        font-size: 0.76rem;
        border-radius: var(--radius-full);
    }
}


/* ══════════════════════════════════════════════════════════════
   LIGHT MODE GLOBAL OVERRIDES
   Override warna hardcoded agar semua elemen menyesuaikan tema
══════════════════════════════════════════════════════════════ */

/* ── Scrollbar ── */
[data-theme="light"] ::-webkit-scrollbar-track { background: var(--color-bg-2); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); }

/* ── Buttons ── */
[data-theme="light"] .btn-ghost {
    color: #374151;
    border-color: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .btn-ghost:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.07);
}

/* ── Product Card ── */
[data-theme="light"] .product-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .product-card:hover {
    border-color: rgba(99, 102, 241, 0.40);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.14);
}
[data-theme="light"] .product-card-image {
    background: #f3f4f6;
}
[data-theme="light"] .product-card-placeholder {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .product-desc {
    color: #4b5563;
}
/* ── Sold-out ── */
[data-theme="light"] .product-buy-btn:disabled,
[data-theme="light"] .product-buy-btn.disabled,
[data-theme="light"] .btn-sold-out {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #9ca3af !important;
    border-color: rgba(0, 0, 0, 0.09);
}
/* ── Skeleton ── */
[data-theme="light"] .product-skeleton { background: #e5e7eb; }

/* ── Modal ── */
[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.40);
}
[data-theme="light"] .modal {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
}
[data-theme="light"] .modal-close {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.10);
    color: #374151;
}
[data-theme="light"] .modal-close:hover {
    background: var(--color-error);
    color: #fff;
}
[data-theme="light"] .modal-product-info {
    background: #f9fafb;
    border-color: rgba(0, 0, 0, 0.08);
}

/* ── Form Inputs ── */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="number"],
[data-theme="light"] textarea {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.14);
    color: #111827;
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #9ca3af;
}

/* ── Section Tag ── */
[data-theme="light"] .section-tag {
    background: rgba(99, 102, 241, 0.09);
    border-color: rgba(99, 102, 241, 0.22);
}

/* ── Hero Orbs (lebih halus di light) ── */
[data-theme="light"] .hero-orb-1 { background: rgba(99, 102, 241, 0.10); }
[data-theme="light"] .hero-orb-2 { background: rgba(6, 214, 160, 0.07); }
[data-theme="light"] .hero-orb-3 { background: rgba(139, 92, 246, 0.08); }
