/* ============================================================
 * assets/css/discountzar.css
 *
 * Additive visual layer that brings InfinityLogz's shared design
 * system in line with the DiscountZAR reference (discountzar.com
 * and discountzar.com/marketplace): purple/amber palette, Outfit +
 * DM Sans type, 20px card radii, gradient CTAs, pill navigation,
 * dark "spotlight" rails for Hot Deals / Top Vendors, and the
 * DiscountZAR marketplace card anatomy (image wrap, price box,
 * badges, availability bar, vendor attribution row).
 *
 * Loaded after tailwind.css so same-specificity rules here win.
 * Nothing here renames a class, an id, a route or a JS selector —
 * every existing hook (data-*, class names the app.js/PHP layer
 * depends on) is left exactly as it was; this file only changes
 * how things look.
 * ============================================================ */

:root {
  --dz-primary:        #7C5CFC;
  --dz-primary-2:       #6366F1;
  --dz-primary-grad:    linear-gradient(135deg, #7C5CFC 0%, #6366F1 100%);
  --dz-dark-grad:       linear-gradient(135deg, #1A1230 0%, #2D1F6E 100%);
  --dz-spotlight-grad:  linear-gradient(135deg, #090A10 0%, #17112C 100%);
  --dz-ink:             #1A1230;
  --dz-amber:           #F59E0B;
  --dz-orange:          #EA580C;
  --dz-border:          #EDE9FE;
  --dz-surface:         #F5F3FF;
  --dz-surface-2:       #F0EEF9;
  --dz-muted:           #9B8FC2;
  --dz-muted-2:         #B8ADDB;
  --dz-green:           #16A34A;
  --dz-green-bg:        #F0FDF4;
  --dz-green-border:    #BBF7D0;
}

/* Small set of plain utility classes this build's compiled Tailwind
   output doesn't happen to include yet (no build step is available
   in this environment — see tailwind.config.js's header comment),
   needed by the restyled markup above. */
.font-bold { font-weight: 700; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.pb-1 { padding-bottom: .25rem; }
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}
.border-coral-300\/70 { border-color: rgba(124, 92, 252, .4); }
.dark .dark\:border-coral-800\/60,
html.dark .dark\:border-coral-800\/60 { border-color: rgba(79, 70, 229, .5); }
.dark .dark\:bg-coral-700\/15,
html.dark .dark\:bg-coral-700\/15 { background-color: rgba(99, 102, 241, .15); }

/* ── Radii: DiscountZAR's cards/panels sit at a 20px corner ───── */
.card, .panel, .panel-flush, .pwa-toast, .pwa-modal,
[data-dropdown-panel], .notify-card {
  border-radius: 20px;
}

.credential-row, .alert, .pwa-platform, .input, .textarea, .select {
  border-radius: 14px;
}

/* Small status/meta badges read as compact rounded rectangles on
   DiscountZAR, not full pills. */
.badge { border-radius: 8px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background-color: transparent;
  background-image: var(--dz-primary-grad);
  box-shadow: 0 4px 16px rgba(124, 92, 252, .30);
}
.btn-primary:hover {
  background-image: linear-gradient(135deg, #6d4ffb 0%, #4f52ea 100%);
  box-shadow: 0 6px 20px rgba(124, 92, 252, .4);
}
.btn-primary:active { background-image: var(--dz-primary-grad); }

.btn-dark {
  background-color: transparent;
  background-image: var(--dz-dark-grad);
  box-shadow: 0 8px 24px rgba(26, 18, 48, .28);
}
.btn-dark:hover { background-image: linear-gradient(135deg, #241a48 0%, #362685 100%); }
html.dark .btn-dark, .dark .btn-dark {
  background-image: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
  box-shadow: none;
}

.btn, .chip, .badge, .nav-link, .side-link, .admin-link, .eyebrow,
.label, .table thead th, .select, h1, h2, h3, h4 {
  font-family: 'Outfit', 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Gradient emphasis text — DiscountZAR's headline treatment uses the
   primary purple gradient, not amber. */
.gold-text {
  background-image: var(--dz-primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── Category rail ──────────────────────────────────────────── */
.chip {
  border-radius: 999px;
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
}
.chip-active {
  background-color: transparent;
  background-image: var(--dz-primary-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 92, 252, .28);
}
.chip-active:hover { color: #fff; border-color: transparent; }
html.dark .chip-active, .dark .chip-active { background-image: var(--dz-primary-grad); color: #fff; }

/* ── Nav ────────────────────────────────────────────────────── */
.nav-link {
  padding: .5rem .9rem;
  border-radius: 999px;
  font-weight: 600;
}
.nav-link-active {
  background-color: var(--dz-surface);
  color: var(--dz-primary);
}
html.dark .nav-link-active, .dark .nav-link-active {
  background-color: rgba(124, 92, 252, .16);
  color: #c4b5fd;
}
.nav-link .absolute { display: none; } /* underline indicator replaced by the pill background above */

/* ── Inputs: purple focus, matching the reference's search/filter
   fields rather than the old amber focus ring. ─────────────────── */
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--dz-primary) !important;
  box-shadow: 0 0 0 3px rgba(124, 92, 252, .12);
}
.checkbox { accent-color: var(--dz-primary); }
::selection { background-color: rgba(124, 92, 252, .28); color: var(--dz-ink); }

/* ============================================================
 * Marketplace — product card, matching the DiscountZAR anatomy:
 * gradient image wrap + floating price box, category/region/
 * fulfilment badges, title, availability bar, vendor attribution
 * row, gradient "Buy" CTA.
 * ============================================================ */

.mp-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1.5px solid var(--dz-border);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(26, 18, 48, .04);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1), border-color .25s;
}
.mp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(124, 92, 252, .14);
  border-color: #DDD6FE;
}
.mp-card.mp-card-featured {
  border-color: var(--dz-amber);
  box-shadow: 0 12px 32px rgba(245, 158, 11, .10);
}
.mp-card.mp-card-soldout { opacity: .62; }

.mp-card-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.4rem 1.1rem .9rem;
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
}
html.dark .mp-card, .dark .mp-card { background: #171225; border-color: #2A2345; }
html.dark .mp-card-media, .dark .mp-card-media { background: linear-gradient(135deg,#221C39 0%,#171225 100%); }

.mp-card-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--dz-border);
  box-shadow: 0 4px 16px rgba(124, 92, 252, .15);
  color: var(--dz-primary);
  flex-shrink: 0;
}
html.dark .mp-card-icon-wrap, .dark .mp-card-icon-wrap { background: #100B1F; }

.mp-card-featured-ribbon {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--dz-amber);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .3);
}

.mp-price-box {
  text-align: right;
  background: #fff;
  border: 1.5px solid var(--dz-border);
  border-radius: 10px;
  padding: 6px 11px;
  box-shadow: 0 2px 8px rgba(124, 92, 252, .1);
  flex-shrink: 0;
}
html.dark .mp-price-box, .dark .mp-price-box { background: #100B1F; }
.mp-price-box .mp-price {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  color: var(--dz-ink);
  white-space: nowrap;
}
html.dark .mp-price-box .mp-price, .dark .mp-price-box .mp-price { color: #F5F3FF; }
.mp-price-box .mp-price-period {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dz-muted-2);
}

.mp-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: .7rem;
  padding: 1.1rem 1.1rem 1.2rem;
}

.mp-badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.mp-badge-cat {
  display: inline-flex; align-items: center; flex-shrink: 0;
  background: var(--dz-surface-2); color: var(--dz-primary);
  font-family: 'Outfit', sans-serif; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 6px;
}
.mp-badge-region {
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
  background: var(--dz-green-bg); color: var(--dz-green); border: 1px solid var(--dz-green-border);
  font-family: 'Outfit', sans-serif; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 7px; border-radius: 6px; white-space: nowrap;
}
.mp-badge-fulfil {
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
  background: #FFF7ED; color: var(--dz-orange); border: 1px solid #FED7AA;
  font-family: 'Outfit', sans-serif; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 7px; border-radius: 6px; white-space: nowrap;
}

.mp-card-title {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: var(--dz-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html.dark .mp-card-title, .dark .mp-card-title { color: #F5F3FF; }

.mp-availability { display: flex; flex-direction: column; gap: 6px; }
.mp-availability-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-availability-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; color: var(--dz-muted);
}
.mp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dz-green); flex-shrink: 0; }
.mp-dot-empty { background: #D1D5DB; }
.mp-availability-pct { font-family: 'Outfit', sans-serif; font-size: 11px; font-weight: 700; color: var(--dz-primary); }
.mp-bar-track { height: 6px; border-radius: 999px; background: var(--dz-surface-2); overflow: hidden; }
.mp-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7C5CFC, #A78BFA); }

.mp-vendor-row {
  display: flex; align-items: center; gap: 7px;
  background: var(--dz-surface); border: 1.5px solid var(--dz-border);
  border-radius: 10px; padding: 8px 10px;
}
html.dark .mp-vendor-row, .dark .mp-vendor-row { background: #221C39; border-color: #2A2345; }
.mp-vendor-avatar {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  background: #fff; border: 1.5px solid var(--dz-border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-family: 'Outfit', sans-serif; font-size: 9px; font-weight: 800; color: var(--dz-primary);
}
.mp-vendor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mp-vendor-meta { min-width: 0; }
.mp-vendor-name {
  margin: 0; font-family: 'Outfit', sans-serif; font-size: 10.5px; font-weight: 800;
  color: var(--dz-primary); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-vendor-sub {
  margin: 0; font-family: 'DM Sans', sans-serif; font-size: 9px; color: var(--dz-muted-2); line-height: 1.15;
}
.mp-vendor-check { margin-left: auto; flex-shrink: 0; color: var(--dz-amber); }

.mp-cta-row { display: flex; gap: 8px; margin-top: auto; }
.mp-buy-btn {
  flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background-image: var(--dz-primary-grad);
  color: #fff; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .04em;
  border: none; border-radius: 12px; padding: 12px;
  box-shadow: 0 4px 16px rgba(124, 92, 252, .3);
  transition: transform .2s, box-shadow .2s;
}
.mp-buy-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 92, 252, .4); }
.mp-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; flex-shrink: 0;
  background: var(--dz-surface); color: var(--dz-primary);
  border: 1.5px solid var(--dz-border); border-radius: 10px;
  transition: background-color .2s;
}
.mp-icon-btn:hover { background: var(--dz-border); }

/* ── Dark "spotlight" surfaces: Hot Deals + Top Vendors banners ── */
.mp-spotlight {
  position: relative;
  border-radius: 22px;
  background: var(--dz-spotlight-grad);
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: 0 14px 34px rgba(9,10,16,.35);
  padding: 1.4rem 1.4rem 1.6rem;
  overflow: hidden;
}
.mp-spotlight::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 15% 0%, rgba(124,92,252,.20), transparent 55%);
  pointer-events: none;
}
.mp-spotlight-eyebrow {
  font-family: 'Outfit', sans-serif; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: #A78BFA;
}
.mp-spotlight-title { font-family: 'Outfit', sans-serif; font-weight: 800; color: #fff; }
.mp-spotlight-sub { font-family: 'DM Sans', sans-serif; color: #9CA3AF; }

.mp-spotlight-card {
  flex-shrink: 0;
  width: 15.5rem;
  display: flex; align-items: center; gap: .65rem;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: .7rem .8rem;
  transition: background-color .2s, border-color .2s;
}
.mp-spotlight-card:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.mp-spotlight-img {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; color: #C4B5FD; overflow: hidden;
}
.mp-spotlight-img img { width: 100%; height: 100%; object-fit: cover; }
.mp-spotlight-name {
  margin: 0; font-family: 'Outfit', sans-serif; font-size: 12.5px; font-weight: 700;
  color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-spotlight-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.mp-spotlight-price {
  font-family: 'Outfit', sans-serif; font-size: 12.5px; font-weight: 800; color: #34D399;
}
.mp-spotlight-cat {
  font-family: 'DM Sans', sans-serif; font-size: 10px; color: #9CA3AF;
}

/* ── Top vendors, dark banner variant ─────────────────────────── */
.mp-vendor-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 84px; flex-shrink: 0; text-align: center;
}
.mp-vendor-tile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: #1e293b; border: 3px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: #fff; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 15px;
}
.mp-vendor-tile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mp-vendor-tile-avatar.mp-vendor-verified {
  border-color: var(--dz-amber);
  box-shadow: 0 0 10px rgba(245,158,11,.4);
}
.mp-vendor-tile-name {
  margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Outfit', sans-serif; font-size: 11.5px; font-weight: 700; color: #fff;
}
.mp-vendor-tile-stats {
  margin: 0; font-family: 'DM Sans', sans-serif; font-size: 9.5px; color: #94A3B8;
}

/* ── Filter bar ─────────────────────────────────────────────── */
.mp-filter-bar {
  background: #FAF9FF;
  border: 1.5px solid var(--dz-border);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(124, 92, 252, .03);
  padding: 1rem 1.25rem;
}
html.dark .mp-filter-bar, .dark .mp-filter-bar { background: #171225; border-color: #2A2345; }

.mp-search-input {
  border-radius: 14px !important;
  border-color: var(--dz-border) !important;
}

/* ============================================================
 * Admin console: same palette, same 20px surfaces, no structural
 * change — the accent that used to be gold/champagne is now the
 * DiscountZAR purple.
 * ============================================================ */
.admin-link-active, .side-link-active {
  background-color: transparent;
  background-image: var(--dz-dark-grad);
}
