/* ============================================================
   Roast House Coffee – styles.css
   ============================================================ */

/* ============================================================
   CSS Custom Properties – Light Theme
   ============================================================ */
:root {
  color-scheme: light;
  --ink:        #201b17;
  --muted:      #6b625a;
  --line:       #ddd5cc;
  --paper:      #fbfaf7;
  --surface:    #ffffff;
  --coffee:     #493021;
  --leaf:       #2e6f52;
  --berry:      #a7354d;
  --gold:       #d69a2d;
  --warn:       #c47d00;
  --shadow:     0 12px 40px rgba(32,27,23,.1);
  --shadow-lg:  0 24px 60px rgba(32,27,23,.18);
  --header-h:   68px;
  --radius:     10px;
  --ease:       .22s ease;
}

/* ============================================================
   Dark Theme
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --ink:        #ede8e2;
  --muted:      #9e9087;
  --line:       #352d27;
  --paper:      #18120e;
  --surface:    #231a14;
  --coffee:     #c9a87a;
  --leaf:       #59a87c;
  --berry:      #e05577;
  --gold:       #e0a832;
  --warn:       #e0a832;
  --shadow:     0 12px 40px rgba(0,0,0,.35);
  --shadow-lg:  0 24px 60px rgba(0,0,0,.5);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background var(--ease), color var(--ease);
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { margin: 0; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(18px, 4vw, 56px); height: var(--header-h);
  background: rgba(251,250,247,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transition: background var(--ease), border-color var(--ease);
}
[data-theme="dark"] .site-header { background: rgba(24,18,14,.94); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  height: 36px; width: auto; border-radius: 6px; flex-shrink: 0;
  object-fit: cover; display: block;
  transition: transform .3s ease;
}
.brand:hover .brand-mark { transform: rotate(-3deg) scale(1.04); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions a { color: var(--muted); font-weight: 700; transition: color var(--ease); min-height: 44px; display: inline-flex; align-items: center; }
.header-actions a:hover { color: var(--ink); }
.header-actions a[hidden] { display: none; }

/* Dark Mode Toggle */
#darkToggle {
  background: none; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; font-size: .95rem; line-height: 1;
  color: var(--muted); display: inline-flex; align-items: center;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  min-height: 36px;
}
#darkToggle:hover { background: var(--surface); color: var(--ink); border-color: var(--muted); }

/* ============================================================
   Shared Buttons
   ============================================================ */
