/* ============================================================
   DESEINING SHOP – Teal/Lime Theme
   ============================================================ */

:root {
  --teal-900: #134e4a;
  --teal-800: #115e59;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --lime-500: #84cc16;
  --lime-400: #a3e635;
  --lime-300: #bef264;
  --lime-100: #ecfccb;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  --white: #ffffff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.15);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

/* ---- Header ---- */
.site-header {
  background: var(--teal-800);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--lime-300);
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo span { color: var(--white); }

.header-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  padding-left: 16px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
}
.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
}
.nav-btn.active {
  background: var(--teal-600);
  color: var(--white);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Balance display */
.balance-display {
  display: flex;
  gap: 8px;
  align-items: center;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--white);
  cursor: default;
}
.balance-chip .icon { font-size: 1rem; }
.balance-chip.coins .icon { color: #fbbf24; }
.balance-chip.bills .icon { color: var(--lime-300); }

/* Cart button */
.cart-btn {
  position: relative;
  background: var(--teal-600);
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.cart-btn:hover { background: var(--teal-500); }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--lime-500);
  color: var(--gray-900);
  font-size: .65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}
.cart-badge.visible { display: flex; }

/* Auth buttons */
.btn-login {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
}
.btn-login:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

.btn-register {
  background: var(--lime-500);
  border: none;
  color: var(--gray-900);
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 700;
  transition: background .2s;
}
.btn-register:hover { background: var(--lime-400); }

/* User menu */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
  background: var(--teal-600);
  border: 2px solid var(--teal-400);
  color: var(--white);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.user-avatar-btn:hover { border-color: var(--lime-400); }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 14px 16px;
  background: var(--teal-50);
  border-bottom: 1px solid var(--gray-300);
}
.user-dropdown-header .name { font-weight: 700; font-size: .9rem; color: var(--teal-800); }
.user-dropdown-header .email { font-size: .78rem; color: var(--gray-500); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: .875rem;
  color: var(--gray-700);
  text-align: left;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--gray-100); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fef2f2; }

/* ---- Main Layout ---- */
.page-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ---- Views ---- */
.view { display: none; }
.view.active { display: block; }

