/* ─── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:       #c0392b;
  --red-dark:  #96281b;
  --red-light: #fadbd8;
  --green:     #27ae60;
  --green-light:#d5f5e3;
  --yellow:    #f39c12;
  --yellow-light:#fef9e7;
  --blue:      #2980b9;
  --blue-light:#d6eaf8;
  --orange:    #e67e22;
  --gray:      #7f8c8d;
  --gray-light:#ecf0f1;
  --text:      #1a1a1a;
  --text-muted:#6b7280;
  --border:    #e5e7eb;
  --bg:        #f9fafb;
  --white:     #ffffff;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
}

html { font-size: 16px; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── Layout ────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.main-content { min-height: calc(100vh - 64px - 72px); }

/* ─── Navbar ────────────────────────────────────────────────────────── */
.navbar { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; height: 64px; gap: 1rem; }
.nav-logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); flex-shrink: 0; }
.logo-icon { font-size: 1.3rem; }
.logo-text { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: .75rem; margin-left: auto; flex-shrink: 1; min-width: 0; }
.nav-link { color: var(--text-muted); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.nav-link:hover { color: var(--red); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.nav-name { font-size: .8rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; margin-left: auto; flex-shrink: 0; }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem 1.1rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500; border: none; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); color: white; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--gray-light); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Hero ──────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #1a0a08 0%, #3d1009 100%); color: white; padding: 4rem 1.5rem; }
.hero-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: .75rem; }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.8); margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-note { font-size: .85rem; color: rgba(255,255,255,.5); margin-top: 1rem; }
.hero-contact { font-size: .9rem; color: rgba(255,255,255,.75); margin-top: .75rem; }
.hero-contact a { color: #fff; text-decoration: underline; }

/* ─── Listings ──────────────────────────────────────────────────────── */
.listings-section { padding: 2.5rem 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-btn { padding: .4rem .9rem; border-radius: 99px; border: 1px solid var(--border); background: white; font-size: .85rem; cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--red); color: var(--red); }
.filter-btn.active { background: var(--red); color: white; border-color: var(--red); }
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.loading { grid-column: 1/-1; text-align: center; padding: 3rem; color: var(--text-muted); }
.empty  { grid-column: 1/-1; text-align: center; padding: 3rem; color: var(--text-muted); }

/* ─── Cards ─────────────────────────────────────────────────────────── */
.listing-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow); transition: box-shadow .15s; }
.listing-card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.card-product { font-weight: 700; font-size: 1.05rem; }
.card-price { font-size: 1.2rem; font-weight: 700; color: var(--red); }
.card-price span { font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.card-price.locked { font-size: .9rem; color: var(--text-muted); font-weight: 400; }
.card-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.card-details { display: flex; flex-direction: column; gap: .35rem; }
.detail-row { display: flex; justify-content: space-between; font-size: .85rem; }
.detail-row span:first-child { color: var(--text-muted); }
.card-footer { margin-top: auto; }

/* ─── Tags / Badges ─────────────────────────────────────────────────── */
.tag { display: inline-block; padding: .2rem .55rem; border-radius: 4px; font-size: .75rem; font-weight: 500; background: var(--gray-light); color: var(--text-muted); }
.tag-red    { background: var(--red-light);    color: var(--red-dark); }
.tag-orange { background: #fdebd0;             color: #784212; }
.tag-purple { background: #e8daef;             color: #4a235a; }
.tag-yellow { background: var(--yellow-light); color: #7e5109; }
.tag-blue   { background: var(--blue-light);   color: #1a5276; }
.tag-green  { background: var(--green-light);  color: #145a32; }
.tag-pink   { background: #fce7f3;             color: #9d174d; }
.tag-halal  { background: #005526;             color: #ffffff; }
.tag-gray   { background: var(--gray-light);   color: var(--gray); }

.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 500; }
.badge-green   { background: var(--green-light);  color: var(--green); }
.badge-yellow  { background: var(--yellow-light); color: var(--yellow); }
.badge-gray    { background: var(--gray-light);   color: var(--gray); }
.badge-blue    { background: var(--blue-light);   color: var(--blue); }
.badge-orange  { background: #fdebd0;             color: var(--orange); }
.badge-pending { background: #fff3cd; color: #856404; }

/* ─── Alerts ────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #dc2626; }
.alert-info  { background: var(--blue-light); color: var(--blue); }

/* ─── Forms ─────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .875rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  padding: .55rem .8rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--red);
}
.form-hint { font-size: .78rem; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; padding-top: .5rem; }
.form-panel { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.form-group-check { justify-content: flex-end; }
.check-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }
.req { color: var(--red); }
.select-inline { padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 4px; font-size: .8rem; }

/* ─── Radio group ───────────────────────────────────────────────────── */
.radio-group { display: flex; gap: 1rem; }
.radio-option { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .9rem; }

/* ─── Auth ──────────────────────────────────────────────────────────── */
.auth-wrapper { display: flex; justify-content: center; padding: 3rem 1rem; }
.auth-box { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 2rem; width: 100%; max-width: 640px; box-shadow: var(--shadow-md); }
.auth-box-center { text-align: center; max-width: 480px; }
.auth-logo { font-size: 1.4rem; font-weight: 700; color: var(--red); margin-bottom: 1.25rem; }
.auth-box h2 { margin-bottom: .25rem; }
.auth-sub { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-note { background: var(--blue-light); color: var(--blue); padding: .75rem 1rem; border-radius: var(--radius); font-size: .85rem; margin-bottom: 1.25rem; }
.pending-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ─── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal { background: white; border-radius: 16px; width: 100%; max-width: 480px; box-shadow: var(--shadow-md); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; }
.listing-summary { background: var(--gray-light); border-radius: var(--radius); padding: .75rem 1rem; }
.transport-badge { color: var(--green); font-weight: 500; }
.order-total { background: var(--red-light); border-radius: var(--radius); padding: .6rem 1rem; }
.total-line { font-size: .95rem; display: flex; align-items: center; gap: .6rem; }

/* ─── Page header ───────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 2rem 0 1.5rem; }
.page-header h1 { font-size: 1.75rem; }
.page-sub { color: var(--text-muted); font-size: .9rem; }
.section-title { font-weight: 600; font-size: 1rem; margin-bottom: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; }

/* ─── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { padding: .7rem 1rem; background: var(--gray-light); text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.data-table td { padding: .7rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: #fafafa; }
.empty-cell { text-align: center; color: var(--text-muted); padding: 2rem; }
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem; }

/* ─── Tabs ──────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tab { padding: .65rem 1.1rem; border: none; background: none; cursor: pointer; font-size: .9rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--red); border-bottom-color: var(--red); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: var(--red); color: white; border-radius: 50%; font-size: .7rem; margin-left: .35rem; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Prices layout ─────────────────────────────────────────────────── */
.prices-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; }
.prices-form { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; height: fit-content; }
.prices-chart-wrap { display: flex; flex-direction: column; gap: 1rem; }
.chart-filters { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.forecast-box { background: var(--yellow-light); border-radius: var(--radius); padding: 1rem; margin-top: .5rem; }
.forecast-box h4 { font-size: .9rem; margin-bottom: .5rem; }
.forecast-row { display: flex; justify-content: space-between; font-size: .875rem; padding: .2rem 0; }
.trend-up { color: var(--red); }
.trend-down { color: var(--green); }
.trend-stable { color: var(--text-muted); }

/* ─── Toast ─────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: #1a1a1a; color: white; padding: .75rem 1.25rem; border-radius: var(--radius); font-size: .9rem; z-index: 999; box-shadow: var(--shadow-md); }

/* ─── Flag switcher (navbar) ────────────────────────────────────────── */
#flag-switcher-mount { margin-left: .5rem; }
#flag-switcher-mount .flag-switcher { position: relative; }
#flag-switcher-mount .flag-current { background: var(--gray-light); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 4px; line-height: 1; }
#flag-switcher-mount .flag-current:hover { background: var(--border); }
.flag-dropdown { display: none; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; width: 220px; box-shadow: var(--shadow-md); }
.flag-dropdown.open { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
#flag-switcher-mount .flag-btn { background: none; border: 2px solid transparent; border-radius: 6px; padding: 4px; font-size: 20px; cursor: pointer; text-align: center; line-height: 1; }
#flag-switcher-mount .flag-btn:hover { background: var(--gray-light); }
#flag-switcher-mount .flag-btn.active { border-color: var(--red); background: var(--red-light); }

/* ─── WhatsApp knop ─────────────────────────────────────────────────── */
.btn-whatsapp { background: #25d366; color: #fff; border: none; }
.btn-whatsapp:hover { background: #1ebe5d; color: #fff; }

/* ─── Hero knop overrides (donkere achtergrond) ─────────────────────── */
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ─── Prijskoers ticker ─────────────────────────────────────────────── */
.price-ticker { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1.1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.price-ticker-inner { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.price-ticker-label { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-right: .25rem; white-space: nowrap; }
.price-ticker-avg { font-weight: 700; font-size: .9rem; color: var(--red); white-space: nowrap; margin-right: .5rem; }
.price-ticker-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.price-pill { display: inline-flex; align-items: center; gap: .3rem; background: var(--gray-light); border-radius: 999px; padding: .25rem .65rem; font-size: .8rem; }
.price-pill-name { color: var(--text); font-weight: 500; }
.price-pill-price { color: var(--red); font-weight: 700; }
.price-pill-week { color: var(--text-muted); font-size: .72rem; }

/* ─── Footer ────────────────────────────────────────────────────────── */
.footer { background: white; border-top: 1px solid var(--border); padding: 1.25rem 1.5rem; margin-top: 3rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; font-size: .85rem; color: var(--text-muted); }
.footer-inner p { margin: .2rem 0; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; gap: .75rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 1.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .prices-layout { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; position: fixed; bottom: 0; }
  .modal-overlay { align-items: flex-end; }
}

/* ─── Prijshistorie grafiek ─────────────────────────────────────────── */
.price-history-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}
.price-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.price-history-sub {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.price-history-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}