:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #fbfbfe;
  --text: #181b25;
  --muted: #697086;
  --line: #eceef5;
  --brand: #6f3ff5;
  --brand-2: #ff6b8b;
  --accent: #ffb84d;
  --success: #25b46b;
  --danger: #ef4444;
  --shadow-sm: 0 10px 25px rgba(23, 24, 38, 0.06);
  --shadow-md: 0 16px 40px rgba(44, 23, 96, 0.1);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(700px 350px at 8% -8%, rgba(111, 63, 245, 0.18), transparent 55%),
    radial-gradient(700px 350px at 100% 20%, rgba(255, 107, 139, 0.15), transparent 55%),
    var(--bg);
}

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 14px 110px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 248, 252, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(236, 238, 245, 0.8);
  border-radius: 0 0 18px 18px;
  padding: 10px 4px 12px;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.desktop-links {
  display: none;
  align-items: center;
  gap: 18px;
}

.desktop-links a {
  text-decoration: none;
  color: #5e6584;
  font-size: 14px;
  font-weight: 600;
}

.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--brand);
}

.icon-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: #4f5670;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.icon-btn.is-fav {
  color: #e11d48;
  border-color: #fecdd3;
  background: #fff1f2;
}

.cart-badge {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid #fff;
}

.search {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--muted);
}

.search input {
  border: 0;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 14px;
}

.hero {
  margin-top: 16px;
  border-radius: 26px;
  padding: 22px 18px;
  background: linear-gradient(120deg, #efe8ff 0%, #ffe7ef 45%, #fff1d7 100%);
  border: 1px solid #f0e7ff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-slider {
  position: relative;
}

.hero-slider .hero-slide {
  display: none;
}

.hero-slider .hero-slide.is-active {
  display: grid;
  animation: fadeInSlide 0.35s ease;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.hero::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  right: -36px;
  top: -36px;
  background: rgba(111, 63, 245, 0.14);
}

.hero-media {
  position: relative;
  z-index: 2;
}

.hero-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 18px;
}

.hero-media-card {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #ece8ff;
  box-shadow: var(--shadow-sm);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-media-card strong {
  font-size: 12px;
}

.hero-media-card span {
  font-size: 12px;
  color: #596081;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #ebe6ff;
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 6;
  color: #5e4ca3;
}

.hero-prev {
  left: 10px;
}

.hero-next {
  right: 10px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 6;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.hero-dot.active {
  width: 20px;
  border-radius: 999px;
  background: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #fff8e5;
  border: 1px solid #ffe4a7;
  color: #7d5a00;
  border-radius: 999px;
  padding: 6px 10px;
}

.hero h1 {
  margin: 10px 0 8px;
  line-height: 1.1;
  font-size: 34px;
}

.hero p {
  margin: 0;
  color: #4c5065;
  max-width: 46ch;
}

.hero-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), #8b5cf6 50%, var(--brand-2));
  box-shadow: 0 12px 24px rgba(111, 63, 245, 0.25);
}

.btn-soft {
  background: #fff;
  color: #3f4160;
  border: 1px solid #e9ebf5;
}

.location-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #efe7ff;
  border-radius: 999px;
  padding: 8px 12px;
  color: #51577a;
  font-size: 13px;
}

.section-head {
  margin-top: 22px;
  margin-bottom: 10px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #5a6079;
}

.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.market-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.market-card {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.market-cover {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  object-fit: cover;
}

.market-name {
  margin: 0;
  font-size: 18px;
}

.market-desc {
  margin: 5px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.market-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #606786;
  font-size: 12px;
}

.open-btn {
  align-self: center;
  border: 0;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  font-weight: 700;
  padding: 9px 13px;
  text-decoration: none;
  font-size: 13px;
}

.hero-market {
  margin-top: 16px;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  min-height: 220px;
  box-shadow: var(--shadow-md);
}

.hero-market img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  min-height: 220px;
  padding: 18px;
  background: linear-gradient(120deg, rgba(21, 18, 59, 0.74), rgba(111, 63, 245, 0.54));
  color: #fff;
}

.hero-overlay h1 {
  margin: 8px 0 8px;
  font-size: 32px;
}

.hero-overlay p {
  margin: 0;
  max-width: 48ch;
  opacity: 0.95;
}

