/* CSA Cart 3.0 — Farm-Rustic Minimal Theme
   Primary palette: warm sage green + cream + earthy brown
   Font: Lora (serif headings) + Source Sans 3 (body)
*/

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Sans+3:wght@300;400;600&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --green-dark:   #2d4a2d;
  --green-mid:    #4a7c59;
  --green-light:  #7aab8a;
  --green-pale:   #e8f0e9;
  --cream:        #faf8f3;
  --cream-dark:   #f0ebe0;
  --brown:        #6b4c2a;
  --brown-light:  #c4a882;
  --text-dark:    #2c2416;
  --text-mid:     #5a4e3c;
  --text-light:   #8a7d6b;
  --border:       #d8cfc0;
  --white:        #ffffff;
  --red:          #c0392b;
  --shadow-sm:    0 1px 3px rgba(44,36,22,.08);
  --shadow-md:    0 4px 12px rgba(44,36,22,.10);
  --radius:       8px;
  --radius-lg:    14px;
  --transition:   .18s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-dark);
  background: var(--cream);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Lora', serif;
  line-height: 1.25;
  color: var(--green-dark);
  font-weight: 600;
}

h1 { font-size: 1.75rem; margin-bottom: .75rem; }
h2 { font-size: 1.35rem; margin-bottom: .6rem; }
h3 { font-size: 1.1rem;  margin-bottom: .5rem; }

a { color: var(--green-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); text-decoration: underline; }

p { margin-bottom: .85rem; color: var(--text-mid); }
p:last-child { margin-bottom: 0; }

img { max-width: 100%; height: auto; }

/* ─── Layout ────────────────────────────────────────────── */

:root { --sidebar-w: 172px; }

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Outer body: sidebar column + content column ──
   The sidebar lives in its own grid column completely separate from
   the inner page content grid. This prevents any content height
   interaction with the sidebar. */
.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1;
  align-items: start;   /* each column sizes to its own content height */
  min-height: 0;
}

/* ── Left sidebar column ── */
.app-sidebar {
  grid-column: 1;
  grid-row: 1;
  position: -webkit-sticky; /* Required for iOS Safari / WebKit browsers */
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
  background: var(--white);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 8px rgba(44,36,22,.06);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Right content column ── */
.app-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

/* ── Inner content wrapper — padding and max-width ── */
.main-content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  width: 100%;
}

/* Pages with right cart widget: two-column inner grid */
.main-content.has-widget {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 0 1.25rem;
  align-items: start;
  max-width: 100%;
}

/* Pages without right widget: single column */
.main-content.no-widget,
.main-content.full-width {
  display: block;
}

.content-area { min-width: 0; }

/* Full-width pages (admin) */
.main-content.full-width {
  max-width: 1200px;
}

.content-area { min-width: 0; }

/* ─── Header ────────────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  padding: 0 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--white);
  flex-shrink: 0;
}

.site-logo svg { width: 32px; height: 32px; opacity: .92; }

.site-logo .logo-name {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
}

.site-logo .logo-tagline {
  font-size: .7rem;
  font-weight: 300;
  opacity: .7;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.header-user {
  font-size: .85rem;
  color: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-user a {
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: color var(--transition);
}

.header-user a:hover { color: var(--white); text-decoration: none; }

.header-user .user-name {
  color: var(--white);
  font-weight: 600;
}

/* ─── Navigation ────────────────────────────────────────── */
.site-nav {
  background: var(--green-mid);
  border-bottom: 2px solid var(--green-dark);
  overflow: hidden;        /* Hard-clips any child that tries to grow the bar */
}

.site-nav ul {
  max-width: 1200px;
  margin: 0 auto;
  list-style: none;
  display: flex;
  padding: 0 1.5rem;
  gap: 0;
  flex-wrap: nowrap;       /* Prevent any link from wrapping to a second line */
  align-items: stretch;    /* All li elements same height as the tallest */
}

