:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --cyan: #00bcd4;
  --cyan-hover: #00a5bb;
  --cyan-light: #e0f7fa;
  --blue: #0066cc;
  --blue-hover: #0052a3;
  --yellow: #ffd500;
  --yellow-hover: #f0c800;
  --purple: #7c3aed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --font: 'Inter', system-ui, sans-serif;
  --max: 1140px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  max-width: var(--max);
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}

.logo-svg { flex-shrink: 0; }

.logo-img {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  flex-shrink: 0;
}
.header-minimal .header-top { border-bottom: none; }
.header-minimal { box-shadow: var(--shadow); }

.locale-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.search-bar {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: .65rem 1rem .65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fafafa;
}

.search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.locale-pill {
  font-size: .85rem;
  color: var(--text-muted);
}

.cart-link {
  position: relative;
  color: var(--text);
  padding: .35rem;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--cyan);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.user-email {
  font-size: .8rem;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem .75rem;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
}

.nav-item {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.nav-item:hover { color: var(--cyan); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: .65rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.btn-sm { padding: .5rem .9rem; font-size: .875rem; }
.btn-full { width: 100%; }

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

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

.btn-buy {
  background: var(--yellow);
  color: #111;
  width: 100%;
  border-radius: var(--radius-sm);
  padding: .75rem;
}

.btn-buy:hover { background: var(--yellow-hover); }

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

.btn-lock { max-width: 320px; margin-left: auto; }

.inline-form { display: inline; }

/* Page */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-narrow { max-width: 720px; }

.page-title, .page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.page-subtitle { color: var(--text-muted); margin-top: -.75rem; margin-bottom: 1.5rem; }

.section { margin-bottom: 2.5rem; }

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .85rem;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .75rem .85rem;
  text-align: center;
  transition: box-shadow .15s, transform .15s;
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card-visual {
  height: 80px;
  display: grid;
  place-items: center;
  background: var(--tile-bg, #f5f5f5);
  border-radius: var(--radius-sm);
  margin-bottom: .6rem;
  overflow: hidden;
}

.category-card-img {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}

.category-card-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.badge-popular {
  position: absolute;
  top: .6rem;
  left: .6rem;
  z-index: 2;
  background: var(--purple);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  padding: .25rem .5rem;
  border-radius: 4px;
  letter-spacing: .03em;
}

.product-card-image {
  height: 180px;
  background: #e9edf0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1rem;
}

.product-card-img {
  height: 140px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.12));
  transition: transform .15s;
}

.product-card:hover .product-card-img {
  transform: scale(1.03);
}

.product-card-body {
  padding: .85rem .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
  background: var(--surface);
}

.product-card-title {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.product-card-price {
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: .35rem;
}

.variable-row {
  display: flex;
  gap: .5rem;
  margin-top: auto;
}

.input-sm {
  width: 72px;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.input:focus {
  outline: 2px solid color-mix(in srgb, var(--blue) 35%, transparent);
  border-color: var(--blue);
}

/* Cart */
.cart-layout, .checkout-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.cart-main, .checkout-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-image, .sidebar-cart-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: #e9edf0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img, .sidebar-cart-thumb img {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.cart-item-name { font-weight: 700; }
.cart-item-sub { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; margin-top: .15rem; }

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .5rem;
}

.link-muted {
  color: var(--text-muted);
  font-size: .85rem;
  background: none;
  border: none;
  cursor: pointer;
}

.qty-form { display: flex; align-items: center; gap: .25rem; }

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.qty-input {
  width: 36px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem;
}

.cart-item-price { font-weight: 800; white-space: nowrap; }

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 1.05rem;
}

.cart-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: .5rem;
}

.back-link { color: var(--text-muted); font-size: .9rem; }

.sidebar-trust, .checkout-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.sidebar-trust h3, .checkout-sidebar h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.trust-list { list-style: none; display: grid; gap: 1rem; }
.trust-list li { display: flex; gap: .75rem; font-size: .85rem; }
.trust-list strong { display: block; }
.trust-list span { color: var(--text-muted); }
.trust-icon { font-size: 1.25rem; }

.sidebar-cart-item {
  display: flex;
  gap: .75rem;
  margin-bottom: .75rem;
  font-size: .85rem;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}

