:root {
  --bg-color: #f6f6f5;
  --text-color: #111111;
  --muted-text: #666666;
  --accent: #f3b064;
  --border-color: #dddddd;
  --card-bg: #ffffff;
  --max-width: 1120px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #f6f6f5;
  --muted-text: #999999;
  --accent: #f3b064;
  --border-color: #333333;
  --card-bg: #2a2a2a;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
}

/* Layout */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 16px 32px;
}

.page-home {
  padding-top: 96px;
}

.section {
  margin-bottom: 64px;
}

.section-header {
  margin-bottom: 24px;
}

.section-header h1,
.section-header h2 {
  margin: 0 0 8px;
}

.section-header p {
  margin: 0;
  color: var(--muted-text);
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
  z-index: 50;
}

[data-theme="dark"] .site-header {
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.logo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.logo a {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text-color);
}

/* Dark mode toggle */

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(243, 176, 100, 0.1);
}

.theme-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Nav */

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted-text);
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.site-nav a:hover {
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-color);
}

.site-nav a.active {
  border-color: var(--accent);
  color: var(--text-color);
  background: rgba(243, 176, 100, 0.12);
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.coffee-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 500;
}

.cart-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--text-color);
  color: white;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile nav */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 60;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Hero */

.hero {
  margin-top: 8px;
  margin-bottom: 40px;
}

.hero-text {
  width: 100%;
  text-align: center;
  padding: 60px 20px;
}

.hero-title {
  font-family: 'Rubik Glitch', cursive;
  font-size: clamp(56px, 9vw, 140px);
  font-weight: 400;
  letter-spacing: 0.03em;
  margin: 0;
  color: #000000;
  text-transform: uppercase;
  text-shadow: none;
  transform: rotate(-1.5deg);
  line-height: 1;
  display: inline-block;
  padding: 0 20px;
  -webkit-text-stroke: 3px #000000;
  -webkit-text-fill-color: #ffffff;
  text-stroke: 3px #000000;
  text-fill-color: #ffffff;
}

[data-theme="dark"] .hero-title {
  -webkit-text-stroke: 3px #ffffff;
  -webkit-text-fill-color: #000000;
  text-stroke: 3px #ffffff;
  text-fill-color: #000000;
}

.hero-image {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ecebe8;
  border: 1px solid var(--border-color);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Product grid */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

.product-image-wrapper {
  position: relative;
  padding-bottom: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ecebe8;
  margin-bottom: 10px;
}

.product-image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(246, 246, 245, 0.96);
  color: var(--text-color);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

[data-theme="dark"] .product-tag {
  background: rgba(42, 42, 42, 0.96);
  color: var(--text-color);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.product-title {
  font-size: 16px;
  font-weight: 600;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
}

.product-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-text);
}

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.button {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #1b1307;
}

.button.secondary {
  background: white;
}

/* Filter bar */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-button {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: white;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}

.filter-button.active {
  border-color: var(--accent);
  background: rgba(243, 176, 100, 0.12);
}

/* Product detail */

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
}

.product-detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ecebe8;
  border: 1px solid var(--border-color);
}

.product-detail-image-inner {
  position: relative;
  padding-bottom: 100%;
}

.product-detail-image-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail-info h1 {
  margin-top: 0;
  margin-bottom: 4px;
}

.product-detail-price {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-detail-meta {
  font-size: 13px;
  color: var(--muted-text);
  margin-bottom: 16px;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.detail-list li {
  font-size: 14px;
  margin-bottom: 4px;
}

.detail-label {
  font-weight: 600;
}

.product-detail-description {
  font-size: 14px;
  margin-bottom: 16px;
}

/* About */

.page-about .about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: start;
}

.about-image {
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-color);
  aspect-ratio: 1 / 1;
  background: #ecebe8;
  position: relative;
  width: 100%;
  padding-bottom: 100%;
}

.about-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-placeholder {
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ecebe8;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-text);
  font-size: 13px;
}

/* Cart */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.cart-item-image {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ecebe8;
  cursor: pointer;
  transition: opacity 0.2s ease;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-image:hover {
  opacity: 0.8;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-info {
  font-size: 16px;
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 18px;
}

.cart-item-meta {
  font-size: 14px;
  color: var(--muted-text);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.quantity-control button {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: white;
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
}

.cart-summary {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  font-size: 14px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cart-summary-row.total {
  font-weight: 600;
}

.checkout-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.checkout-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cart-note {
  font-size: 12px;
  color: var(--muted-text);
}

/* Checkout form */

.order-summary {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.order-summary h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.order-summary-item:last-child {
  border-bottom: none;
}

.order-summary-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--border-color);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-color);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.radio-label input[type="radio"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

#checkout-form h2 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 18px;
}

#confirmation-view {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
}

#confirmation-view h2 {
  margin-top: 0;
  color: var(--accent);
}

#confirmation-view .payment-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .radio-group {
    flex-direction: column;
    gap: 12px;
  }
}

/* Footer */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
  font-size: 12px;
  color: var(--muted-text);
  text-align: center;
}

.site-footer p {
  margin: 0;
  line-height: 1.6;
}

.site-footer a {
  color: var(--muted-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--accent);
}

/* Responsive */

@media (max-width: 768px) {
  .page,
  .page-home {
    padding: 80px 16px 32px;
  }

  .hero {
    margin-top: 0;
    margin-bottom: 32px;
  }

  .section {
    margin-bottom: 48px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .hero-title {
    font-size: clamp(32px, 10vw, 70px);
    padding: 0 10px;
    transform: rotate(-1deg);
  }
  
  .hero-text {
    padding: 30px 16px;
  }
  
  .product-card {
    padding: 12px;
  }
  
  .product-title {
    font-size: 14px;
  }
  
  .product-price {
    font-size: 14px;
  }

  .button {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .product-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-about .about-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header {
    padding: 0 12px;
  }

  .logo {
    flex: 1;
    text-align: center;
  }

  .site-nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    background: rgba(246, 246, 245, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 24px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s, 
                opacity 0.3s;
    min-width: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .site-nav.open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  [data-theme="dark"] .site-nav {
    background: rgba(26, 26, 26, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease;
    z-index: 45;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  [data-theme="dark"] .nav-overlay {
    background: rgba(0, 0, 0, 0.6);
  }

  .site-nav a {
    display: flex !important;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    font-size: 15px;
    border-radius: var(--radius-md);
    min-height: 44px;
    text-decoration: none;
    color: var(--muted-text);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 101;
  }

  .site-nav a:hover,
  .site-nav a:active {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-color);
  }

  .site-nav a.active {
    border-color: var(--accent);
    color: var(--text-color);
    background: rgba(243, 176, 100, 0.12);
  }

  .nav-toggle {
    display: flex;
  }

  .cart-link {
    margin-top: 8px;
  }

  .cart-item {
    grid-template-columns: 90px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .cart-item-image {
    width: 90px;
    height: 90px;
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
  }
}