.site-nav ul li {
  display: flex;
  align-items: stretch;
}

.site-nav ul li a {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem 1rem;
  color: rgba(255,255,255,.88);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;          /* Explicit — never inherits body line-height:1.65 */
  letter-spacing: .02em;
  white-space: nowrap;     /* Link text never wraps */
  transition: background var(--transition), color var(--transition);
  border-bottom: 3px solid transparent;
}

/* Any inline element inside a nav link (e.g. cart count badge)
   is vertically centred and cannot push the link taller */
.site-nav ul li a span,
.site-nav ul li a svg {
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}

.site-nav ul li a:hover,
.site-nav ul li a.active {
  color: var(--white);
  background: rgba(255,255,255,.12);
  text-decoration: none;
  border-bottom-color: var(--cream);
}

/* ─── Sidebar Navigation ────────────────────────────────── */

/* ── Mobile hamburger toggle (hidden on desktop) ── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem .4rem;
  color: var(--white);
  line-height: 0;
  border-radius: var(--radius);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,.15); }
.sidebar-toggle svg { display: block; }

/* ── Backdrop (mobile only, hidden by default) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Close bar (mobile only) ── */
.sidebar-close-bar {
  display: none;
  align-items: center;
  justify-content: flex-end;
  padding: .6rem .75rem;
  background: var(--green-dark);
}
.sidebar-close-bar button {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-family: 'Source Sans 3', sans-serif;
  padding: .25rem .5rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.sidebar-close-bar button:hover { background: rgba(255,255,255,.15); color: var(--white); }

/* ── Section header (accordion trigger) ── */
.sidebar-section-title {
  background: var(--green-pale);
  padding: .5rem .75rem;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--green-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  /* iOS WebKit requires cursor:pointer on non-anchor elements for tap events */
  -webkit-tap-highlight-color: rgba(0,0,0,.08);
  touch-action: manipulation;  /* Prevents 300ms tap delay on iOS */
  user-select: none;
  -webkit-user-select: none;
  transition: background var(--transition);
  line-height: 1;
}
.sidebar-section-title:hover { background: #d0e8d4; }

.sidebar-section-title .nav-chevron {
  flex-shrink: 0;
  transition: transform .2s ease;
  opacity: .6;
}
.sidebar-section-title.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

/* ── Collapsible list ── */
.sidebar-list {
  list-style: none;
  overflow: hidden;
  max-height: 400px;
  transition: max-height .22s ease, opacity .18s ease;
  opacity: 1;
  border-bottom: 1px solid var(--border);
}
.sidebar-list.nav-collapsed {
  max-height: 0 !important;
  opacity: 0;
  border-bottom: none;
}

/* ── Nav links ── */
.sidebar-list li a {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .75rem;
  font-size: .82rem;
  color: var(--text-mid);
  border-bottom: 1px solid var(--cream-dark);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.sidebar-list li:last-child a { border-bottom: none; }
.sidebar-list li a:hover {
  background: var(--green-pale);
  color: var(--green-dark);
  text-decoration: none;
}
.sidebar-list li a .nav-icon {
  flex-shrink: 0;
  opacity: .55;
  vertical-align: middle;
}

/* ─── Mobile: sidebar becomes a left-edge overlay ─── */
@media (max-width: 768px) {
  .sidebar-toggle    { display: flex; align-items: center; justify-content: center; }
  .sidebar-backdrop  { display: block; }
  .sidebar-close-bar { display: flex; }

  /* Collapse sidebar column to zero — content fills full width */
  .app-body {
    grid-template-columns: 0 1fr;
  }

  /* Sidebar becomes a fixed-position drawer over the content */
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    height: 100% !important;
    width: 240px;
    max-width: 82vw;
    max-height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    border-right: none;
    box-shadow: 4px 0 24px rgba(0,0,0,.22);
  }
  .app-sidebar.open { transform: translateX(0); }

  /* Stack inner content grid to single column */
  .main-content.has-widget {
    grid-template-columns: 1fr;
  }
  .cart-widget, .specials-widget { position: static; }
}

/* ─── Cart Widget Sidebar ───────────────────────────────── */
.cart-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 1.5rem;
}

.cart-widget-header {
  background: var(--green-dark);
  color: var(--white);
  padding: .6rem .9rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.cart-widget-body { padding: .75rem .9rem; }

.cart-widget-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--cream-dark);
  color: var(--text-mid);
}

