/* ═══════════════════════════════════════════
   iRegalo Global Dark Theme
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --red: #E8322A;
  --dark-red: #C0261F;
  --gold: #F5C518;
  --dark: #0F0F0F;
  --charcoal: #1C1C1C;
  --mid: #2A2A2A;
  --border: rgba(255,255,255,0.08);
  --light: #F5F3EF;
  --white: #FFFFFF;
  --muted: #777;
  --text: rgba(255,255,255,0.85);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--dark); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* ── HEADER ─────────── */
.ir-header { position: sticky; top: 0; z-index: 200; height: 64px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: rgba(15,15,15,0.92); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.ir-logo { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; color: var(--white); text-decoration: none; letter-spacing: -0.5px; }
.ir-logo span { color: var(--red); }
.ir-nav { display: flex; align-items: center; gap: 8px; }
.ir-nav a, .ir-nav button { font-family: 'Plus Jakarta Sans', sans-serif; }
.btn-ghost { padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 8px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; font-weight: 500; background: none; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-red { padding: 9px 20px; background: var(--red); border: none; border-radius: 8px; color: white; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-red:hover { background: var(--dark-red); transform: translateY(-1px); }
.cart-icon-btn { position: relative; background: none; border: none; cursor: pointer; padding: 8px; color: var(--white); display: flex; }
.cart-icon-btn svg { width: 22px; height: 22px; }
.cart-badge { position: absolute; top: 2px; right: 2px; background: var(--red); color: white; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: none; align-items: center; justify-content: center; }
.cart-badge.show { display: flex; }

/* ── PAGE WRAPPER ─────────── */
.ir-page { max-width: 1200px; margin: 0 auto; padding: 48px 32px; }
.ir-page-sm { max-width: 720px; margin: 0 auto; padding: 48px 24px; }

/* ── BREADCRUMB ─────────── */
.ir-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.ir-breadcrumb a { color: var(--muted); text-decoration: none; transition: .2s; }
.ir-breadcrumb a:hover { color: var(--red); }
.ir-breadcrumb span { color: var(--text); }
.ir-breadcrumb .sep { opacity: 0.4; }

/* ── SECTION TITLES ─────────── */
.ir-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }
.ir-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(24px,4vw,40px); font-weight: 800; letter-spacing: -1px; margin-bottom: 8px; }
.ir-subtitle { color: var(--muted); font-size: 15px; }

/* ── CARDS ─────────── */
.ir-card { background: var(--charcoal); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.ir-card-pad { padding: 28px; }

/* ── PRODUCT GRID ─────────── */
.ir-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.ir-product-card { background: var(--charcoal); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: .25s; cursor: pointer; }
.ir-product-card:hover { transform: translateY(-5px); border-color: var(--red); box-shadow: 0 16px 40px rgba(232,50,42,0.15); }
.ir-product-img { aspect-ratio: 16/9; background: var(--mid); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ir-product-img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; transition: .3s; }
.ir-product-card:hover .ir-product-img img { transform: scale(1.06); }
.ir-product-placeholder { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 28px; font-weight: 800; color: var(--red); }
.ir-product-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.ir-product-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--red); margin-bottom: 4px; }
.ir-product-name { font-size: 15px; font-weight: 600; color: var(--white); flex: 1; }
.ir-product-price { font-size: 18px; font-weight: 700; color: var(--white); margin-top: 8px; }
.ir-product-price small { font-size: 12px; font-weight: 400; color: var(--muted); margin-right: 2px; }

/* ── ADD TO CART BUTTON ─────────── */
.btn-add-cart { width: 100%; padding: 11px; background: var(--red); border: none; border-radius: 0 0 14px 14px; color: white; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s; font-family: 'Plus Jakarta Sans', sans-serif; }
.btn-add-cart:hover { background: var(--dark-red); }

/* ── FORM ELEMENTS ─────────── */
.ir-form-group { margin-bottom: 20px; }
.ir-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); margin-bottom: 8px; display: block; letter-spacing: 0.3px; }
.ir-input { width: 100%; padding: 13px 16px; background: var(--mid); border: 1.5px solid var(--border); border-radius: 10px; color: var(--white); font-size: 15px; font-family: 'Plus Jakarta Sans', sans-serif; outline: none; transition: .2s; }
.ir-input:focus { border-color: var(--red); background: #2E2020; }
.ir-input::placeholder { color: var(--muted); }
.ir-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── PAYMENT OPTIONS ─────────── */
.ir-pay-option { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--mid); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: .2s; margin-bottom: 10px; }
.ir-pay-option:hover { border-color: rgba(232,50,42,0.4); }
.ir-pay-option.selected { border-color: var(--red); background: rgba(232,50,42,0.08); }
.ir-pay-option.ir-pay-disabled { opacity: 0.55; cursor: not-allowed; }
.ir-pay-option.ir-pay-disabled:hover { border-color: var(--border); }
.ir-pay-icon { font-size: 26px; width: 40px; text-align: center; }
.ir-pay-name { font-size: 15px; font-weight: 600; color: var(--white); }
.ir-pay-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ir-pay-radio { margin-left: auto; width: 18px; height: 18px; accent-color: var(--red); }

