/* ============================================================
   shop.css — Pelanos Agiron shop page
   ============================================================ */

/* ── Shop hero / search bar ── */
.shop-hero {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
}
.shop-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.shop-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--olive-dark);
  line-height: 1.1;
}
.shop-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 6px;
}
.shop-search-form {
  flex: 1;
  max-width: 520px;
  min-width: 260px;
}
.shop-search-wrap {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  position: relative;
}
.shop-search-wrap:focus-within {
  border-color: var(--olive);
}
.search-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.shop-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--text);
  padding: 12px 12px 12px 40px;
  background: transparent;
}
.shop-search-btn {
  border-radius: 0;
  padding: 12px 20px;
  flex-shrink: 0;
  font-size: 14px;
}

/* ── Layout ── */
.shop-body {
  background: var(--white);
  padding: 36px 0 80px;
}
.shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Sidebar ── */
.shop-sidebar {
  position: sticky;
  top: 84px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.filter-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.filter-group:first-child { padding-top: 0; }
.filter-group:last-of-type { border-bottom: none; }

.filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.filter-option:hover { background: var(--olive-mist); }
.filter-option.active {
  background: var(--olive-mist);
  color: var(--olive-dark);
  font-weight: 600;
}
.filter-option input { display: none; }

.filter-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--sans);
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--olive); }

/* Acidity chips */
.acidity-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
}
.filter-chip:hover {
  border-color: var(--olive);
  color: var(--olive);
}
.filter-chip.active {
  border-color: var(--olive);
  background: var(--olive-mist);
  color: var(--olive-dark);
  font-weight: 600;
}
.filter-chip input { display: none; }

/* Toggle */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.filter-toggle input { display: none; }
.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 100px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
}
.filter-toggle input:checked + .toggle-track {
  background: var(--olive);
}
.filter-toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
}
.toggle-label {
  font-size: 14px;
  color: var(--text);
}

.clear-filters-btn {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}
.clear-filters-btn:hover { color: var(--olive); }

/* ── Toolbar ── */
.shop-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.shop-count {
  font-size: 14px;
  color: var(--text-muted);
  flex: 1;
  min-width: 120px;
}
.shop-count strong { color: var(--text); }
.shop-count em { font-style: normal; color: var(--olive); }

/* Active filter chips in toolbar */
.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--olive-mist);
  color: var(--olive-dark);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.chip-tag:hover { background: #d5e5d0; }

.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--sans);
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.sort-select:focus { border-color: var(--olive); }

/* ── Product Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.product-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* Photo */
.product-photo {
  position: relative;
  background: var(--olive-mist);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-photo-honey { background: var(--sand-light); }
.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-emoji {
  font-size: 64px;
  line-height: 1;
  user-select: none;
}

/* Badges */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--olive);
  color: var(--white);
}
.badge-featured {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--sand);
  color: var(--white);
}

/* Body */
.product-body {
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-origin {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.product-origin svg { flex-shrink: 0; }

.product-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.product-spec {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}

/* Lot chip */
.product-lot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--olive);
  background: var(--olive-mist);
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}

/* Footer row */
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}
.product-price-wrap { display: flex; align-items: baseline; gap: 2px; }
.product-price {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--olive-dark);
}
.product-unit {
  font-size: 12px;
  color: var(--text-muted);
}
.product-trace-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--olive);
}
.product-card:hover .product-trace-link { text-decoration: underline; }

/* Producer row */
.product-producer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.producer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.producer-dot.verified { background: var(--olive); }
.verified-icon { color: var(--olive); flex-shrink: 0; }

/* CTA */
.product-card-cta {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.btn-full { width: 100%; justify-content: center; }
.out-of-stock {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

/* ── Empty state ── */
.shop-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.shop-empty-icon { font-size: 48px; margin-bottom: 16px; }
.shop-empty h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}
.shop-empty p { font-size: 15px; }
.shop-empty a { color: var(--olive); font-weight: 600; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
  background: var(--white);
}
.page-btn:hover {
  border-color: var(--olive);
  color: var(--olive);
}
.page-btn.active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--white);
  font-weight: 700;
}

/* ── Login modal (mirrored from index.html) ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.login-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  font-size: 26px; cursor: pointer;
  color: var(--text-muted); line-height: 1;
}
.modal-close:hover { color: var(--text); }
.login-modal h2 {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--olive-dark);
  margin-bottom: 6px;
}
.login-modal > p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 7px;
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--sans);
  color: var(--text);
  transition: border-color 0.2s;
  background: var(--white);
  outline: none;
}
.form-group input:focus { border-color: var(--olive); }
.form-error { color: #c0392b; font-size: 13px; margin-top: 10px; display: none; }
.form-error.show { display: block; }
.btn-submit {
  width: 100%;
  padding: 13px;
  background: var(--olive);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-submit:hover { background: var(--olive-dark); }
.signup-prompt {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}
.signup-prompt a { color: var(--olive); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .shop-layout { grid-template-columns: 200px 1fr; gap: 28px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .shop-hero-inner { flex-direction: column; align-items: flex-start; }
  .shop-search-form { max-width: 100%; width: 100%; }

  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar {
    position: static;
    display: none; /* hidden by default on mobile, toggled via JS */
  }
  .shop-sidebar.open { display: flex; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .shop-toolbar { flex-direction: column; align-items: flex-start; }
}

/* ── Mobile filter toggle button (injected via JS) ── */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 16px;
}
@media (max-width: 768px) {
  .mobile-filter-btn { display: flex; }
}

/* Nav active state */
.site-nav a.nav-active {
  color: var(--olive);
  font-weight: 600;
}