.status {
  margin-top: 10px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 6px 10px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
}

.products {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.product-image {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 14px;
  object-fit: cover;
}

.product-tag {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.product-name {
  margin: 4px 0 0;
  font-size: 15px;
}

.product-sub {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-weight: 800;
}

.add-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.floating-cart {
  position: fixed;
  right: 14px;
  bottom: 82px;
  z-index: 40;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  padding: 12px 16px;
  box-shadow: 0 16px 32px rgba(111, 63, 245, 0.3);
  text-decoration: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: end;
  padding: 10px 10px 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid #edeff6;
  border-radius: 22px 22px 0 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #7a819d;
  font-size: 10px;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 700;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 14px 28px rgba(111, 63, 245, 0.28);
}

.site-footer {
  margin-top: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.cart-empty {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.cart-empty h2 {
  margin: 0;
  font-size: 22px;
}

.cart-empty p {
  margin: 8px 0 12px;
  color: var(--muted);
}

.cart-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.cart-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 10px;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  align-items: center;
}

.cart-item-image {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
}

.cart-item-title {
  margin: 0;
  font-size: 15px;
}

.cart-item-sub {
  margin: 4px 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.cart-item-price {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.cart-controls {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #dddff0;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cart-qty {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.cart-remove-btn {
  border: 0;
  background: transparent;
  color: #b4233f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cart-summary {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #49506b;
  padding: 4px 0;
}

.cart-summary-row.total {
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 16px;
  color: var(--text);
}

.cart-checkout-btn,
.cart-clear-btn {
  width: 100%;
  margin-top: 10px;
}

.auth-shell {
  margin-top: 18px;
  display: grid;
  place-items: center;
}

.auth-card {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.auth-head h1 {
  margin: 0;
  font-size: 28px;
}

.auth-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-tabs {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #f8f9ff;
  border-radius: 12px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.auth-tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  color: #596081;
  cursor: pointer;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.auth-form {
  margin-top: 14px;
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 6px;
}

.auth-input {
  width: 100%;
  border: 1px solid #e4e7f3;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
}

.auth-input:focus {
  border-color: #c6b6ff;
  box-shadow: 0 0 0 3px rgba(111, 63, 245, 0.12);
}

.auth-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-check {
  font-size: 12px;
  color: #5f6786;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-link {
  font-size: 12px;
  text-decoration: none;
  color: var(--brand);
  font-weight: 700;
}

.auth-submit {
  width: 100%;
  margin-top: 12px;
}

.auth-divider {
  margin: 14px 0 10px;
  position: relative;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--line);
}

.auth-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 10px;
  color: #8d94ab;
  font-size: 12px;
}

.auth-socials {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.footer-brand {
  font-size: 18px;
  font-weight: 800;
}

.footer-brand span {
  color: var(--brand);
}

.footer-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: #596081;
  font-size: 13px;
  font-weight: 600;
}

.footer-bottom {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #7a819d;
  font-size: 12px;
}

@media (min-width: 720px) {
  .app {
    padding: 18px 24px 28px;
  }

  .market-list {
    grid-template-columns: 1fr;
  }

  .products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav {
    display: none;
  }

  .floating-cart {
    bottom: 20px;
    right: 20px;
  }
}

@media (min-width: 980px) {
  .app {
    padding: 20px 28px 30px;
  }

  .desktop-links {
    display: flex;
  }

  .topbar {
    padding: 12px 6px 14px;
  }

  .search {
    max-width: 520px;
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    align-items: center;
    padding: 28px 24px;
  }

  .hero h1 {
    font-size: 48px;
    max-width: 15ch;
  }

  .hero-media img {
    height: 300px;
  }

  .hero-prev {
    left: 14px;
  }

  .hero-next {
    right: 14px;
  }

  .section-head h2 {
    font-size: 30px;
  }

  .market-card {
    grid-template-columns: 110px 1fr auto;
    padding: 16px;
    gap: 16px;
  }

  .market-cover {
    width: 110px;
    height: 90px;
    border-radius: 18px;
  }

  .market-name {
    font-size: 22px;
  }

  .market-desc {
    font-size: 15px;
    max-width: 90ch;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
  }

  .footer-bottom {
    margin-top: 12px;
  }
}
