/* ============================================================
   Aron Sheli — Global Design System
   Stack: HTML / CSS / JS / PHP / MySQL
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700&family=DM+Sans:wght@400;500&family=Lora:ital,wght@1,400&display=swap');

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
  /* Colors */
  --ink:          #1C1A17;
  --paper:        #F5F2EB;
  --surface:      #EDEAE2;
  --muted:        #8A8479;
  --border:       rgba(28, 26, 23, 0.13);
  --border-mid:   rgba(28, 26, 23, 0.26);
  --border-strong:rgba(28, 26, 23, 0.42);
  --accent:       #D4522A;
  --accent-bg:    rgba(212, 82, 42, 0.10);
  --accent-border:rgba(212, 82, 42, 0.25);
  --green:        #4A6741;
  --green-bg:     rgba(74, 103, 65, 0.09);
  --green-border: rgba(74, 103, 65, 0.22);
  --error:        #B93030;
  --error-bg:     rgba(185, 48, 48, 0.08);
  --white:        #ffffff;

  /* Typography */
  --ff-display: 'Barlow Condensed', sans-serif;
  --ff-body:    'DM Sans', sans-serif;
  --ff-serif:   'Lora', serif;

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;

  /* Radius */
  --r-xs:   2px;
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-pill: 999px;

  /* Nav height */
  --nav-h: 52px;

  /* Sidebar width */
  --sidebar-w: 228px;

  /* Transitions */
  --ease: 0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-content {
  flex: 1;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--ff-body); }
input, select, textarea { font-family: var(--ff-body); }
img { display: block; max-width: 100%; }

/* ── Typography ─────────────────────────────────────────── */
.t-wordmark {
  font-family: var(--ff-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.t-wordmark span { color: var(--accent); }

.t-hero {
  font-family: var(--ff-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.t-h1 {
  font-family: var(--ff-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.t-h2 {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.t-h3 {
  font-family: var(--ff-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.t-body    { font-size: 15px; line-height: 1.6; }
.t-body-sm { font-size: 13px; line-height: 1.5; }
.t-caption { font-size: 14px; line-height: 1.4; }

.t-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.t-serif-italic {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--muted);
}

.t-muted  { color: var(--muted); }
.t-accent { color: var(--accent); }
.t-green  { color: var(--green); }

/* ── Price display ──────────────────────────────────────── */
.price-main {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.price-main.sale { color: var(--accent); }
.price-struck {
  font-size: 13px;
  color: var(--muted);
  text-decoration: line-through;
}
.price-obo {
  font-size: 11px;
  color: var(--muted);
}

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 0.5px solid var(--border-mid);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--sp-5);
}

.nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex: 1;
  padding-left: var(--sp-6);
}

/* RTL: flip nav-links padding */
[dir="rtl"] .nav-links { padding-left: 0; padding-right: var(--sp-6); }

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--ease);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); border-bottom-color: var(--ink); }
.nav-link.sell { color: var(--accent); }
.nav-link.sell:hover { color: var(--accent); opacity: 0.8; }

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Language switcher */
.lang-switcher { display: flex; gap: var(--sp-1); }
.lang-btn {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 7px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  transition: all var(--ease);
}
.lang-btn:hover { background: var(--surface); color: var(--ink); }
.lang-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  border: none;
  transition: opacity var(--ease), background var(--ease);
  white-space: nowrap;
}
.btn:hover   { opacity: 0.85; }
.btn:active  { opacity: 0.7; }

.btn-primary   { background: var(--ink);    color: var(--paper); }
.btn-accent    { background: var(--accent); color: var(--white); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover { background: var(--surface); opacity: 1; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 0.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--ink); opacity: 1; }

.btn-sm { font-size: 12px; padding: 6px 14px; }
.btn-lg { font-size: 17px; padding: 12px 28px; }
.btn-full { width: 100%; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: 2px solid rgb(212, 82, 42);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: rgb(212, 82, 42);
  text-decoration: none;
  transition: all var(--ease);
  background: transparent;
}
.btn-outline:hover {
  background: rgb(212, 82, 42);
  color: var(--paper);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge-category {
  font-family: var(--ff-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-xs);
  padding: 3px 9px;
}
.badge-condition {
  background: var(--surface);
  color: var(--ink);
  border: 0.5px solid var(--border);
}
.badge-sale {
  background: var(--accent-bg);
  color: var(--accent);
  border: 0.5px solid var(--accent-border);
}
.badge-origin {
  background: var(--green-bg);
  color: var(--green);
  border: 0.5px solid var(--green-border);
}
.badge-sold {
  background: var(--surface);
  color: var(--muted);
  border: 0.5px solid var(--border);
}
.badge-neutral {
  background: var(--surface);
  color: var(--muted);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-label .required { color: var(--accent); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--ease);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--ink); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); }
.form-select { appearance: none; cursor: pointer; }

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
[dir="rtl"] .select-wrap::after { right: auto; left: 10px; }

.form-error {
  font-size: 11px;
  color: var(--error);
  margin-top: 3px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* Checkbox / radio row */
.check-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  padding: 3px 0;
}
.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  width: 14px;
  height: 14px;
  accent-color: var(--ink);
  flex-shrink: 0;
  cursor: pointer;
}
.check-row span { font-size: 13px; }

