:root {
  --bg: #0d0f14;
  --bg-card: #161a22;
  --bg-elevated: #1e2430;
  --text: #f4f6fb;
  --text-muted: #8b93a7;
  --accent: #ff6b35;
  --accent-2: #3a86ff;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(80px + var(--safe-bottom));
}

body.is-desktop #app {
  max-width: 920px;
}

body.is-desktop .catalog {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

body.is-desktop .hero h2 {
  font-size: 30px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__logo {
  font-size: 28px;
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header p {
  font-size: 12px;
  color: var(--text-muted);
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.cart-btn__count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.cart-btn__count.visible {
  display: flex;
}

.hero {
  margin: 16px 20px;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1a1f2e 0%, #2a1a12 50%, #1a2238 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.35), transparent 70%);
}

.hero__tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero h2 {
  font-size: 26px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  font-size: 14px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  padding: 0 20px 12px;
}

.filter-chip {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
  text-align: center;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px;
}

.loading,
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card__visual {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-card__device {
  width: 36px;
  height: 88px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
}

.product-card__device::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.product-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.product-card__body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__brand {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.product-card__name {
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0;
}

.product-card__flavor {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.product-card__meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-card__price {
  font-size: 15px;
  font-weight: 700;
}

.add-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.add-btn:active {
  transform: scale(0.95);
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.age-gate.hidden {
  display: none;
}

.age-gate__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  max-width: 340px;
}

.age-gate__icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.age-gate__card h3 {
  margin-bottom: 8px;
}

.age-gate__card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #ff8f66);
  color: #fff;
  width: 100%;
  margin-bottom: 8px;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  width: 100%;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.cart-panel.open {
  pointer-events: auto;
}

.cart-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s;
}

.cart-panel.open .cart-panel__overlay {
  opacity: 1;
}

.cart-panel__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}

.cart-panel.open .cart-panel__sheet {
  transform: translateY(0);
}

.cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.cart-panel__items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

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

.cart-item__info {
  flex: 1;
}

.cart-item__info strong {
  display: block;
  font-size: 14px;
}

.cart-item__info span {
  font-size: 12px;
  color: var(--text-muted);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item__qty button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.cart-item__price {
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.cart-panel__form {
  padding: 0 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-panel__form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.cart-panel__form input,
.cart-panel__form textarea {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.cart-panel__footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}

.cart-panel__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 16px;
}

.cart-panel__total strong {
  font-size: 22px;
  color: var(--accent);
}

.cart-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
