/* ==========================================================================
   KUSP Coffee — Main Stylesheet
   ========================================================================== */

:root {
  --bg:           #faf8f5;
  --bg-warm:      #f5f0ea;
  --fg:           #1a1410;
  --fg-muted:     #6b5d52;
  --accent:       #6b4226;
  --accent-light: #a0714f;
  --accent-dark:  #3b2314;
  --gold:         #c9a87c;
  --cream:        #f5e6d3;
  --border:       #e0d6cc;
  --card-bg:      #ffffff;
  --overlay:      rgba(10, 6, 4, 0.7);
  --nav-h:        64px;
  --max-w:        1120px;
  --radius:       8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transition: background 0.3s, box-shadow 0.3s;
}

.site-nav {
  color: var(--cream);
}

.site-nav.scrolled {
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  color: var(--fg);
}

/* On homepage (dark bg), nav text is light */
.nav-home .site-nav { color: var(--cream); }
.nav-home .site-nav.scrolled { color: var(--fg); }

.nav-logo img {
  height: 72px;
  width: auto;
  transition: filter 0.3s;
}

.site-nav.scrolled .nav-logo img {
  filter: invert(1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: inherit;
  transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 0.7; }

.cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  vertical-align: middle;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 200;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--cream);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.mobile-menu a:hover { color: var(--gold); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ==========================================================================
   Page layouts
   ========================================================================== */

.page-content {
  padding-top: calc(var(--nav-h) + 2rem);
  min-height: 100vh;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--accent-dark);
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--fg-muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto 3rem;
}

/* ==========================================================================
   Hero (for inner pages)
   ========================================================================== */

.page-hero {
  background: var(--accent-dark);
  color: var(--cream);
  text-align: center;
  padding: calc(var(--nav-h) + 3rem) 1.5rem 3rem;
}

.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--gold);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ==========================================================================
   Product cards (shop grid)
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s, box-shadow 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.product-card-img {
  aspect-ratio: 4 / 3;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-card-img .roast-icon {
  font-size: 4rem;
}

.product-card-body {
  padding: 1.5rem;
}

.product-card-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--accent-dark);
  margin-bottom: 0.25rem;
}

.roast-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.roast-label.light  { background: #f5e6d3; color: #8b6914; }
.roast-label.medium { background: #e8d5be; color: #6b4226; }
.roast-label.dark   { background: #3b2314; color: #f5e6d3; }

.product-card-body p {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.product-card-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover { background: var(--accent); color: #fff; }

.btn-gold {
  background: var(--gold);
  color: var(--accent-dark);
}

.btn-gold:hover { background: #b8975e; color: #fff; }

/* ==========================================================================
   Product detail page
   ========================================================================== */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3rem 0;
}

.product-detail-img {
  aspect-ratio: 1;
  background: var(--bg-warm);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.product-detail-info h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--accent-dark);
  margin-bottom: 0.25rem;
}

.product-detail-info .tagline {
  color: var(--fg-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.product-detail-info .description {
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Option selector */
.option-group {
  margin-bottom: 2rem;
}

.option-group h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.option-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.option-card:hover { border-color: var(--accent-light); }
.option-card.selected { border-color: var(--accent); background: #fdf8f3; }

.option-card.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

.option-card-left {
  display: flex;
  flex-direction: column;
}

.option-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.option-card-desc {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.option-card-price {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.option-card-per {
  font-size: 0.72rem;
  color: var(--fg-muted);
  text-align: right;
}

.badge-soon {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--accent-dark);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.add-to-cart-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.qty-selector button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-warm);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--fg);
  transition: background 0.2s;
}

.qty-selector button:hover { background: var(--border); }

.qty-selector input {
  width: 44px;
  height: 36px;
  text-align: center;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  color: var(--fg);
}

.qty-selector input:focus { outline: none; }

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
  }
  .product-detail-img {
    position: static;
    aspect-ratio: 4 / 3;
    font-size: 4rem;
  }
}

/* ==========================================================================
   About page
   ========================================================================== */

.about-section {
  padding: 3rem 0;
}

.about-section + .about-section {
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-grid.reverse { direction: rtl; }
.about-grid.reverse > * { direction: ltr; }

.about-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--accent-dark);
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--fg);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-text p:last-child { margin-bottom: 0; }

.about-visual {
  background: var(--bg-warm);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--accent);
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .about-grid.reverse { direction: ltr; }
}

/* ==========================================================================
   Density comparison (about page)
   ========================================================================== */

.density-compare {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.density-bar-group {
  text-align: center;
}

.density-bar-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  color: var(--fg-muted);
}

.density-bar {
  width: 60px;
  border-radius: 4px;
  background: var(--accent);
  margin: 0 auto;
}

.density-bar-value {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--accent-dark);
  color: var(--cream);
  padding: 3rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--gold);
}

.footer-col p, .footer-col a {
  font-size: 0.85rem;
  color: rgba(245, 230, 211, 0.7);
  line-height: 1.8;
}

.footer-col a:hover { color: var(--cream); }

.footer-col ul {
  list-style: none;
}

.footer-col ul li { margin-bottom: 0.35rem; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 230, 211, 0.15);
  text-align: center;
  font-size: 0.75rem;
  color: rgba(245, 230, 211, 0.4);
}

/* ==========================================================================
   Cart drawer
   ========================================================================== */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg);
  z-index: 310;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

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

.cart-drawer-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--accent-dark);
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--fg-muted);
  padding: 4px;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-empty {
  text-align: center;
  color: var(--fg-muted);
  padding: 3rem 0;
}

.cart-empty p {
  margin-bottom: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-info { flex: 1; }

.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.cart-item-variant {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.cart-item-price {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.cart-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.cart-total span:last-child {
  font-family: 'Playfair Display', serif;
  color: var(--accent);
}

.cart-checkout-btn {
  width: 100%;
  padding: 0.9rem;
  text-align: center;
}

.shopify-notice {
  text-align: center;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
