:root {
  --bg: #14110d;
  --bg-soft: #1c1811;
  --card: #221c14;
  --border: #3a2f20;
  --text: #f3ead8;
  --muted: #ad9d86;
  --accent: #e8a83c;
  --accent-soft: #f4c569;
  --teal: #3fae8f;
  --danger: #e2665f;
  --radius: 14px;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
h1, h2, h3, .logo, .btn, .key-code, .price { font-family: var(--font-display); }
.price, .key-code, code, .order-ref { font-family: var(--font-mono); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1360px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* Header */
.site-header { background: rgba(20,17,13,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; position: relative; }
.logo img { height: 56px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; }
.main-nav a { margin-left: 26px; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 18px; margin: 0 auto; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero-hexes {
  position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='96' viewBox='0 0 84 96'%3E%3Cpath d='M42 0 L84 24 L84 72 L42 96 L0 72 L0 24 Z' fill='none' stroke='%23e8a83c' stroke-width='1.2'/%3E%3C/svg%3E");
  background-size: 84px 96px;
  mask-image: radial-gradient(ellipse at 70% 30%, black 0%, transparent 70%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-soft); font-weight: 600; margin-bottom: 14px; }
.hero h1 { font-size: 2.5rem; line-height: 1.15; margin: 0 0 16px; font-weight: 700; letter-spacing: -0.01em; }
.hero-copy p { color: var(--muted); font-size: 1.05rem; max-width: 480px; margin: 0 0 28px; }
.hero-actions a { margin-right: 10px; }

.hero-key { display: flex; justify-content: center; }
.key-card {
  background: linear-gradient(160deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  width: 100%;
  max-width: 300px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.key-card-row { display: flex; gap: 6px; margin-bottom: 18px; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.key-dot:first-child { background: var(--danger); }
.key-dot:nth-child(2) { background: var(--accent); }
.key-dot:nth-child(3) { background: var(--teal); }
.key-code { font-size: 1.3rem; font-weight: 600; color: var(--accent-soft); letter-spacing: .03em; margin-bottom: 10px; }
.key-label { color: var(--muted); font-size: 0.8rem; }
.key-label span { color: var(--teal); font-family: var(--font-mono); }

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-size: 0.95rem; font-family: var(--font-display); background: transparent; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #1a1509; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 15px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }

section { padding: 44px 0; }
h2.section-title { font-size: 1.4rem; margin-bottom: 22px; font-weight: 600; }

.grid { display: grid; gap: 18px; }
.grid-cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Product ticket cards */
.product-card { display: flex; flex-direction: column; position: relative; }
.product-card img, .product-thumb {
  width: 100%; height: 130px; object-fit: cover; border-radius: 8px; background: var(--bg-soft); margin-bottom: 12px;
}
.product-card h3 { margin: 10px 0 0; font-size: 1.02rem; font-weight: 600; }
.product-card .cat { color: var(--muted); font-size: 0.8rem; margin-bottom: 10px; }
.ticket-divider {
  border-top: 2px dashed var(--border);
  margin: 14px 0 12px;
}
.product-card .price { font-weight: 600; font-size: 1.2rem; color: var(--accent-soft); letter-spacing: .02em; }
.price-sub { font-size: 0.76rem; margin-top: 2px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-display); }
.badge-auto { background: rgba(63,174,143,.16); color: var(--teal); }
.badge-manual { background: rgba(232,168,60,.16); color: var(--accent-soft); }
.badge-status { background: rgba(255,255,255,.06); color: var(--muted); }
.badge-paid, .badge-delivered { background: rgba(63,174,143,.16); color: var(--teal); }
.badge-pending, .badge-awaiting_verification { background: rgba(232,168,60,.16); color: var(--accent-soft); }
.badge-rejected, .badge-cancelled { background: rgba(226,102,95,.16); color: var(--danger); }

.category-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.category-pills a { padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.85rem; }
.category-pills a.active, .category-pills a:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }

.service-card { display: flex; flex-direction: column; gap: 10px; }
.service-card h3 { margin: 0; font-weight: 600; }
.service-card .price-tag { color: var(--teal); font-weight: 600; font-family: var(--font-mono); }

form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
label { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; display: block; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 0.95rem; font-family: var(--font-body);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(226,102,95,.12); border: 1px solid rgba(226,102,95,.35); color: #ffb1ac; }
.alert-success { background: rgba(63,174,143,.12); border: 1px solid rgba(63,174,143,.35); color: #9fe6cf; }
.alert-info { background: rgba(232,168,60,.12); border: 1px solid rgba(232,168,60,.35); color: #f4d999; }

.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; margin: 8px 0 18px; }
.pay-method-option { border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pay-method-option input { width: auto; margin-right: 6px; }
.pay-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  font-weight: 700; font-size: 0.95rem; line-height: 1;
}
.pay-icon-img {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; background: #fff; border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: rgba(255,255,255,.02); }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--bg-soft); border-right: 1px solid var(--border); padding: 20px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 10px 22px; color: var(--muted); font-weight: 500; }
.admin-sidebar a:hover, .admin-sidebar a.active { color: var(--text); background: rgba(255,255,255,.03); text-decoration: none; }
.admin-content { flex: 1; padding: 28px 32px; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-size: 1.8rem; font-weight: 700; font-family: var(--font-display); }
.stat-card .label { color: var(--muted); font-size: 0.85rem; }

.muted { color: var(--muted); }
.mt-lg { margin-top: 28px; }
.mb-lg { margin-bottom: 28px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.secret-box { background: var(--bg-soft); border: 1px dashed var(--teal); border-radius: 8px; padding: 14px; font-family: var(--font-mono); word-break: break-all; color: var(--teal); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1509;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
  z-index: 50;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--accent-soft); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 20px; text-align: center; }
.site-footer p { margin: 4px 0; font-size: 0.88rem; }

/* Mobile */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-key { order: -1; margin-bottom: 8px; }
  .key-card { max-width: 100%; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 8px 0;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .main-nav.open { max-height: 240px; }
  .main-nav a { margin: 0; padding: 12px 20px; border-top: 1px solid var(--border); }
  .main-nav a:first-child { border-top: none; }

  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-copy p { font-size: 0.95rem; }
  .hero-actions { display: flex; flex-direction: column; gap: 10px; }
  .hero-actions a { margin-right: 0; }

  section { padding: 32px 0; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; gap: 4px; }
  .admin-sidebar a { white-space: nowrap; padding: 8px 14px; }
  .admin-content { padding: 20px 16px; }
  .back-to-top { bottom: 16px; right: 16px; }
}

.footer-contact { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; font-size: 0.88rem; color: var(--muted); }
.footer-contact a { color: var(--muted); }
.footer-contact a:hover { color: var(--accent-soft); }

.pay-settings-card { width: 100%; }
.pay-row { display: flex; gap: 28px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: none; }
.pay-row-head { display: flex; align-items: center; gap: 12px; width: 200px; flex-shrink: 0; font-weight: 600; font-size: 1.05rem; padding-top: 8px; }
.pay-row-form { display: flex; flex: 1; gap: 20px; align-items: flex-start; }
.pay-row-form textarea { flex: 1; min-height: 56px; font-size: 1rem; }
.pay-row-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; width: 150px; flex-shrink: 0; }

@media (max-width: 720px) {
  .pay-row { flex-direction: column; }
  .pay-row-form { flex-direction: column; width: 100%; }
  .pay-row-actions { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
}

/* Currency toggle */
.currency-toggle { display: flex; gap: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-left: 22px; }
.cur-btn { border: none; background: transparent; color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; padding: 5px 13px; border-radius: 999px; cursor: pointer; }
.cur-btn.active { background: var(--accent); color: #1a1509; }

/* Show LKR by default; JS flips to USD via body[data-currency] */
.cur-usd { display: none; }
body[data-currency="USD"] .cur-usd { display: inline; }
body[data-currency="USD"] .cur-lkr { display: none; }

/* WhatsApp floating button — stacked above Back-to-top, both on the right */
.whatsapp-fab {
  position: fixed; bottom: 82px; right: 24px; width: 48px; height: 48px; border-radius: 50%;
  background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 50;
}
.whatsapp-fab:hover { background: #20bd5a; }

/* Professional footer contact row */
.footer-contact { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 30px; margin-bottom: 18px; }
.contact-item { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.contact-item svg { flex-shrink: 0; opacity: 0.85; }
a.contact-item:hover { color: var(--accent-soft); text-decoration: none; }
a.contact-item:hover svg { opacity: 1; }

@media (max-width: 720px) {
  .currency-toggle { margin: 10px 20px; }
  .whatsapp-fab { bottom: 70px; right: 16px; width: 44px; height: 44px; }
  .back-to-top { bottom: 16px; right: 16px; }
}
