:root {
  --bg: #000;
  --card: #1a1a1a;
  --card-2: #222;
  --text: #fff;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --font-brand: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
}

button,
input,
a {
  font: inherit;
  color: inherit;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* HERO */
.hero {
  position: relative;
  height: 62vh;
  min-height: 420px;
  max-height: 560px;
  overflow: hidden;
  background: #0a0a0a;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(1.05) saturate(0.9);
}

.hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 28%, rgba(0, 0, 0, 0.55) 70%, #000 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 40%);
}

.hero-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  display: grid;
  gap: 5px;
  place-content: center;
  padding: 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.icon-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
}

.tg-chip {
  text-decoration: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  backdrop-filter: blur(8px);
}

.hero-line {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.86);
  max-width: 20em;
  margin-left: auto;
  margin-right: auto;
}

.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 2;
  text-align: center;
  padding: 0 16px;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  letter-spacing: 0.01em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

.spark {
  font-size: 0.45em;
  vertical-align: middle;
  opacity: 0.9;
}

.hero-meta {
  margin: 8px 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* CATEGORIES */
.cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 14px 6px;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  color: #fff;
  min-height: 72px;
  min-width: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.cat:active {
  transform: scale(0.98);
}

.cat.active {
  border-color: #fff;
  background: #202020;
}

.cat-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}

.cat.text-only {
  padding: 10px 4px;
}

.cat-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
}

/* STOCK */
.stock {
  padding: 18px 0 8px;
}

.stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 12px;
}

.stock-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 0;
}

.filters-panel {
  margin: 0 14px 14px;
  padding: 14px;
  background: var(--card);
  border-radius: 16px;
}

.filters-panel[hidden] {
  display: none !important;
}

.filter-block {
  margin-bottom: 14px;
}

.filter-block label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.size-btn {
  min-width: 42px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.size-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.price-row input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn.ghost {
  background: #111;
  color: #fff;
  border: 1px solid #333;
}

.btn.solid {
  background: #fff;
  color: #000;
}

.product-rail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 16px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  animation: rise 0.4s ease both;
  min-width: 0;
}

.card-media {
  position: relative;
  aspect-ratio: 1 / 1.05;
  background: #111;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #fff;
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
}

.fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card-body {
  padding: 10px 12px 14px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

.card-size {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.card-price {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.ask-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #000;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

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

/* PROMO */
.promo {
  position: relative;
  margin: 18px 14px 24px;
  border-radius: 18px;
  overflow: hidden;
  height: 118px;
}

.promo-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.promo-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.72) contrast(1.05);
}

.see-all {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: none;
  background: #fff;
  color: #000;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid #1c1c1c;
  backdrop-filter: blur(12px);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 88px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 6px;
}

/* SHEET */
.sheet-overlay[hidden] {
  display: none !important;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: min(430px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #111;
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(24px + var(--safe-b));
  position: relative;
  animation: sheetUp 0.28s ease both;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: #333;
  margin: 4px auto 12px;
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1a1a1a;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

.detail-media {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #000;
  margin-bottom: 14px;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 600;
}

.detail-price {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
}

.detail-desc {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  background: #1a1a1a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: #cfcfcf;
}

/* DRAWER */
.drawer[hidden] {
  display: none !important;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
}

.drawer-panel {
  width: min(280px, 80vw);
  height: 100%;
  background: #0d0d0d;
  padding: 56px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: drawerIn 0.25s ease both;
}

.drawer-panel h3 {
  margin: 0 0 8px;
  font-family: var(--font-brand);
  font-size: 1.8rem;
}

.drawer-panel a {
  text-decoration: none;
  color: #ddd;
  font-size: 0.95rem;
}

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

@keyframes sheetUp {
  from {
    transform: translateY(20px);
    opacity: 0.7;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes drawerIn {
  from {
    transform: translateX(-12px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