/* ── Listing card ────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--ease);
}
.card:hover { border-color: var(--border-mid); }
.card.sold { opacity: 0.52; }

.card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-chip {
  position: absolute;
  font-family: var(--ff-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-xs);
}
.card-chip-sold { top: 8px; left: 8px; background: var(--ink); color: var(--paper); }
.card-chip-sale { top: 8px; right: 8px; background: var(--accent); color: var(--white); }
[dir="rtl"] .card-chip-sold { left: auto; right: 8px; }
[dir="rtl"] .card-chip-sale { right: auto; left: 8px; }

.card-color-dot {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
[dir="rtl"] .card-color-dot { right: auto; left: 8px; }

.card-body { padding: 9px 11px 12px; }

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Listing grid ────────────────────────────────────────── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

/* ── Filter sidebar ──────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 0.5px solid var(--border);
  padding: 20px 16px 40px;
  background: var(--paper);
  overflow-y: auto;
  height: calc(100vh - var(--nav-h));
  position: sticky;
  top: var(--nav-h);
}
[dir="rtl"] .sidebar { border-right: none; border-left: 0.5px solid var(--border); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.filter-section { margin-bottom: var(--sp-5); }

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.filter-options { display: flex; flex-direction: column; gap: 4px; }

.filter-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 3px 0;
}
.filter-opt input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--ink);
  flex-shrink: 0;
  cursor: pointer;
}
.filter-opt .opt-label { font-size: 12px; color: var(--ink); }
.filter-opt .opt-count { font-size: 11px; color: var(--muted); margin-left: auto; }
[dir="rtl"] .filter-opt .opt-count { margin-left: 0; margin-right: auto; }

.filter-select {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 12px;
  padding: 7px 10px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  appearance: none;
  cursor: pointer;
  outline: none;
}

.price-row { display: flex; gap: var(--sp-2); align-items: center; }
.price-input {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 12px;
  padding: 6px 8px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  outline: none;
}
.price-input:focus { border-color: var(--ink); }
.price-sep { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.filter-divider {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: var(--sp-4) 0;
}

.dim-note {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
  margin-bottom: var(--sp-3);
}

.clear-btn {
  font-family: var(--ff-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  transition: color var(--ease);
}
.clear-btn:hover { color: var(--ink); }

/* ── Active filter chips ─────────────────────────────────── */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--sp-4);
  min-height: 0;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: opacity var(--ease);
}
.filter-chip:hover { opacity: 0.8; }
.chip-x { font-size: 14px; font-weight: 400; line-height: 1; opacity: 0.65; }

/* ── Page layout helpers ─────────────────────────────────── */
.page-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

.page-main {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.results-count { font-size: 13px; color: var(--muted); }
.results-count strong { color: var(--ink); font-weight: 500; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 28px;
  color: var(--border-strong);
  margin-bottom: 12px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 0.5px solid var(--border);
  padding: var(--sp-5) var(--sp-5);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
}
.footer-copy {
  font-size: 15px;
  color: rgb(212, 82, 42);
}
.footer-tagline {
  font-size: 15px;
  color: rgb(212, 82, 42);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: var(--sp-5) 0;
}

/* ── Utility ─────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Color grid */
.modal-color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 16px;
  justify-items: center;
}


/* ── Sell CTA ─────────────────────────────────────────────── */
.sell-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border-top: 0.5px solid var(--border);
  direction: inherit;
}
.sell-cta-text {
  font-size: 14px;
  color: var(--ink);
}

.sell-cta-banner {
  position: relative;
  width: 100%;
  min-height: 220px;
  background: url('/chotim-app/img/closet-banner.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: inherit;
}
.sell-cta-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28,26,23,0.45);
}
.sell-cta-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sell-cta-heading {
  font-family: var(--ff-display);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.sell-cta-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  margin: 0;
  max-width: 400px;
}

/* ── Other Listings ─────────────────────────────────────────────── */
.other-listings {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 0;
  direction: inherit;
}
.other-listings-heading {
  font-family: var(--ff-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(212, 82, 42);
  margin-bottom: 16px;
}
.other-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.other-listing-card {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.other-listing-photo {
  aspect-ratio: 3/4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.other-listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.other-listing-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.other-listing-price {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
}

.other-listings {
  padding-bottom: 10px;
}

.other-listings-footer {
  text-align: center;
  margin-top: 24px;
  padding-bottom: 40px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--muted);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-mid);
}
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    background: var(--white);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ease);
}
.btn-google:hover { background: var(--surface); }

@media (max-width: 768px) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 25px;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.btn-close:hover { background: var(--border-light); }