.primary-button, .secondary-button, .primary-link, .cart-button {
  min-height: 44px; border: 0; border-radius: var(--radius);
  cursor: pointer; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 20px; gap: 8px;
  transition: opacity var(--ease), transform var(--ease);
}
.primary-button:hover, .primary-link:hover { opacity: .88; transform: translateY(-1px); }
.secondary-button:hover { opacity: .85; transform: translateY(-1px); }
.primary-button, .primary-link { color: #fff; background: var(--leaf); }
.secondary-button { color: var(--coffee); background: transparent; border: 1.5px solid var(--line); }
[data-theme="dark"] .secondary-button { color: var(--gold); }

/* Cart button */
.cart-button { color: #fff; background: var(--coffee); text-decoration: none; }
.cart-button .cart-badge {
  min-width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--coffee); background: #fff; font-size: .78rem; font-weight: 900;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.cart-button.bump .cart-badge { transform: scale(1.45); }
button:disabled { cursor: not-allowed; opacity: .5; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: calc(100svh - var(--header-h));
  display: grid; grid-template-columns: minmax(0,1.05fr) minmax(280px,.95fr);
  align-items: center; gap: clamp(28px,5vw,72px);
  padding: clamp(34px,6vw,84px) clamp(18px,5vw,72px) 40px;
  background:
    linear-gradient(125deg, rgba(255,255,255,.88), rgba(255,255,255,.18)),
    radial-gradient(circle at 18% 20%, rgba(214,154,45,.22), transparent 24%),
    radial-gradient(circle at 80% 28%, rgba(46,111,82,.16), transparent 26%),
    var(--paper);
}
[data-theme="dark"] .hero {
  background:
    linear-gradient(125deg, rgba(35,26,20,.96), rgba(24,18,14,.6)),
    radial-gradient(circle at 18% 20%, rgba(214,154,45,.10), transparent 30%),
    radial-gradient(circle at 80% 28%, rgba(89,168,124,.08), transparent 30%),
    var(--paper);
}
.hero-copy { max-width: 680px; }
.eyebrow {
  margin: 0 0 12px; color: var(--leaf); font-size: .78rem;
  font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
}
h1 {
  margin: 0 0 20px; max-width: 12ch;
  font-size: clamp(2.4rem,7vw,5.5rem); line-height: .95; letter-spacing: -.02em;
}
.hero-copy p:not(.eyebrow) {
  max-width: 58ch; color: var(--muted);
  font-size: clamp(.98rem,2vw,1.15rem); line-height: 1.75; margin: 0 0 28px;
}

/* Hero art */
.hero-art { position: relative; min-height: 420px; display: grid; place-items: center; }
.hero-art::before {
  content: ''; position: absolute;
  width: min(90%,420px); height: 110px; bottom: 10px; border-radius: 50%;
  background: rgba(32,27,23,.12); filter: blur(6px);
}
[data-theme="dark"] .hero-art::before { background: rgba(0,0,0,.35); }
.hero-image {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

/* ============================================================
   Shop Section
   ============================================================ */
.shop-section { padding: clamp(48px,7vw,80px) clamp(18px,5vw,72px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading.compact { display: block; margin-bottom: 24px; }

/* Products grid */
.products { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.product-card {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 16px; padding: 18px;
  transition: transform var(--ease), box-shadow var(--ease);
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.product-card.product-disabled { opacity: .38; pointer-events: none; filter: grayscale(.5); }

.product-visual {
  display: grid; min-height: 170px; place-items: center; border-radius: 10px;
  background:
    radial-gradient(circle at 20% 20%, rgba(214,154,45,.28), transparent 28%),
    linear-gradient(145deg,#f3efe8,#e8f0e7);
}
[data-theme="dark"] .product-visual {
  background:
    radial-gradient(circle at 20% 20%, rgba(214,154,45,.12), transparent 28%),
    linear-gradient(145deg,#28201a,#1e2820);
}
.bag {
  position: relative; width: 116px; height: 142px;
  border-radius: 8px 8px 14px 14px;
  background: linear-gradient(160deg,#3f2a20,#8d6243);
  box-shadow: 0 20px 28px rgba(32,27,23,.25);
}
.bag::before {
  content: ''; position: absolute; inset: 18px 18px auto; height: 48px; border-radius: 50%;
  background: radial-gradient(circle at 62% 40%, transparent 0 8px, #fff 9px 11px, transparent 12px), #f6efe5;
}
.bag::after {
  content: attr(data-size); position: absolute; left: 16px; right: 16px; bottom: 18px;
  display: grid; height: 34px; place-items: center;
  border-radius: 6px; color: var(--coffee); background: var(--gold); font-weight: 900;
}
.product-image { width: min(100%,180px); height: 150px; object-fit: contain; border-radius: 8px; margin: auto; }
.product-meta { display: grid; gap: 8px; }
.product-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-title-row h3 { margin: 0; font-size: 1.1rem; }
.product-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .92rem; }
.product-actions { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: end; }

/* Low stock badge */
.low-stock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 20px; font-size: .76rem; font-weight: 800;
  background: #fff3cd; color: #856404; border: 1px solid #ffc107;
}
[data-theme="dark"] .low-stock-badge { background: #3d2e00; color: #e0a832; border-color: #7a5c00; }

/* ============================================================
   Cart Slide-In Panel (right drawer)
   ============================================================ */
.cart-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(32,27,23,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
  width: min(420px,100vw);
  background: var(--surface);
  box-shadow: -6px 0 50px rgba(32,27,23,.22);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .cart-panel { box-shadow: -6px 0 50px rgba(0,0,0,.55); }
.cart-panel.open { transform: translateX(0); }

.cart-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.cart-panel-head h2 { font-size: 1.25rem; }
.cart-close {
  background: none; border: 0; font-size: 1.3rem; cursor: pointer;
  color: var(--muted); padding: 4px 8px; border-radius: 8px; line-height: 1;
  transition: background var(--ease), color var(--ease);
}
.cart-close:hover { background: var(--paper); color: var(--ink); }
.cart-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-panel-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; flex-shrink: 0; }
.cart-panel-total {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; font-size: 1.1rem; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

/* ============================================================
   Cart Items (shared: panel + cart page)
   ============================================================ */
.cart-items { display: grid; gap: 0; }
.cart-item {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  animation: slideInRight .25s ease both;
}
.cart-item:last-child { border-bottom: 0; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cart-item.removing { animation: slideOutRight .22s ease forwards; }
@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(24px); }
}
.cart-item strong, .cart-item span { display: block; }
.cart-item span { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.cart-item-qty-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.qty-btn {
  width: 26px; height: 26px; flex-shrink: 0; border: 1.5px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--coffee); font-weight: 900; font-size: .9rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center; transition: background var(--ease), border-color var(--ease);
}
.qty-btn:hover { background: var(--paper); border-color: var(--muted); }
[data-theme="dark"] .qty-btn { color: var(--gold); }
.cart-item-qty { min-width: 1.4em; text-align: center; font-weight: 800; font-size: .92rem; }
.cart-item-line-total { color: var(--muted); font-size: .84rem; }

.remove-item {
  min-width: 34px; height: 34px; border: 0; border-radius: 8px;
  color: var(--berry); background: rgba(167,53,77,.1);
  cursor: pointer; font-weight: 900; font-size: .82rem; align-self: center;
  transition: background var(--ease);
}
.remove-item:hover { background: rgba(167,53,77,.22); }
.cart-empty { text-align: center; color: var(--muted); font-style: italic; padding: 28px 0; font-size: .95rem; }

/* ============================================================
   Forms & Inputs
   ============================================================ */
input, select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 11px 12px; color: var(--ink); background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, background var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(46,111,82,.15);
}
input[type="file"] { padding: 8px 12px; cursor: pointer; }
input[readonly] { background: var(--paper); cursor: default; color: var(--muted); }
label { display: grid; gap: 6px; color: var(--coffee); font-weight: 800; font-size: .9rem; }
[data-theme="dark"] label { color: var(--gold); }
.form-note { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.55; }

fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; color: var(--coffee); font-weight: 900; font-size: .95rem; }
[data-theme="dark"] legend { color: var(--gold); }

/* Address type toggle */
.address-toggle { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.address-toggle label { min-height: 54px; cursor: pointer; position: relative; }
.address-toggle span {
  display: grid; min-height: 54px; place-items: center;
  border: 2px solid var(--line); border-radius: 10px; background: var(--surface);
  font-weight: 800; transition: all .18s ease;
}
.address-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.address-toggle input:checked + span { color: #fff; border-color: var(--leaf); background: var(--leaf); }

.address-fields { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; }
.form-row-address { display: grid; grid-template-columns: 1fr 1fr 130px; gap: 12px; }

/* Email fallback */
.email-fallback { margin: 0; color: var(--coffee); font-weight: 800; line-height: 1.5; font-size: .9rem; }
.email-fallback a { text-decoration: underline; }

/* ============================================================
   Cart / Checkout Page
   ============================================================ */
.cart-page-section { padding: clamp(32px,5vw,64px) clamp(18px,5vw,72px); }
.cart-page-layout {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,400px); gap: 36px; align-items: start;
}
.checkout-form { display: grid; gap: 18px; }

/* Order summary panel on cart page */
.order-summary-panel {
  position: sticky; top: calc(var(--header-h) + 18px);
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow);
  padding: 20px; display: grid; gap: 14px;
}
.order-summary-panel h2 { font-size: 1.3rem; }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-total { font-weight: 900; font-size: 1.1rem; padding-top: 12px; border-top: 2px solid var(--line); }

/* ============================================================
   Admin Shared
   ============================================================ */
.admin-section.standalone {
  min-height: calc(100svh - var(--header-h));
  padding: clamp(32px,5vw,60px) clamp(18px,5vw,72px);
}
.admin-page h1 { margin: 0; max-width: none; font-size: clamp(2rem,5vw,3.8rem); line-height: 1.05; }
.admin-layout { display: block; width: 100%; }
#adminLogin, #settingsLogin { max-width: 420px; margin: 40px auto; width: 100%; }
.admin-card {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 18px; padding: 22px;
}
.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.admin-panel-header h3 { font-size: 1.15rem; flex: 1; }
.admin-panel-header .secondary-button { text-decoration: none; font-size: .85rem; }

/* ============================================================
   Stock Table – Polished Admin
   ============================================================ */
.stock-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stock-table-head {
  display: grid; grid-template-columns: 1fr 68px 260px 60px;
  gap: 10px; padding: 10px 14px;
  background: var(--paper); border-bottom: 1px solid var(--line);
  font-size: .73rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.stock-row {
  display: grid; grid-template-columns: 1fr 68px 260px 60px;
  gap: 10px; padding: 13px 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  align-items: center; transition: background .15s ease;
}
.stock-row:last-child { border-bottom: 0; }
.stock-row:hover { background: var(--paper); }
.stock-row.row-disabled { opacity: .45; }
.stock-row-name { min-width: 0; }
.stock-row-name strong { display: block; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-row-name span  { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.stock-count { font-weight: 800; font-size: .95rem; text-align: center; }
.stock-controls { display: flex; align-items: center; gap: 6px; }
.stock-controls input { width: 64px; padding: 8px 10px; font-size: .88rem; }
.stock-controls .secondary-button { padding: 0 10px; min-height: 38px; font-size: .8rem; white-space: nowrap; }
.stock-row-toggle { display: flex; align-items: center; justify-content: center; }

/* Low stock warnings panel */
.low-stock-warnings {
  display: grid; gap: 10px; padding: 14px;
  border: 1.5px solid #ffc107; border-radius: 10px; background: #fffbef;
}
[data-theme="dark"] .low-stock-warnings { background: #2a1f00; border-color: #7a5c00; }
.low-stock-warnings-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.low-stock-warning-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; background: rgba(255,193,7,.12); border: 1px solid rgba(255,193,7,.35);
}
[data-theme="dark"] .low-stock-warning-item { background: rgba(224,168,50,.1); border-color: rgba(224,168,50,.3); }
.warning-icon { font-size: 1.1rem; flex-shrink: 0; }
.warning-text { flex: 1; min-width: 0; }
.warning-text strong { display: block; font-size: .88rem; }
.warning-text span   { display: block; font-size: .8rem; color: var(--warn); }

/* ============================================================
   Toggle Switch
   ============================================================ */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--line); border-radius: 22px; transition: background .22s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .22s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--leaf); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   Session Timeout Bar
   ============================================================ */
.session-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--berry); color: #fff; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 700; font-size: .9rem; flex-wrap: wrap;
  transform: translateY(100%); transition: transform .3s ease;
  box-shadow: 0 -4px 28px rgba(0,0,0,.28);
}
.session-bar.visible { transform: translateY(0); }
.session-bar-actions { display: flex; gap: 10px; flex-shrink: 0; }
.session-bar button {
  background: rgba(255,255,255,.22); border: 0; color: #fff;
  border-radius: 6px; padding: 6px 16px; cursor: pointer; font-weight: 800;
  transition: background .15s ease; min-height: 36px;
}
.session-bar button:hover { background: rgba(255,255,255,.38); }

/* ============================================================
   Toast
   ============================================================
   Bottom-center of the screen (not top/middle) so it reads as
   a typical toast notification while still staying clear of
   the cart panel's "Proceed to checkout" button.
   ============================================================ */
.toast {
  position: fixed; bottom: 28px; left: 50%; z-index: 250;
  max-width: min(360px,calc(100vw - 36px)); min-width: 180px;
  transform: translate(-50%, 0) scale(.96); opacity: 0; pointer-events: none;
  border-radius: 10px; padding: 13px 18px;
  background: var(--coffee); color: #fff;
  font-weight: 700; font-size: .92rem; line-height: 1.4;
  text-align: center;
  box-shadow: 0 8px 30px rgba(32,27,23,.28);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ============================================================
   Order History (Admin Stock page)
   ============================================================ */
.order-history { display: grid; gap: 10px; }
.order-history-row {
  display: grid; gap: 6px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.order-history-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: .88rem; }
.order-history-main strong { font-size: .92rem; }
.order-history-main span { color: var(--muted); }
.order-history-items { font-size: .85rem; color: var(--muted); }
.order-history-status { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.order-history-error { font-size: .78rem; color: var(--berry); }

/* ============================================================
   Orders page (filters + table)
   ============================================================ */
.order-filters-form {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  align-items: end; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.order-filters-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

.orders-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 16px;
}
.page-size-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 700; color: var(--muted);
}
.page-size-label select {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  background: var(--surface); color: var(--coffee); font-weight: 700; font-size: .85rem;
}

.orders-table { display: grid; gap: 8px; margin-top: 10px; }
.orders-table-head, .orders-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.1fr 1.6fr .7fr .7fr .8fr;
  gap: 10px; align-items: center;
}
.orders-table-head {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 0 14px;
}
.orders-row {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-size: .88rem;
}
.orders-row-items { color: var(--muted); font-size: .82rem; }
.order-number-link { font-weight: 800; color: var(--coffee); text-decoration: underline; }
.confirm-checkbox { width: 20px; height: 20px; cursor: pointer; accent-color: var(--leaf); }

.orders-pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.page-indicator { font-size: .85rem; font-weight: 700; color: var(--muted); }

@media (max-width: 860px) {
  .order-filters-form { grid-template-columns: 1fr 1fr; }
  .orders-table-head { display: none; }
  .orders-row { grid-template-columns: 1fr; gap: 4px; }
  .orders-toolbar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Order Detail page
   ============================================================ */
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.order-detail-fields { display: grid; gap: 10px; margin: 0; }
.order-detail-field { display: grid; gap: 2px; }
.order-detail-field dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.order-detail-field dd { margin: 0; font-weight: 700; }
.order-detail-items { display: grid; gap: 8px; }

.email-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.email-preview-header { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: .85rem; display: grid; gap: 4px; }
.email-preview-body {
  margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.5; max-height: 480px; overflow-y: auto;
}

@media (max-width: 860px) {
  .order-detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Admin Settings – SMTP configuration
   ============================================================ */
.smtp-settings-form { display: grid; gap: 14px; }
.smtp-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800;
}
.smtp-status-pill.configured { background: rgba(46,111,82,.14); color: var(--leaf); }
.smtp-status-pill.unconfigured { background: rgba(167,53,77,.12); color: var(--berry); }

/* ============================================================
   Admin Settings
   ============================================================ */
.settings-layout { display: block; }
.settings-panel { gap: 22px; }
.shop-settings-form { display: grid; gap: 14px; }
.settings-divider { height: 1px; background: var(--line); margin: 4px 0; }
.product-editor-rows { display: grid; gap: 16px; }
.product-editor-card {
  display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 16px;
  padding: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper);
}
.product-editor-preview {
  display: grid; min-height: 180px; place-items: center; border-radius: 8px;
  background: linear-gradient(145deg,#f3efe8,#e8f0e7); overflow: hidden;
}
[data-theme="dark"] .product-editor-preview { background: linear-gradient(145deg,#2a2218,#1e2a22); }
.product-editor-preview img { width: 100%; height: 180px; object-fit: contain; }
.product-editor-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.wide-field, .editor-actions { grid-column: 1 / -1; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.product-editor-toggle { display: flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 700; color: var(--muted); }

/* ============================================================
   About Us page
   ============================================================ */
.about-section { padding: clamp(32px,5vw,64px) clamp(18px,5vw,72px); max-width: 1100px; margin: 0 auto; }
.about-story {
  max-width: 72ch; color: var(--muted); line-height: 1.75;
  font-size: clamp(.96rem,1.6vw,1.05rem); margin: 0 0 18px;
}
.about-grid {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr);
  gap: 24px; margin-top: 28px; align-items: stretch;
}
.about-details { gap: 20px; }
.about-details h2 { font-size: 1.2rem; }
.about-fields { display: grid; gap: 16px; margin: 0; }
.about-field { display: grid; gap: 4px; }
.about-field dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.about-field dd { margin: 0; font-weight: 700; font-size: 1rem; }
.about-field dd a { text-decoration: underline; color: var(--leaf); }
[data-theme="dark"] .about-field dd a { color: var(--gold); }
.about-map { padding: 0; overflow: hidden; min-height: 320px; }
.about-map iframe { width: 100%; height: 100%; min-height: 320px; display: block; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) { .products { grid-template-columns: repeat(2,minmax(0,1fr)); } }

@media (max-width: 920px) {
  .hero, .cart-page-layout, .admin-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-bottom: 60px; }
  .hero-art { min-height: 320px; }
  .order-summary-panel { position: static; }
  .settings-layout, .product-editor-card, .product-editor-fields { grid-template-columns: 1fr; }
  .product-editor-preview { min-height: 130px; }
  .product-editor-preview img { height: 130px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-map { min-height: 260px; }
}

@media (max-width: 760px) {
  .stock-table-head, .stock-row { grid-template-columns: 1fr auto auto; }
  .col-count, .stock-count { display: none; }
}

@media (max-width: 640px) {
  .site-header { flex-direction: column; align-items: stretch; padding: 12px 18px; height: auto; }
  .header-actions { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  h1 { max-width: 10ch; }
  .hero-art { min-height: 280px; }
  .products { grid-template-columns: 1fr; }
  .address-toggle { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-address { grid-template-columns: 1fr; }
  .product-actions { grid-template-columns: 1fr; }
  .stock-table { overflow-x: auto; }
  .cart-panel { width: 100vw; }
  .session-bar { flex-direction: column; align-items: stretch; }
  .session-bar-actions { justify-content: flex-end; }
  .toast { left: 12px; right: 12px; width: auto; max-width: none; transform: scale(.96); }
  .toast.show { transform: scale(1); }
}