* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 65%);
  color: #dbeafe;
  min-height: 100vh;
}

.layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 180px;
}

.hero {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 45%, #7c3aed 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.45);
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.hero h1 {
  margin: 8px 0 6px;
  font-size: 28px;
}

.subtitle {
  margin: 0;
  color: #e0e7ff;
  line-height: 1.45;
}

.tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.98) 42%);
  z-index: 40;
}

.tab {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab-icon {
  font-size: 16px;
}

.tab.active {
  border-color: #7dd3fc;
  color: #0f172a;
  background: #e0f2fe;
  font-weight: 700;
}

.panel {
  display: none;
  margin-top: 12px;
  border-radius: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(8px);
}

.panel.active {
  display: block;
}

.panel-header h2 {
  margin: 0 0 4px;
}

.panel-header p {
  margin: 0 0 12px;
  color: #cbd5e1;
}

.products {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: rgba(30, 41, 59, 0.92);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.card p {
  margin: 0 0 8px;
  color: #cbd5e1;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(186, 230, 253, 0.2);
  color: #bfdbfe;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.actions-right {
  display: flex;
  gap: 8px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.actions button,
#openCheckoutButton,
#checkoutNextButton,
#confirmCheckoutButton,
.secondary {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.2s ease;
}

.actions button:hover,
#openCheckoutButton:hover,
#checkoutNextButton:hover,
#confirmCheckoutButton:hover,
.secondary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.actions button:disabled,
#openCheckoutButton:disabled,
#checkoutNextButton:disabled,
#confirmCheckoutButton:disabled,
.secondary:disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.secondary {
  background: #334155;
}

.details-button {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  min-width: 28px;
  height: 28px;
  padding: 0;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  cursor: pointer;
}

.chip.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #7dd3fc;
}

.preview-items {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.preview-items li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.item-line h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.item-line p {
  margin: 0;
  color: #bfdbfe;
  font-size: 14px;
}

.empty {
  margin: 8px 0 14px;
  color: #94a3b8;
}

.summary {
  border-radius: 12px;
  padding: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.summary p {
  margin: 0 0 8px;
  display: flex;
  justify-content: space-between;
  color: #e2e8f0;
}

.summary-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.26);
  font-size: 18px;
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.setting-card {
  border-radius: 12px;
  padding: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.setting-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.field-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(30, 41, 59, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

textarea {
  resize: vertical;
}

.checkbox {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.hint {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 14px;
}

.hint.error {
  color: #fca5a5;
}

.hint.success {
  color: #86efac;
}

.bottom-checkout {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(74px + env(safe-area-inset-bottom));
  padding: 10px 16px 8px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.95) 36%);
  z-index: 45;
}

#openCheckoutButton {
  width: min(980px, 100%);
  display: block;
  margin: 0 auto;
  padding: 13px 14px;
  font-weight: 700;
}

.checkout-drawer {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  z-index: 70;
}

.product-details-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 75;
}

.product-details-sheet {
  width: min(640px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 14px;
}

.product-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-details-header h2 {
  margin: 0;
}

.product-details-image-wrap {
  margin-top: 10px;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.product-details-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.product-details-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
}

.product-thumb {
  flex: 0 0 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
}

.product-thumb.active {
  border-color: #38bdf8;
}

.product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details-category {
  margin: 10px 0 0;
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(186, 230, 253, 0.2);
  color: #bfdbfe;
}

.product-details-price {
  margin: 10px 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: #e0f2fe;
}

.product-details-description {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.checkout-sheet {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 14px;
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checkout-header h2 {
  margin: 0;
}

.checkout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.payment-methods {
  display: grid;
  gap: 8px;
}

.payment-method-button {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.72);
  color: #e2e8f0;
  width: 100%;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.14s ease;
}

.payment-method-button:hover {
  border-color: #7dd3fc;
  background: rgba(30, 41, 59, 0.94);
  transform: translateY(-1px);
}

.payment-method-button.active {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.18);
}

.payment-method-icon {
  width: 20px;
  text-align: center;
  font-size: 18px;
  flex: 0 0 20px;
}

.checkout-step-title {
  margin: 0 0 10px;
  font-size: 16px;
  color: #e2e8f0;
}

.checkout-summary {
  margin: 14px 0 0;
  font-weight: 700;
  color: #e0f2fe;
}

.checkout-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.checkout-actions button {
  flex: 1;
}

#checkoutNextButton,
#confirmCheckoutButton {
  padding: 12px 14px;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 24px;
  }

  .field-group {
    grid-template-columns: 1fr;
  }

  .bottom-checkout {
    padding-left: 12px;
    padding-right: 12px;
  }
}
