:root {
    --bg: #07090e;
    --bg-elev: #0f131d;
    --card: #131824;
    --card-hover: #192030;
    --border: rgba(212, 175, 55, 0.22);
    --border-strong: rgba(212, 175, 55, 0.55);
    --gold: #d4af37;
    --gold-light: #f6dc88;
    --gold-dark: #9c7a1c;
    --text: #f8fafc;
    --muted: #94a3b8;
    --green: #10b981;
    --red: #ef4444;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Battambang', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

.lux-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Sticky Header */
.lux-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(7, 9, 14, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-wrap: wrap;
}
.brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}
.brand-title {
    font-family: 'Suwannaphum', 'Battambang', serif;
    font-size: 1.15em;
    font-weight: 700;
    background: linear-gradient(90deg, #f6dc88, #d4af37, #fef0b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.brand-sub { font-size: 0.75em; color: var(--muted); }

.header-search-wrap {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
}
.search-ico {
    position: absolute;
    left: 13px;
    color: var(--gold);
    font-size: 0.9em;
}
#catalog-search {
    width: 100%;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 9px 36px 9px 36px;
    color: var(--text);
    font-size: 0.92em;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#catalog-search:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}
.clear-search {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9em;
}

.header-cta { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn-gold, .btn-gold-sm {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: linear-gradient(135deg, #c59b27, #f5d67b, #c59b27);
    color: #090b10;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}
.btn-gold { padding: 11px 22px; font-size: 0.95em; }
.btn-gold-sm { padding: 7px 14px; font-size: 0.85em; }
.btn-gold:hover, .btn-gold-sm:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(212, 175, 55, 0.48); }

.btn-outline-sm, .btn-dark-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-light);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.btn-outline-sm { padding: 7px 13px; font-size: 0.84em; }
.btn-dark-gold { padding: 10px 18px; font-size: 0.92em; }
.btn-outline-sm:hover, .btn-dark-gold:hover { background: rgba(212, 175, 55, 0.18); border-color: var(--gold-light); }

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 46px 0 42px;
    background:
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.18), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.12), transparent 50%),
        linear-gradient(180deg, #0c101a 0%, #07090e 100%);
    border-bottom: 1px solid var(--border);
}
.hero-bg-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.34;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7,9,14,0.55) 0%, rgba(7,9,14,0.88) 100%);
}
.hero-content { position: relative; z-index: 2; text-align: center; }
.hero-eyebrow {
    font-size: 0.78em;
    letter-spacing: 3px;
    color: var(--gold-light);
    margin-bottom: 8px;
    font-weight: 700;
}
.hero-title {
    margin: 0 0 10px 0;
    font-family: 'Suwannaphum', 'Battambang', serif;
    font-size: clamp(1.6em, 4vw, 2.5em);
    background: linear-gradient(90deg, #fff5d6, #e5bf52, #fff5d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    margin: 0 auto 22px;
    max-width: 650px;
    color: #cbd5e1;
    font-size: 0.98em;
}
.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Main Content */
.main-content { padding-top: 22px; padding-bottom: 48px; }

/* Branch Bar */
.branch-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
}
.branch-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.88em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.branch-pill .branch-dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.branch-pill.active {
    background: linear-gradient(135deg, rgba(212,175,55,0.24), rgba(212,175,55,0.1));
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
}
.branch-pill .pill-cnt {
    background: rgba(255,255,255,0.08);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.82em;
    color: var(--muted);
}
.branch-pill.active .pill-cnt { background: var(--gold); color: #090b10; }

/* Featured Section */
.featured-section {
    margin-bottom: 28px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(15,19,29,0.92));
    border: 1px solid var(--border-strong);
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.section-head h2 {
    margin: 0;
    font-size: 1.15em;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.gold-star { color: var(--gold); }
.section-count { font-size: 0.82em; color: var(--muted); }
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

/* Filter Toolbar */
.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.category-pills {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.cat-pill {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: var(--bg-elev);
    color: #cbd5e1;
    font-size: 0.86em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
}
.cat-pill.active {
    background: var(--gold);
    color: #090b10;
    border-color: var(--gold-light);
}

.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.instock-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-elev); border: 1px solid rgba(255,255,255,0.14);
    padding: 6px 12px; border-radius: 20px; font-size: 0.84em; cursor: pointer; font-weight: 700;
}
.instock-toggle input { accent-color: var(--gold); width: 16px; height: 16px; }
.lux-select {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.catalog-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85em;
    color: var(--muted);
    margin-bottom: 16px;
}

/* Product Grid & Luxury Cards */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.jewel-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.jewel-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 18px rgba(212, 175, 55, 0.16);
}
.jewel-card.is-sold { opacity: 0.74; }
.jewel-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #090c12;
    overflow: hidden;
}
.jewel-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.jewel-card:hover .jewel-cover-wrap img { transform: scale(1.05); }

