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

:root {
  --cd-primary: #111827;
  --cd-accent: #c6a437; /* approximate gold from logo */
  --cd-bg-page: #f5f5f7;
  --cd-bg-card: #ffffff;
  --cd-border: #e5e7eb;
  --cd-text: #1f2933;
  --cd-muted: #6b7280;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cd-bg-page);
  color: var(--cd-text);
}

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #000000;
  border-bottom: 1px solid var(--cd-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Make header black + readable text */
.site-header {
  background: #000000 !important;
}

.site-header h1,
.site-header .subtitle,
.site-header,
.logo-title h1 {
  color: #ffffff;
}

/* Subtitle slightly softer for readability */
.subtitle {
  color: #e5e5e5 !important;
}


.logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cd-logo {
  height: 40px;
  width: auto;
}

.logo-title h1 {
  margin: 0;
  font-size: 1.25rem;
}

.subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--cd-muted);
}

.basket-button {
  border: none;
  background: var(--cd-primary);
  color: #ffffff;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.basket-button {
  background: #c6a437 !important;
  color: #000000 !important;
}


#basketCount {
  background: #ffffff;
  color: var(--cd-primary);
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  min-width: 1.5rem;
  text-align: center;
}

/* Layout */

.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 260px;
  padding: 1rem;
  background: #ffffff;
  border-right: 1px solid var(--cd-border);
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.filter-group label {
  display: block;
  font-size: 0.9rem;
  margin: 0.15rem 0;
}

.filter-group input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid #d1d5db;
  font-size: 16px;
}

.reset-button {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Content / grid */

.content {
  flex: 1;
  padding: 1rem;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.products-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.mobile-filter-toggle {
  display: none;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--cd-bg-card);
  border-radius: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--cd-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-wrapper img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.product-card:hover .product-image-wrapper img {
  transform: scale(1.05);
}

.product-meta {
  font-size: 0.85rem;
}

.product-brewery {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--cd-muted);
}

.product-name {
  font-weight: 600;
  margin-top: 0.1rem;
}

/* Pickers */

.picker-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.pill-button {
  flex: 1;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
}

.pill-button.active {
  background: var(--cd-accent);
  color: #111827;
  border-color: var(--cd-accent);
}

/* Qty & Add */

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  overflow: hidden;
}

.qty-control button {
  border: none;
  background: #f9fafb;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.qty-display {
  min-width: 2rem;
  text-align: center;
  font-size: 0.85rem;
}

.add-button {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
  border: none;
  background: var(--cd-primary);
  color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Basket panel */

.basket-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  z-index: 30;
}

.basket-panel.open {
  display: flex;
}

.basket-inner {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  height: 100%;
  box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}

.basket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--cd-border);
}

.close-button {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.basket-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}

.basket-item {
  border-bottom: 1px solid var(--cd-border);
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

.basket-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.basket-item-meta {
  color: var(--cd-muted);
  font-size: 0.8rem;
}

.basket-item-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.secondary-button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.6rem;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.8rem;
}

.basket-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--cd-border);
}

.primary-button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.6rem;
  background: var(--cd-primary);
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Checkout modal */

.checkout-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 40;
}

.checkout-modal.open {
  display: flex;
}

.checkout-inner {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cd-border);
}

.checkout-form {
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  resize: vertical;
}

.small-print {
  font-size: 0.7rem;
  color: var(--cd-muted);
  margin-bottom: 0.75rem;
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 1rem 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--cd-muted);
}

.site-footer a {
  color: inherit;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: var(--cd-primary);
  color: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
}

/* Responsive */

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0px;
    left: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 10;
    padding-top: 90px; /* adjust to match your header */
  }

  .sidebar.open {
    transform: translateX(0);
    z-index: 10; /* <-- you MUST repeat this */
  }

  .content {
    padding: 0.75rem;
  }

  .mobile-filter-toggle {
    display: inline-flex;
  }
}
#scrollToTopBtn {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #111827; /* Cave Direct dark navy */
  color: white;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60; /* Above sidebar but below toast */
}

#scrollToTopBtn.show {
  opacity: 0.9;
  pointer-events: auto;
  transform: translateY(0);
}

#scrollToTopBtn:active {
  transform: scale(0.9);
}