.sidebar-row.muted { color: var(--text-muted); font-size: .85rem; }

/* Checkout breadcrumb */
.checkout-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
  font-size: .85rem;
}

.breadcrumb-step {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb-step.done { color: var(--cyan); }
.breadcrumb-step.active { color: var(--text); font-weight: 700; }

.breadcrumb-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
}

.breadcrumb-step.done .breadcrumb-dot {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
}

.breadcrumb-step.active .breadcrumb-dot {
  border-color: var(--blue);
  color: var(--blue);
}

.breadcrumb-sep {
  width: 24px;
  height: 2px;
  background: var(--border);
}

.checkout-page .page-title { margin-bottom: 1rem; }

/* Checkout */
.checkout-step {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.step-marker {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.checkout-step.done .step-marker {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.checkout-step.active .step-marker {
  border-color: var(--blue);
  color: var(--blue);
}

.step-content { flex: 1; }
.step-content h2 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.step-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-bottom: 1.25rem;
}

.payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .75rem .5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color .15s, background .15s;
}

.payment-method svg { color: var(--text-muted); }

.payment-method.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 4%, white);
}

.payment-method.active svg { color: var(--blue); }

.payment-method.disabled {
  opacity: .45;
  cursor: not-allowed;
}

.payment-form-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: #fafbfc;
}

.payment-form-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.payment-form-header strong { display: block; font-size: .95rem; }
.payment-form-header small { color: var(--text-muted); font-size: .8rem; }

.form-hint { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }

.payment-notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  color: #0369a1;
}

.field-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--text);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: .75rem 0;
}

.card-form-demo { display: grid; gap: .25rem; margin-bottom: 1.25rem; }

#payment-element { margin-bottom: 1rem; }

.paypal-button-wrap {
  min-height: 45px;
  max-width: 420px;
}

.paypal-loading-hint {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.paypal-loading-hint[hidden] { display: none; }

.payment-form-panel[hidden] { display: none; }

.payment-message {
  color: #b91c1c;
  font-size: .9rem;
  margin-bottom: 1rem;
}

.btn-pay {
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-top: .5rem;
}

.btn-pay:hover:not(:disabled) { background: var(--blue-hover); }
.btn-pay:disabled { opacity: .5; cursor: not-allowed; }

.checkout-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-muted);
}

.sidebar-cart-list { margin-bottom: 1rem; }

.sidebar-cart-info { flex: 1; min-width: 0; }

.sidebar-cart-name {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: .15rem;
}

.sidebar-cart-price {
  font-size: .82rem;
  color: var(--text-muted);
}

.sidebar-cart-thumb {
  position: relative;
}

.thumb-qty {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--cyan);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.sidebar-totals { margin-top: .5rem; }

.sidebar-row.total-row {
  font-size: 1.05rem;
  font-weight: 800;
  padding-top: .75rem;
  border-top: 2px solid var(--border);
}

.sidebar-edit-cart {
  display: block;
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--blue);
  font-weight: 600;
}

.sidebar-edit-cart:hover { text-decoration: underline; }

/* Auth / success / error */
.auth-card, .success-card, .error-card, .empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.auth-card { text-align: left; max-width: 420px; margin: 2rem auto; }
.auth-card h1 { margin-bottom: 1.25rem; font-size: 1.5rem; }
.auth-form { display: grid; gap: .75rem; margin-bottom: 1rem; }

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
}

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
}

.alert-error { background: #fef2f2; color: #b91c1c; }
.alert-warning { background: #fffbeb; color: #92400e; }

.empty-state p { margin-bottom: 1rem; color: var(--text-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem;
  margin-top: 3rem;
}

.footer-inner-simple {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.footer-trust-text {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.footer-copy {
  font-size: .8rem;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #111;
  color: #fff;
  padding: .75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  z-index: 200;
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .header-top { flex-wrap: wrap; }
  .search-bar { order: 3; flex-basis: 100%; max-width: none; }
  .payment-methods-grid { grid-template-columns: repeat(2, 1fr); }
  .checkout-breadcrumb { flex-wrap: wrap; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-item { grid-template-columns: 56px 1fr; }
  .cart-item-price { grid-column: 2; text-align: right; }
}