.cart-widget-row:last-child { border-bottom: none; }
.cart-widget-row .val { font-weight: 600; color: var(--text-dark); }

.cart-choices {
  font-size: .82rem;
  padding: .3rem .5rem;
  border-radius: 4px;
  margin-bottom: .5rem;
  text-align: center;
}
.cart-choices.complete { background: var(--green-pale); color: var(--green-dark); }
.cart-choices.remaining { background: var(--cream-dark); color: var(--text-mid); }

.cart-widget-actions {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
}

.cart-widget-actions a {
  flex: 1;
  text-align: center;
  padding: .4rem .3rem;
  font-size: .8rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}

.btn-cart-view {
  background: var(--green-pale);
  color: var(--green-dark);
  border: 1px solid var(--green-light);
}
.btn-cart-view:hover { background: var(--green-light); color: var(--white); text-decoration: none; }

.btn-cart-checkout {
  background: var(--green-dark);
  color: var(--white);
  border: 1px solid var(--green-dark);
}
.btn-cart-checkout:hover { background: var(--green-mid); text-decoration: none; }

/* ─── On-Special Sidebar ────────────────────────────────── */
.specials-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.specials-widget-header {
  background: var(--brown);
  color: var(--white);
  padding: .6rem .9rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.special-item {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--cream-dark);
  font-size: .875rem;
}
.special-item:last-child { border-bottom: none; }

.special-item-name { font-weight: 600; color: var(--text-dark); }
.special-item-desc { font-size: .8rem; color: var(--text-light); margin-bottom: .3rem; }
.special-item-price { font-size: .82rem; color: var(--brown); font-weight: 600; }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green-dark);
  color: var(--white);
  border-color: var(--green-dark);
}
.btn-primary:hover { background: var(--green-mid); border-color: var(--green-mid); color: var(--white); }

.btn-secondary {
  background: var(--white);
  color: var(--green-dark);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--green-pale); color: var(--green-dark); }

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: #e8c0bb;
}
.btn-danger:hover { background: #fdf0ef; }

.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }

.btn-add {
  background: var(--green-pale);
  color: var(--green-dark);
  border-color: var(--green-light);
  padding: .3rem .7rem;
  font-size: .8rem;
}
.btn-add:hover { background: var(--green-light); color: var(--white); }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: .35rem;
}

.form-control {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: .9rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.4;
}
.form-control:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(74,124,89,.15);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--green-mid); }