/* ---- Section titles ---- */
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--teal-800);
  margin-bottom: 8px;
}
.section-sub {
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ---- Filter Tabs ---- */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filter-tab {
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  transition: all .2s;
}
.filter-tab:hover { border-color: var(--teal-500); color: var(--teal-700); }
.filter-tab.active {
  background: var(--teal-700);
  border-color: var(--teal-700);
  color: var(--white);
}

/* ---- Product Grid ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .2s, transform .2s;
  position: relative;
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.product-badge {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.product-badge.rätsel,
.product-badge.kreuzworträtsel {
  background: var(--teal-100);
  color: var(--teal-800);
}
.product-badge.apo {
  background: var(--lime-100);
  color: #3f6212;
}

.product-desc {
  font-size: .83rem;
  color: var(--gray-500);
  flex: 1;
  line-height: 1.5;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .9rem;
}
.price-coins {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--teal-700);
}
.price-bills {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #3f6212;
}
.price-sep { color: var(--gray-300); }

.btn-add-cart {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--teal-700);
  color: var(--white);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s;
}
.btn-add-cart:hover { background: var(--teal-600); }
.btn-add-cart.in-cart {
  background: var(--lime-500);
  color: var(--gray-900);
}
.btn-add-cart.in-cart:hover { background: var(--lime-400); }
.btn-add-cart.cant-afford {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  color: #c2410c;
  cursor: pointer;
}
.btn-add-cart.cant-afford:hover { background: #ffedd5; border-color: #fb923c; }

.btn-add-cart.sold-out {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
  border: 1.5px solid var(--gray-200);
}

/* Sold-out card */
.sold-out-card { opacity: .75; }
.sold-out-card .product-name { color: var(--gray-500); }

/* Sold-out badge */
.product-badge.sold-out-badge { background: #fee2e2; color: #991b1b; }

/* 'sets' badge */
.product-badge.sets { background: #fef9c3; color: #854d0e; }
/* 'taschenrätsel' badge */
.product-badge.taschenrätsel { background: #fce7f3; color: #9d174d; }
/* 'neu' badge */
.product-badge.neu { background: #ede9fe; color: #5b21b6; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--gray-500);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; color: var(--gray-700); margin-bottom: 6px; }

/* ---- Orders ---- */
.orders-list { display: flex; flex-direction: column; gap: 16px; }

.order-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.order-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--teal-50);
  border-bottom: 1px solid var(--gray-300);
  flex-wrap: wrap;
}
.order-id { font-weight: 700; color: var(--teal-700); }
.order-date { font-size: .83rem; color: var(--gray-500); }
.order-status-badge {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.status-ausstehend  { background: #fef3c7; color: #92400e; }
.status-bestätigt   { background: #dbeafe; color: #1e40af; }
.status-abgeschlossen { background: #dcfce7; color: #166534; }
.status-ausgeliefert { background: var(--teal-100); color: var(--teal-800); }
.status-storniert   { background: #fee2e2; color: #991b1b; }

.order-card-body { padding: 16px 20px; }
.order-items-list { margin-bottom: 12px; }
.order-item-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.order-item-row:last-child { border-bottom: none; }
.order-total {
  display: flex;
  gap: 16px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--teal-700);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}

.order-card-footer {
  padding: 12px 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.order-address { font-size: .83rem; color: var(--gray-500); }

.btn-cancel {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
  transition: all .2s;
}
.btn-cancel:hover { background: var(--danger); color: var(--white); }

/* ---- Profile ---- */
.profile-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  box-shadow: var(--shadow-sm);
}
.profile-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal-800);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}
.balance-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.balance-box {
  flex: 1;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.balance-box .bal-icon { font-size: 1.8rem; margin-bottom: 4px; }
.balance-box .bal-val { font-size: 1.5rem; font-weight: 800; color: var(--teal-700); }
.balance-box .bal-label { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}
.modal.modal-wide { max-width: 600px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-title { font-size: 1.2rem; font-weight: 800; color: var(--teal-800); }
.modal-close {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .optional { font-weight: 400; color: var(--gray-500); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
textarea.form-input { resize: vertical; min-height: 80px; }

/* Buttons */
.btn-primary {
  background: var(--teal-700);
  border: none;
  color: var(--white);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  transition: background .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--teal-600); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--teal-500); color: var(--teal-700); }

.btn-danger {
  background: var(--danger);
  border: none;
  color: var(--white);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  transition: background .2s;
}
.btn-danger:hover { background: #dc2626; }

/* ---- Alert/Toast ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
}
.toast.success { background: var(--teal-700); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--gray-900); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- Cart ---- */
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.cart-item-row:last-child { border-bottom: none; }
.cart-item-name { font-size: .9rem; font-weight: 600; flex: 1; }
.cart-item-price { font-size: .85rem; color: var(--teal-700); font-weight: 600; }
.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: .9rem;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 4px;
  font-weight: 700;
  font-size: .95rem;
  border-top: 2px solid var(--gray-200);
  margin-top: 8px;
}

.cart-balance-info {
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .83rem;
  color: var(--teal-700);
  margin: 12px 0;
}
.cart-balance-info.insufficient {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

/* ---- Auth tabs ---- */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.auth-tab.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ---- Contact method selector ---- */
.contact-options {
  display: flex;
  gap: 10px;
}

.contact-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  background: var(--white);
  user-select: none;
}
.contact-option:hover {
  border-color: var(--teal-400);
  background: var(--teal-50);
}
.contact-option input[type="radio"] { display: none; }
.contact-option input[type="radio"]:checked ~ .contact-option-icon,
.contact-option input[type="radio"]:checked ~ .contact-option-text {
  color: var(--teal-700);
}
.contact-option:has(input:checked) {
  border-color: var(--teal-600);
  background: var(--teal-50);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
.contact-option-icon {
  font-size: 1.3rem;
  color: var(--gray-400);
  transition: color .2s;
}
.contact-option-text {
  font-size: .8rem;
  font-weight: 700;
  color: var(--gray-600);
  transition: color .2s;
}

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 20px 0;
}

/* ---- Error message ---- */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 16px;
  display: none;
}
.form-error.visible { display: block; }

/* ---- Loading ---- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  text-align: center;
  padding: 48px;
  color: var(--gray-500);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .balance-display .balance-chip span:not(.icon) { display: none; }
  .page-main { padding: 20px 16px; }
  .modal { max-width: 100%; border-radius: var(--radius); }
}