/* Branch Cover Badge (Top-Left of Photo) */
.cover-branch-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    padding: 3px 9px;
    border-radius: 14px;
    font-size: 0.72em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cover-featured-star {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(7, 9, 14, 0.78);
    color: var(--gold-light);
    border: 1px solid var(--gold);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78em;
}
.sold-ribbon {
    position: absolute;
    bottom: 10px;
    right: 8px;
    z-index: 4;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    padding: 3px 11px;
    border-radius: 14px;
    font-size: 0.76em;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.jewel-body {
    padding: 11px 12px 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.jewel-cat {
    font-size: 0.74em;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.jewel-code {
    font-family: monospace;
    background: rgba(255,255,255,0.06);
    padding: 1px 6px;
    border-radius: 5px;
    color: #cbd5e1;
}
.jewel-name {
    font-size: 0.94em;
    font-weight: 700;
    color: #f8fafc;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}
.jewel-price-row {
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.jewel-price {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--gold-light);
    font-family: 'Battambang', sans-serif;
}
.jewel-status-dot {
    font-size: 0.72em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}
.status-in { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.status-out { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 20px;
    background: var(--bg-elev);
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
}

.load-more-wrap { text-align: center; margin-top: 26px; }

/* Footer & QR */
.lux-footer {
    background: #0b0e16;
    border-top: 1px solid var(--border);
    padding: 36px 0 18px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 24px;
}
.footer-brand-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-logo {
    width: 54px; height: 54px; border-radius: 50%; background: #fff; padding: 4px;
    border: 2px solid var(--gold); object-fit: contain;
}
.footer-brand-head h3 { margin: 0; color: var(--gold-light); font-size: 1.2em; }
.footer-brand-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.85em; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
    color: #e2e8f0; text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
    font-size: 0.94em; transition: color 0.18s;
}
.footer-links a i { color: var(--gold); width: 18px; text-align: center; }
.footer-links a:hover { color: var(--gold-light); }

.qr-frame {
    background: linear-gradient(135deg, rgba(212,175,55,0.14), rgba(15,19,29,0.95));
    border: 1.5px solid var(--border-strong);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}
.qr-title { font-size: 0.85em; color: var(--gold-light); font-weight: 700; margin-bottom: 10px; }
.social-qr-img {
    width: 100%;
    max-width: 460px;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.footer-bottom {
    text-align: center;
    font-size: 0.8em;
    color: var(--muted);
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Detail Modal */
.detail-modal {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.detail-backdrop {
    position: absolute; inset: 0;
    background: rgba(3, 5, 10, 0.86);
    backdrop-filter: blur(8px);
}
.detail-card {
    position: relative; z-index: 2;
    width: 100%; max-width: 820px; max-height: 92vh; overflow-y: auto;
    background: var(--bg-elev);
    border: 1.5px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.75);
}
.detail-close {
    position: absolute; top: 12px; right: 12px; z-index: 5;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(7, 9, 14, 0.82); color: #fff; border: 1px solid var(--border);
    font-size: 1em; font-weight: 700; cursor: pointer;
}
.detail-layout {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}
.detail-img-wrap {
    position: relative;
    background: #05070c;
    display: flex; align-items: center; justify-content: center;
    min-height: 300px;
}
.detail-img-wrap img {
    width: 100%; height: 100%; max-height: 520px; object-fit: contain; display: block;
}
.detail-info { padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.detail-cat { font-size: 0.84em; color: var(--gold); font-weight: 700; letter-spacing: 0.5px; }
.detail-name { margin: 0; font-size: 1.35em; color: #fff; line-height: 1.35; }
.detail-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-code-pill {
    font-family: monospace; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14); padding: 3px 10px; border-radius: 8px; font-size: 0.88em;
}
.detail-status-pill { padding: 3px 10px; border-radius: 12px; font-size: 0.82em; font-weight: 700; }
.detail-price-box {
    background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.04));
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 14px 16px;
}
.detail-price-label { font-size: 0.8em; color: var(--muted); }
.detail-price-val { font-size: 1.85em; font-weight: 700; color: var(--gold-light); line-height: 1.2; }
.detail-note { margin: 0; font-size: 0.82em; color: var(--muted); }
.detail-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.full-btn { width: 100%; }
.detail-sub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.catalog-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100;
    background: #0f172a; color: var(--gold-light); border: 1.5px solid var(--gold);
    padding: 10px 20px; border-radius: 24px; font-weight: 700; font-size: 0.88em;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
    .header-inner { gap: 8px; }
    .header-search-wrap { order: 3; max-width: 100%; flex-basis: 100%; }
    .header-cta .btn-gold-sm span, .header-cta .btn-outline-sm span { display: none; }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .footer-grid { grid-template-columns: 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-img-wrap img { max-height: 360px; }
    .jewel-price { font-size: 1.02em; }
}