.form-error { font-size: .82rem; color: var(--red); margin-top: .25rem; }
.form-hint  { font-size: .82rem; color: var(--text-light); margin-top: .25rem; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  background: var(--green-pale);
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-body { padding: 1.25rem; }
.card-footer {
  background: var(--cream-dark);
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Product Cards ─────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-card-name {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-dark);
}

.product-card-desc { font-size: .82rem; color: var(--text-light); flex: 1; }
.product-card-price { font-size: .9rem; color: var(--brown); font-weight: 600; }

.product-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-csa     { background: var(--green-pale); color: var(--green-dark); }
.badge-special { background: #fef3e2; color: var(--brown); }
.badge-retail  { background: var(--cream-dark); color: var(--text-mid); }

/* ─── Tables ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table th {
  background: var(--green-pale);
  color: var(--green-dark);
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .6rem .9rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--cream-dark);
  color: var(--text-mid);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--cream); }

.data-table td a { color: var(--green-mid); font-weight: 600; }

/* ─── Alerts / Flash Messages ───────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border-left: 4px solid;
}
.alert-success { background: #edf7f0; border-color: var(--green-mid); color: var(--green-dark); }
.alert-danger   { background: #fdf0ef; border-color: var(--red); color: #7a1e1e; }
.alert-warning  { background: #fef9ec; border-color: #d4a017; color: #6b4c10; }
.alert-info     { background: var(--green-pale); border-color: var(--green-light); color: var(--green-dark); }

/* ─── Status Badges ─────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-1 { background: #fef9ec; color: #7a5c0a; }  /* new */
.status-2 { background: var(--green-pale); color: var(--green-dark); } /* accepted */
.status-3 { background: #e8f4fd; color: #1a5276; }  /* packed */
.status-4 { background: var(--cream-dark); color: var(--text-light); }  /* delivered */
.status-5 { background: #f5f5f5; color: #aaa; }     /* hidden */

/* ─── Page Titles ────────────────────────────────────────── */
.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
}

.page-title-bar h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.5rem;
}

/* ─── Login Page ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.login-card-header {
  background: var(--green-dark);
  padding: 1.75rem 2rem;
  text-align: center;
  color: var(--white);
}

.login-card-header .login-logo {
  font-family: 'Lora', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.login-card-header .login-subtitle {
  font-size: .85rem;
  opacity: .75;
}

.login-card-body { padding: 1.75rem 2rem; }

/* ─── Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.6);
  font-size: .8rem;
  padding: 1rem 1.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.footer-inner a { color: rgba(255,255,255,.5); }
.footer-inner a:hover { color: rgba(255,255,255,.85); }

/* ─── Utilities ─────────────────────────────────────────── */
.text-muted   { color: var(--text-light); }
.text-success { color: var(--green-mid); }
.text-danger  { color: var(--red); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ─── Admin Area ────────────────────────────────────────── */
.admin-nav-bar {
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
  padding: .4rem 1.5rem;
  overflow: hidden;        /* Hard-clips any child that grows the bar */
  line-height: 1;          /* Base line-height for the bar */
}
.admin-nav-bar .admin-links {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: .25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.admin-nav-bar .admin-links::-webkit-scrollbar {
  display: none;
}
.admin-nav-bar a {
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: var(--radius);
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: .3rem;
  line-height: 1;          /* Explicit — never inherits body line-height */
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.admin-nav-bar a:hover,
.admin-nav-bar a.active {
  background: var(--green-pale);
  color: var(--green-dark);
  text-decoration: none;
}

/* ─── Print Styles ──────────────────────────────────────── */
@media print {
  .site-header, .site-nav, .sidebar-nav, .cart-widget, .specials-widget,
  .site-footer, .admin-nav-bar, .btn, .page-break { display: none; }
  .main-content { display: block; }
  .page-break-before { page-break-before: always; }
  body { font-size: 12pt; color: #000; }
}

/* ─── Cart item description expand/collapse ─────────────── */
.item-desc {
  font-size: .8rem;
  color: var(--text-light);
  margin-top: .15rem;
}
.item-desc-text {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: none;
}
.item-desc-text.expanded {
  display: block;       /* override -webkit-box so all lines show */
  overflow: visible;
}
.item-desc-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: .75rem;
  color: var(--green-mid);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}
.item-desc-toggle:hover { color: var(--green-dark); text-decoration: underline; }

/* ─── Checkout Layout ───────────────────────────────────── */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 300px);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

/* Summary panel: sticky on desktop so it stays in view while filling the form */
.checkout-summary-card {
  position: sticky;
  top: 1.5rem;
  min-width: 0;  /* prevents grid blowout */
}

/* Stack to single column on any viewport where a side-by-side layout
   would leave the form too narrow to be usable (phones + small tablets) */
@media (max-width: 860px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  .checkout-summary-card {
    position: static;
  }
}
@media (max-width: 600px) {
  .header-inner { height: 58px; }
  .site-logo .logo-tagline { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .4rem .6rem; }
}