/* ── ORDER SUMMARY SIDEBAR ─────────── */
.ir-summary { background: var(--charcoal); border: 1px solid var(--border); border-radius: 16px; padding: 24px; position: sticky; top: 84px; }
.ir-summary-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.ir-summary-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.ir-summary-thumb { width: 48px; height: 48px; background: var(--mid); border-radius: 8px; object-fit: contain; padding: 6px; }
.ir-summary-item-name { font-size: 14px; font-weight: 600; flex: 1; }
.ir-summary-item-price { font-size: 14px; font-weight: 700; color: var(--red); }
.ir-summary-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.ir-summary-total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.ir-summary-total-label { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 700; }
.ir-summary-total-price { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; font-weight: 800; color: var(--red); }

/* ── CHECKOUT LAYOUT ─────────── */
.ir-checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
.ir-checkout-steps { display: flex; justify-content: center; gap: 0; margin-bottom: 40px; }
.ir-step-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.ir-step-item.active { color: var(--white); background: rgba(232,50,42,0.12); }
.ir-step-item.done { color: var(--red); }
.ir-step-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ── ORDER STATUS BADGES ─────────── */
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; display: inline-block; }
.badge-paid, .badge-completed { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-processing { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-pending { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.badge-failed, .badge-cancelled { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* ── CODE BOX ─────────── */
.code-pending { background: rgba(251,191,36,0.08); border: 1.5px solid rgba(251,191,36,0.3); border-radius: 12px; padding: 20px; text-align: center; }
.code-ready { background: rgba(34,197,94,0.08); border: 1.5px solid rgba(34,197,94,0.3); border-radius: 12px; padding: 20px; text-align: center; }
.code-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: 3px; color: var(--white); margin: 12px 0; word-break: break-all; }
.code-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #4ade80; margin-bottom: 8px; }

/* ── NOTIFICATIONS ─────────── */
.ir-toast { position: fixed; bottom: 24px; right: 24px; z-index: 9999; background: var(--charcoal); border: 1px solid var(--border); border-radius: 12px; padding: 14px 20px; font-size: 14px; font-weight: 600; transform: translateY(100px); opacity: 0; transition: .3s; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.ir-toast.show { transform: none; opacity: 1; }
.ir-toast.success { border-color: rgba(34,197,94,0.3); color: #4ade80; }
.ir-toast.error { border-color: rgba(239,68,68,0.3); color: #f87171; }

/* ── FOOTER ─────────── */
.ir-footer { background: var(--charcoal); border-top: 1px solid var(--border); padding: 32px; text-align: center; color: var(--muted); font-size: 13px; margin-top: 80px; }
.ir-footer a { color: var(--muted); text-decoration: none; }
.ir-footer a:hover { color: var(--red); }

/* ── DIVIDER ─────────── */
.ir-divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── AUTH PAGES ─────────── */
.ir-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at top right, rgba(232,50,42,0.12) 0%, transparent 60%), var(--dark); }
.ir-auth-box { background: var(--charcoal); border: 1px solid var(--border); border-radius: 20px; padding: 40px; width: 100%; max-width: 440px; }
.ir-auth-logo { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.ir-auth-logo span { color: var(--red); }
.ir-auth-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.ir-auth-sub { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.ir-auth-link { color: var(--red); text-decoration: none; font-weight: 600; }
.ir-auth-link:hover { text-decoration: underline; }
.ir-auth-divider { text-align: center; color: var(--muted); font-size: 13px; margin: 20px 0; position: relative; }
.ir-auth-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.ir-auth-divider span { background: var(--charcoal); padding: 0 12px; position: relative; }

/* ── ALERT ─────────── */
.ir-alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
.ir-alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }
.ir-alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #4ade80; }

/* ── DASHBOARD TABLE ─────────── */
.ir-table { width: 100%; border-collapse: collapse; }
.ir-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ir-table td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 14px; vertical-align: middle; }
.ir-table tr:last-child td { border-bottom: none; }
.ir-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── STATS GRID ─────────── */
.ir-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 32px; }
.ir-stat { background: var(--charcoal); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.ir-stat-num { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 32px; font-weight: 800; color: var(--red); }
.ir-stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── PHONE MODAL ─────────── */
.ir-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.ir-modal { background: var(--charcoal); border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 32px; width: 90%; max-width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,0.6); }
.ir-modal h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.ir-modal p { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.ir-modal-btns { display: flex; gap: 10px; }

/* ── SCROLLBAR ─────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--mid); border-radius: 3px; }

/* ═══════════════════════════════════════════
   LIGHT THEME VARIABLES
   ═══════════════════════════════════════════ */
html[data-theme="light"] {
  --dark: #F5F5F5;
  --charcoal: #FFFFFF;
  --mid: #F0F0F0;
  --border: rgba(0,0,0,0.1);
  --text: rgba(0,0,0,0.85);
  --muted: #666;
  --white: #111111;
  --dark-red: #C0261F;
}

html[data-theme="light"] body {
  color: #111;
}

html[data-theme="light"] .ir-header {
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

html[data-theme="light"] .ir-logo { color: #111; }
html[data-theme="light"] .ir-nav .btn-ghost { color: #555; border-color: rgba(0,0,0,0.2); }
html[data-theme="light"] .ir-nav .btn-ghost:hover { color: var(--red); border-color: var(--red); }
html[data-theme="light"] .cart-icon-btn { color: #111; }

html[data-theme="light"] .ir-title { color: #111; }
html[data-theme="light"] .ir-product-name { color: #111; }
html[data-theme="light"] .ir-product-price { color: #111; }
html[data-theme="light"] .ir-product-img { background: #f8f8f8; }

html[data-theme="light"] .ir-stat-label,
html[data-theme="light"] .ir-subtitle,
html[data-theme="light"] .section-sub { color: #666; }

html[data-theme="light"] .ir-table th { color: #888; }
html[data-theme="light"] .ir-table td { color: #111; }
html[data-theme="light"] .ir-table tr:hover td { background: rgba(0,0,0,0.02); }

html[data-theme="light"] .ir-pay-name { color: #111; }
html[data-theme="light"] .ir-summary-title { color: #111; }
html[data-theme="light"] .ir-summary-total-label { color: #111; }

html[data-theme="light"] .ir-input {
  background: #f8f8f8;
  border-color: rgba(0,0,0,0.15);
  color: #111;
}
html[data-theme="light"] .ir-input:focus {
  background: #fff;
  border-color: var(--red);
}
html[data-theme="light"] .ir-input::placeholder { color: #aaa; }
html[data-theme="light"] .ir-label { color: rgba(0,0,0,0.65); }

html[data-theme="light"] .ir-auth-wrap {
  background: radial-gradient(ellipse at top right, rgba(232,50,42,0.08) 0%, transparent 60%), #f5f5f5;
}
html[data-theme="light"] .ir-auth-logo { color: #111; }
html[data-theme="light"] .ir-auth-title { color: #111; }

html[data-theme="light"] .ir-footer {
  background: #e8e8e8;
  border-top: 1px solid rgba(0,0,0,0.08);
}

html[data-theme="light"] .ir-breadcrumb a { color: #888; }
html[data-theme="light"] .ir-breadcrumb span { color: #111; }

html[data-theme="light"] .code-pending {
  background: rgba(251,191,36,0.08);
  border-color: rgba(251,191,36,0.4);
}
html[data-theme="light"] .code-ready {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.3);
}
html[data-theme="light"] .code-value { color: #111; }

html[data-theme="light"] .ir-modal {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] .ir-modal h3 { color: #111; }

html[data-theme="light"] .ir-pay-option {
  background: #f8f8f8;
  border-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] .ir-pay-option.selected {
  background: rgba(232,50,42,0.05);
  border-color: var(--red);
}

/* ── THEME TOGGLE BUTTON ─────────── */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: .2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.theme-toggle:hover { border-color: var(--red); }
.theme-icon-dark { display: inline; }
.theme-icon-light { display: none; }
htmlhtml[data-theme="light"] .theme-icon-dark { display: none; }
htmlhtml[data-theme="light"] .theme-icon-light { display: inline; }


/* ── RESPONSIVE ─────────── */
@media(max-width: 768px) {
  .ir-header { padding: 0 16px; }
  .ir-page, .ir-page-sm { padding: 32px 16px; }
  .ir-checkout-grid { grid-template-columns: 1fr; }
  .ir-stats { grid-template-columns: 1fr; }
  .ir-input-row { grid-template-columns: 1fr; }
}