/* ── Emondt Materiaalapp — layout.css ────────────────── */

/* ═══ HEADER ═══════════════════════════════════════════════ */
header {
  background: var(--surface);
  height: var(--header-h);
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.h-left  { display: flex; align-items: center; gap: 12px; }
.h-logo  { display: flex; align-items: center; gap: 10px; }
.h-logo img { width: 28px; height: 28px; object-fit: contain; }
.h-brand { display: flex; flex-direction: column; }
.h-name  {
  font-size: 1.05rem; font-weight: 700;
  color: var(--white); letter-spacing: -.02em; line-height: 1;
}
.h-sub {
  font-size: .57rem; color: var(--green);
  text-transform: uppercase; letter-spacing: .2em;
  margin-top: 3px; font-weight: 600;
}
.menu-btn {
  width: 40px; height: 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.menu-btn:active { background: var(--surface3); }
.menu-btn span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text); border-radius: 2px; transition: all .25s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.cart-fab {
  background: var(--green); color: #000;
  border: none; border-radius: 22px;
  height: 38px; padding: 0 16px;
  font-family: 'Inter', 'DM Sans', sans-serif; font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; transition: transform .15s, box-shadow .2s;
  box-shadow: var(--shadow-green);
  letter-spacing: .01em;
}
.cart-fab:active { transform: scale(.95); }

/* ═══ OVERLAY ═══════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  z-index: 300; opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility .3s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.overlay.open { opacity: 1; visibility: visible; }

/* ═══ DRAWER ════════════════════════════════════════════════ */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(296px, 84vw);
  background: var(--surface);
  z-index: 400;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-strong);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head img { width: 34px; height: 34px; object-fit: contain; }
.drawer-head-text .t1 {
  font-size: .95rem; font-weight: 700;
  color: var(--white); letter-spacing: -.01em;
}
.drawer-head-text .t2 {
  font-size: .62rem; color: var(--green);
  text-transform: uppercase; letter-spacing: .16em;
  margin-top: 2px; font-weight: 600;
}
.drawer-scroll { flex: 1; padding: 8px 0; overflow-y: auto; }
.d-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px;
  font-size: .9rem; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: background .15s, color .15s;
}
.d-item:hover  { background: var(--surface2); color: var(--text); }
.d-item:active { background: var(--surface3); }
.d-item .ico {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.d-item .ico svg { width: 18px; height: 18px; }
.d-foot { padding: 8px 0 16px; border-top: 1px solid var(--border); }
#drawer-account { padding: 8px 20px 4px; font-size: .7rem; color: var(--muted); letter-spacing: .04em; }

/* ═══ SCREENS ════════════════════════════════════════════════ */
.screen {
  display: none;
  padding: 16px 16px calc(var(--nav-h) + 16px);
  min-height: calc(100dvh - var(--header-h));
  animation: screenIn .22s ease;
}
.screen.active { display: block; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ═══ BOTTOM NAV ═════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start;
  padding: 8px 4px 0;
  z-index: 200;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px;
  background: none; border: none;
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: .59rem; font-weight: 600;
  color: var(--muted);
  cursor: pointer; transition: color .2s;
  text-transform: uppercase; letter-spacing: .07em;
  border-radius: var(--radius-sm);
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; stroke-width: 1.8; transition: transform .22s cubic-bezier(0.34,1.56,0.64,1), color .2s; }
.nav-btn.active { color: var(--green); }
.nav-btn.active svg { transform: scale(1.18); }
.nav-cart-badge {
  position: absolute; top: 4px; right: calc(50% - 20px);
  background: var(--green); color: #000;
  font-size: .58rem; font-weight: 800;
  padding: 1px 5px; border-radius: 10px;
  min-width: 16px; text-align: center; line-height: 1.4;
}

/* ═══ TERUG NAAR BOVEN ═══════════════════════════════════════ */
#terug-boven {
  position: fixed; bottom: calc(var(--nav-h) + 14px); right: 14px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  cursor: pointer; z-index: 200;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
}
#terug-boven.zichtbaar { display: flex; }
#terug-boven:active { transform: scale(.9); }

/* ═══ FORM FIELDS ════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .78rem; font-weight: 600; color: var(--text-secondary); letter-spacing: .02em; }
.field input,
.field select,
.field textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: .95rem; color: var(--text);
  outline: none; width: 100%;
  transition: border-color .2s, background .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green); background: var(--surface3);
  box-shadow: 0 0 0 3px rgba(174,195,54,.14), var(--elev-1);
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface2) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.req { color: var(--green); }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media(max-width:380px) { .field-2 { grid-template-columns: 1fr; } }

/* ═══ LOGIN SCHERM ═══════════════════════════════════════════ */
#login-scherm {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 1000;
  display: flex; align-items: center;
  justify-content: center; flex-direction: column;
  padding: 24px;
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h2 { font-size: 1.25rem; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.login-logo p  { font-size: .88rem; color: var(--text-secondary); }
.login-fout {
  display: none;
  background: var(--danger-light);
  border: 1px solid rgba(252,104,104,.3);
  border-radius: var(--radius-sm);
  color: var(--danger); padding: 10px 14px;
  font-size: .85rem; font-weight: 500; margin-bottom: 16px;
}

/* ═══ LAAD INDICATOR ═════════════════════════════════════════ */
.laad-indicator {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 0; color: var(--text-secondary); font-size: .9rem;
}
.laad-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ UPDATE BANNER ══════════════════════════════════════════ */
#update-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + 10px); left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: .84rem;
  box-shadow: var(--shadow-lg);
  align-items: center; gap: 12px;
  max-width: calc(100vw - 32px);
}
