/* ============================================================
   CassavaMarket Public Shop Theme
   Mobile-first, clean green palette
   ============================================================ */

:root {
  --sh-green:        #2a9d8f;
  --sh-green-dark:   #1f7a6e;
  --sh-green-light:  #e0f5f3;
  --sh-yellow:       #e9c46a;
  --sh-orange:       #f4a261;
  --sh-dark:         #1a3c40;
  --sh-text:         #1e293b;
  --sh-muted:        #64748b;
  --sh-border:       #e2e8f0;
  --sh-bg:           #f8fafc;
  --sh-white:        #ffffff;
  --sh-header-h:     64px;
  --sh-bottom-nav-h: 60px;
  --sh-radius:       12px;
  --sh-radius-sm:    8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--sh-bg);
  color: var(--sh-text);
  margin: 0;
  padding-bottom: var(--sh-bottom-nav-h);
}

/* ── Header ──────────────────────────────────────── */
.sh-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--sh-dark);
  height: var(--sh-header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.sh-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
}

.sh-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.sh-logo i { color: var(--sh-green); font-size: 1.4rem; }

.sh-nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}

.sh-nav-link {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: .4rem .75rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.sh-nav-link:hover,
.sh-nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.sh-header-actions { display: flex; gap: .5rem; align-items: center; }

.sh-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--sh-green);
  color: #fff;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  padding: .45rem 1rem;
  border-radius: 8px;
  transition: background .15s;
}

.sh-cart-btn:hover { background: var(--sh-green-dark); color: #fff; }

.sh-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--sh-orange);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
}

/* Hide desktop cart label on small */
@media (max-width: 640px) {
  .sh-cart-label { display: none; }
  .sh-nav { display: none; }
}

/* ── Main ────────────────────────────────────────── */
.sh-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  min-height: calc(100vh - var(--sh-header-h) - var(--sh-bottom-nav-h) - 180px);
}

/* ── Hero ────────────────────────────────────────── */
.sh-hero {
  background: linear-gradient(135deg, var(--sh-dark) 0%, #1f5c5a 100%);
  border-radius: var(--sh-radius);
  color: #fff;
  padding: 2.5rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.sh-hero h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; margin-bottom: .5rem; }
.sh-hero p  { opacity: .85; font-size: 1rem; margin-bottom: 1.5rem; }

.sh-hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.sh-hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: .75rem 1.25rem;
  font-size: 1rem;
  color: var(--sh-text);
}

.sh-hero-search button {
  background: var(--sh-green);
  border: none;
  color: #fff;
  padding: .75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.sh-hero-search button:hover { background: var(--sh-green-dark); }

/* ── Filter bar ─────────────────────────────────── */
.sh-filter-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.sh-filter-select {
  border: 1.5px solid var(--sh-border);
  border-radius: 8px;
  padding: .45rem .9rem;
  font-size: .875rem;
  background: var(--sh-white);
  color: var(--sh-text);
  cursor: pointer;
  transition: border-color .15s;
}

.sh-filter-select:focus { border-color: var(--sh-green); outline: none; }

.sh-filter-clear {
  background: none;
  border: 1.5px solid var(--sh-border);
  border-radius: 8px;
  padding: .45rem .9rem;
  font-size: .875rem;
  color: var(--sh-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.sh-filter-clear:hover { border-color: #e74c3c; color: #e74c3c; }

/* ── Product grid ───────────────────────────────── */
.sh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.sh-card {
  background: var(--sh-white);
  border-radius: var(--sh-radius);
  border: 1.5px solid var(--sh-border);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}

.sh-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.sh-card-img {
  background: linear-gradient(135deg, var(--sh-green-light), #c7f0ea);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.sh-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sh-card-variety {
  font-size: .8rem;
  font-weight: 600;
  color: var(--sh-green);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}

.sh-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sh-text);
  margin-bottom: .5rem;
  line-height: 1.3;
}

.sh-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .75rem;
}

.sh-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.sh-badge-green   { background: var(--sh-green-light); color: var(--sh-green-dark); }
.sh-badge-yellow  { background: #fef9e7; color: #a0740e; }
.sh-badge-blue    { background: #e0eaff; color: #2563eb; }
.sh-badge-orange  { background: #fff3e0; color: #c05c00; }
.sh-badge-gray    { background: #f1f5f9; color: var(--sh-muted); }

.sh-card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: .5rem;
}

.sh-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--sh-green-dark);
}

.sh-card-price small {
  font-size: .7rem;
  font-weight: 500;
  color: var(--sh-muted);
}

.sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}

.sh-btn:active { transform: scale(.97); }

.sh-btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.sh-btn-md { padding: .55rem 1.1rem; font-size: .9rem; }
.sh-btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.sh-btn-block { width: 100%; }

.sh-btn-primary  { background: var(--sh-green); color: #fff; }
.sh-btn-primary:hover { background: var(--sh-green-dark); color: #fff; }

.sh-btn-outline {
  background: transparent;
  border: 1.5px solid var(--sh-green);
  color: var(--sh-green);
}
.sh-btn-outline:hover { background: var(--sh-green-light); }

.sh-btn-danger { background: #e74c3c; color: #fff; }
.sh-btn-danger:hover { background: #c0392b; color: #fff; }

.sh-btn-secondary { background: #f1f5f9; color: var(--sh-text); }
.sh-btn-secondary:hover { background: #e2e8f0; }

/* ── Empty state ────────────────────────────────── */
.sh-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--sh-muted);
}

.sh-empty i { font-size: 3.5rem; opacity: .35; margin-bottom: 1rem; display: block; }
.sh-empty h3 { font-size: 1.25rem; font-weight: 700; color: var(--sh-text); margin-bottom: .5rem; }
.sh-empty p  { font-size: .95rem; max-width: 360px; margin: 0 auto 1.5rem; }

/* ── Product detail page ────────────────────────── */
.sh-detail-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .sh-detail-wrap { grid-template-columns: 1fr 1fr; }
}

.sh-detail-img {
  background: linear-gradient(135deg, var(--sh-green-light), #b8e8e3);
  border-radius: var(--sh-radius);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

.sh-detail-body { display: flex; flex-direction: column; gap: .75rem; }

.sh-detail-title { font-size: 1.5rem; font-weight: 800; }

.sh-detail-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--sh-green-dark);
}

.sh-detail-price small { font-size: .875rem; color: var(--sh-muted); font-weight: 500; }

.sh-detail-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sh-detail-table tr:not(:last-child) td { border-bottom: 1px solid var(--sh-border); }
.sh-detail-table td { padding: .5rem 0; }
.sh-detail-table td:first-child { color: var(--sh-muted); font-weight: 500; width: 40%; }
.sh-detail-table td:last-child { font-weight: 600; }

.sh-qty-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.sh-qty-input {
  width: 80px;
  border: 1.5px solid var(--sh-border);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.sh-qty-input:focus { border-color: var(--sh-green); outline: none; }

/* ── Cart ───────────────────────────────────────── */
.sh-cart-table { width: 100%; border-collapse: collapse; }

.sh-cart-table th {
  font-size: .78rem;
  font-weight: 600;
  color: var(--sh-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .6rem .75rem;
  border-bottom: 2px solid var(--sh-border);
  text-align: left;
}

.sh-cart-table td {
  padding: .9rem .75rem;
  border-bottom: 1px solid var(--sh-border);
  vertical-align: middle;
}

.sh-cart-table tr:last-child td { border-bottom: none; }

.sh-cart-item-name { font-weight: 700; font-size: .95rem; }
.sh-cart-item-sub  { font-size: .78rem; color: var(--sh-muted); margin-top: .2rem; }

.sh-cart-qty-input {
  width: 64px;
  border: 1.5px solid var(--sh-border);
  border-radius: 6px;
  padding: .35rem .5rem;
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
}

.sh-cart-qty-input:focus { border-color: var(--sh-green); outline: none; }

.sh-order-summary {
  background: var(--sh-white);
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius);
  padding: 1.25rem;
}

.sh-order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: .4rem 0;
  font-size: .95rem;
}

.sh-order-summary-row.total {
  font-size: 1.15rem;
  font-weight: 800;
  border-top: 2px solid var(--sh-border);
  margin-top: .5rem;
  padding-top: .75rem;
}

/* ── Checkout form ──────────────────────────────── */
.sh-form-section {
  background: var(--sh-white);
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.sh-form-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--sh-dark);
}

.sh-form-section-title i { color: var(--sh-green); }

.sh-form-group { margin-bottom: 1rem; }

.sh-form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--sh-muted);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sh-form-control {
  width: 100%;
  border: 1.5px solid var(--sh-border);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .95rem;
  color: var(--sh-text);
  transition: border-color .15s;
  background: #fff;
}

.sh-form-control:focus { border-color: var(--sh-green); outline: none; box-shadow: 0 0 0 3px rgba(42,157,143,.15); }

.sh-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

@media (max-width: 520px) { .sh-form-grid { grid-template-columns: 1fr; } }

.sh-payment-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
}

.sh-payment-option {
  position: relative;
  cursor: pointer;
}

.sh-payment-option input { position: absolute; opacity: 0; pointer-events: none; }

.sh-payment-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .85rem .5rem;
  border: 2px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  font-size: .82rem;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  text-align: center;
}

.sh-payment-label i { font-size: 1.5rem; color: var(--sh-muted); transition: color .15s; }

.sh-payment-option input:checked + .sh-payment-label {
  border-color: var(--sh-green);
  background: var(--sh-green-light);
}

.sh-payment-option input:checked + .sh-payment-label i { color: var(--sh-green); }

/* ── Alerts ─────────────────────────────────────── */
.sh-alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-radius: var(--sh-radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  line-height: 1.5;
}

.sh-alert-close { margin-left: auto; background: none; border: none; cursor: pointer; opacity: .6; font-size: 1rem; padding: 0; }
.sh-alert-close:hover { opacity: 1; }

.sh-alert-success { background: #d4edda; color: #155724; }
.sh-alert-danger  { background: #f8d7da; color: #721c24; }
.sh-alert-info    { background: #d1ecf1; color: #0c5460; }
.sh-alert-warning { background: #fff3cd; color: #856404; }

.sh-errors {
  background: #f8d7da;
  border: 1.5px solid #f5c6cb;
  border-radius: var(--sh-radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.sh-errors ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.sh-errors li { font-size: .88rem; margin-bottom: .25rem; }

/* ── Confirmation ────────────────────────────────── */
.sh-confirm-hero {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: var(--sh-white);
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius);
  margin-bottom: 1.5rem;
}

.sh-confirm-icon {
  width: 72px;
  height: 72px;
  background: var(--sh-green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--sh-green);
  margin: 0 auto 1rem;
}

.sh-confirm-ref {
  display: inline-block;
  background: var(--sh-dark);
  color: var(--sh-yellow);
  font-family: monospace;
  font-size: 1.3rem;
  letter-spacing: .08em;
  padding: .4rem 1rem;
  border-radius: 6px;
  margin: .5rem 0;
}

/* ── Track page ─────────────────────────────────── */
.sh-track-form {
  max-width: 480px;
  margin: 2rem auto;
  background: var(--sh-white);
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius);
  padding: 2rem;
  text-align: center;
}

.sh-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sh-status-PLACED      { background: #e0eaff; color: #2563eb; }
.sh-status-CONFIRMED   { background: var(--sh-green-light); color: var(--sh-green-dark); }
.sh-status-DISPATCHED  { background: #fff3e0; color: #c05c00; }
.sh-status-DELIVERED   { background: #d4edda; color: #155724; }
.sh-status-CANCELLED   { background: #f1f5f9; color: var(--sh-muted); }
.sh-status-DISPUTED    { background: #f8d7da; color: #721c24; }

/* ── Section heading ────────────────────────────── */
.sh-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.sh-section-heading h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }

/* ── Pagination ─────────────────────────────────── */
.sh-pagination {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ── Footer ─────────────────────────────────────── */
.sh-footer {
  background: var(--sh-dark);
  color: rgba(255,255,255,.8);
  padding: 2.5rem 1rem 1rem;
  margin-top: 2rem;
}

.sh-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .sh-footer-inner { grid-template-columns: 1fr 1fr; }
}

.sh-footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.sh-footer-logo i { color: var(--sh-green); }
.sh-footer-tagline { font-size: .85rem; margin-top: .4rem; opacity: .7; }

.sh-footer-links { display: flex; gap: 2rem; flex-wrap: wrap; }

.sh-footer-col h6 { color: #fff; font-size: .85rem; margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .06em; }

.sh-footer-col ul { list-style: none; padding: 0; margin: 0; }

.sh-footer-col li { margin-bottom: .3rem; }

.sh-footer-col a { color: rgba(255,255,255,.65); text-decoration: none; font-size: .85rem; transition: color .15s; }
.sh-footer-col a:hover { color: #fff; }

.sh-footer-bottom {
  max-width: 1280px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .8rem;
  opacity: .6;
  text-align: center;
}

/* ── Mobile bottom nav ──────────────────────────── */
.sh-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: var(--sh-dark);
  display: flex;
  border-top: 1px solid rgba(255,255,255,.1);
  height: var(--sh-bottom-nav-h);
}

@media (min-width: 769px) {
  .sh-bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

.sh-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .65rem;
  font-weight: 500;
  transition: color .15s;
}

.sh-bottom-nav-item:hover,
.sh-bottom-nav-item.active { color: var(--sh-green); }

.sh-bottom-nav-item i { font-size: 1.2rem; }

.sh-bottom-nav-icon-wrap { position: relative; display: inline-flex; }

.sh-bottom-nav-icon-wrap .sh-cart-count {
  top: -6px;
  right: -8px;
}

/* ── Toast ──────────────────────────────────────── */
.sh-toast-container {
  position: fixed;
  bottom: calc(var(--sh-bottom-nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  pointer-events: none;
}

@media (min-width: 769px) {
  .sh-toast-container { bottom: 20px; }
}

.sh-toast {
  background: var(--sh-dark);
  color: #fff;
  padding: .65rem 1.25rem;
  border-radius: 50px;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  max-width: 320px;
  text-align: center;
}

.sh-toast.show { opacity: 1; }

/* ── Utilities ──────────────────────────────────── */
.sh-divider { border: none; border-top: 1px solid var(--sh-border); margin: 1.25rem 0; }
.sh-text-muted { color: var(--sh-muted); }
.sh-text-green { color: var(--sh-green); }
.sh-fw-bold { font-weight: 700; }

.sh-page-header {
  margin-bottom: 1.25rem;
}

.sh-page-header h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: .25rem; }
.sh-page-header p  { color: var(--sh-muted); font-size: .9rem; margin: 0; }

.sh-breadcrumb {
  display: flex;
  gap: .4rem;
  align-items: center;
  font-size: .82rem;
  color: var(--sh-muted);
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.sh-breadcrumb a { color: var(--sh-green); text-decoration: none; }
.sh-breadcrumb a:hover { text-decoration: underline; }
