:root {
  --primary: #ff5c00;
  --primary-dark: #a73a00;
  --green: #00a945;
  --surface: #f9f9fb;
  --surface-low: #ffffff;
  --surface-mid: #eeeef0;
  --surface-high: #e8e8ea;
  --text: #1a1c1d;
  --muted: #5f5e5e;
  --outline: #e4beb1;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-strong: 0 12px 36px rgba(255, 92, 0, 0.22);
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.loading-card {
  display: grid;
  gap: 8px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.loading-card strong {
  color: var(--primary);
  font-size: 2rem;
}

.top-nav {
  position: fixed;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(228, 190, 177, 0.5);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(16px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  padding: 16px clamp(16px, 5vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand span {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 900;
}

.desktop-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 34vw);
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f3f3f5;
  color: var(--muted);
}

.desktop-search:focus-within {
  border-color: var(--primary);
  background: var(--surface-low);
}

.desktop-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.location-button,
.icon-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

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

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
}

.icon-button:hover,
.location-button:hover {
  color: var(--primary);
}

.icon-button small {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 0.68rem;
}

main {
  padding: 92px 0 0;
}

.hero-section,
.category-section,
.content-section {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  padding-inline: clamp(16px, 5vw, 64px);
}

.hero-section {
  padding-top: 32px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 48%);
  min-height: 360px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--primary);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 92, 0, 0.98), rgba(255, 92, 0, 0.84) 45%, rgba(255, 92, 0, 0.08));
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  max-width: 680px;
  padding: clamp(28px, 5vw, 64px);
  color: #fff;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.03;
}

.hero-copy h1 span {
  color: #370e00;
}

.hero-copy p {
  max-width: 520px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.12rem;
  line-height: 1.6;
}

.hero-image {
  min-height: 100%;
  background-position: center;
  background-size: cover;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 640px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-strong);
}

.hero-search label {
  display: grid;
  gap: 4px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.hero-search button,
.product-footer button,
.site-footer button {
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.hero-search button {
  min-width: 150px;
}

.category-section {
  margin-top: 32px;
}

.category-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: grid;
  flex: 0 0 104px;
  gap: 10px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.category-chip span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-high);
  box-shadow: var(--shadow);
  font-size: 1.75rem;
  transition: transform 180ms ease, background 180ms ease;
}

.category-chip:hover span,
.category-chip.active span {
  transform: translateY(-3px) scale(1.04);
  color: #fff;
  background: var(--primary);
}

.content-section {
  margin-top: 44px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-title h2,
.nearby-section > h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-title button {
  border: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background-position: center;
  background-size: cover;
}

.product-image span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
}

.product-card h3 {
  overflow: hidden;
  margin: 12px 0 4px;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.product-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.product-footer small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: line-through;
}

.product-footer strong {
  display: block;
  font-size: 1.18rem;
}

.product-footer button {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  padding: 0 12px;
  border-radius: 999px;
}

.nearby-section {
  margin-bottom: 40px;
}

.nearby-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.store-card {
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.store-card-large {
  position: relative;
  min-height: 360px;
}

.store-photo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transition: transform 700ms ease;
}

.store-card:hover .store-photo {
  transform: scale(1.04);
}

.store-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 72px 28px 28px;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), transparent);
}

.store-overlay div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-overlay span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 800;
}

.store-overlay span:first-child {
  background: var(--primary);
}

.store-overlay h3 {
  margin: 12px 0 6px;
  font-size: 1.7rem;
}

.store-overlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.nearby-list {
  display: grid;
  gap: 14px;
}

.store-card-small,
.result-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.store-thumb,
.result-thumb {
  width: 82px;
  height: 82px;
  border-radius: 16px;
  background-position: center;
  background-size: cover;
}

.store-card-small h3,
.result-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.store-card-small p,
.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.store-card-small span,
.result-card span {
  display: inline-block;
  margin-top: 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.store-card-small > strong {
  color: var(--muted);
  font-size: 1.8rem;
}

.results-section {
  padding-bottom: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  grid-template-columns: 96px minmax(0, 1fr);
  border-radius: 18px;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.result-card strong {
  display: block;
  margin-top: 10px;
  font-size: 0.9rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--outline);
  border-radius: 16px;
  background: var(--surface-low);
  color: var(--muted);
}

.site-footer {
  margin-top: 48px;
  padding: 48px clamp(16px, 5vw, 64px) 92px;
  border-top: 1px solid var(--outline);
  background: var(--surface-mid);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 36px;
  width: min(var(--max-width), 100%);
  margin: 0 auto;
}

.footer-grid section {
  display: grid;
  align-content: start;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  width: 38px;
  height: 38px;
}

.footer-brand strong {
  color: var(--primary);
  font-size: 1.6rem;
}

.footer-grid h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.footer-grid p,
.footer-grid a,
.footer-bottom {
  color: var(--muted);
  line-height: 1.6;
}

.site-footer button {
  min-height: 42px;
  width: max-content;
  padding: 0 16px;
  background: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(var(--max-width), 100%);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--outline);
}

.mobile-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  display: none;
  justify-content: space-around;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
}

.mobile-nav a {
  display: grid;
  min-width: 70px;
  place-items: center;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.mobile-nav a:first-child {
  color: #fff;
  background: var(--primary);
}

.support-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow-strong);
  font-size: 1.4rem;
}

.support-fab span {
  position: absolute;
  right: 68px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--text);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.support-fab:hover span {
  opacity: 1;
}

@media (max-width: 1080px) {
  .offers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nearby-grid,
  .results-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .desktop-search,
  .location-button {
    display: none;
  }

  .nav-inner {
    padding-block: 12px;
  }

  .brand span {
    font-size: 1.65rem;
  }

  .hero-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-card::after {
    background: linear-gradient(180deg, rgba(255, 92, 0, 0.98), rgba(255, 92, 0, 0.72));
  }

  .hero-image {
    min-height: 180px;
    order: -1;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .hero-search button {
    min-height: 48px;
  }

  .offers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-card-small {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .store-card-small > strong {
    display: none;
  }

  .footer-bottom {
    display: grid;
  }

  .mobile-nav {
    display: flex;
  }

  .support-fab {
    right: 18px;
    bottom: 86px;
  }
}

@media (max-width: 520px) {
  main {
    padding-top: 78px;
  }

  .hero-section,
  .category-section,
  .content-section {
    padding-inline: 14px;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-copy h1 {
    font-size: 2.35rem;
  }

  .offers-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }

  .product-image {
    grid-row: span 3;
  }

  .product-card h3 {
    margin-top: 0;
  }
}

/* App routes integrated from prototype examples */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-links a:hover {
  color: var(--primary);
  background: #fff3ec;
}

.page-shell {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  padding: 36px clamp(16px, 5vw, 64px) 28px;
}

.page-heading {
  display: grid;
  gap: 12px;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 22px;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.page-heading span,
.auth-card > span,
.detail-copy > span,
.store-hero span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.page-heading h1,
.auth-card h1,
.detail-copy h1,
.store-hero h1,
.profile-panel h1,
.dashboard-sidebar h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1;
}

.panel-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 720px;
}

.panel-search input,
.stack-form input {
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: 0 14px;
  outline: 0;
  background: #fff;
}

.panel-search button,
.stack-form button,
.auth-card small button,
.profile-panel button,
.store-hero button,
.action-row button,
.dashboard-sidebar button,
.checkout-card button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}

.auth-layout,
.profile-layout,
.detail-layout,
.dashboard-layout,
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
  gap: 18px;
  align-items: stretch;
}

.auth-card,
.auth-aside,
.profile-panel,
.profile-content,
.detail-copy,
.dashboard-sidebar,
.dashboard-content,
.checkout-card {
  border-radius: 22px;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.auth-card,
.auth-aside,
.profile-panel,
.profile-content,
.detail-copy,
.dashboard-sidebar,
.dashboard-content,
.checkout-card {
  padding: clamp(22px, 4vw, 34px);
}

.auth-card p,
.auth-aside p,
.detail-copy p,
.checkout-card p {
  color: var(--muted);
  line-height: 1.6;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.auth-card small {
  display: block;
  margin-top: 18px;
  color: var(--muted);
}

.auth-card small button {
  min-height: auto;
  padding: 0;
  color: var(--primary);
  background: transparent;
}

.auth-aside {
  display: grid;
  align-content: end;
  color: #fff;
  background: linear-gradient(135deg, var(--text), #3a2418 60%, var(--primary));
}

.avatar {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 28px;
  color: #fff;
  background: var(--primary);
  font-size: 2.4rem;
  font-weight: 900;
}

.profile-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.profile-panel p {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-grid article,
.timeline-list article {
  border: 1px solid #eeeeee;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.metric-grid strong {
  display: block;
  font-size: 1.6rem;
}

.metric-grid span,
.timeline-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.store-hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: 24px;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.store-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.12));
}

.store-hero > div {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: 760px;
  padding: clamp(24px, 5vw, 42px);
  color: #fff;
}

.store-hero p {
  color: rgba(255, 255, 255, 0.86);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.detail-media {
  min-height: 520px;
  border-radius: 24px;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.detail-copy {
  display: grid;
  align-content: center;
  gap: 16px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.price-row strong {
  font-size: 2.3rem;
}

.price-row small {
  color: var(--muted);
  text-decoration: line-through;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row button:nth-child(2),
.dashboard-sidebar button:not(:first-of-type) {
  color: var(--text);
  background: var(--surface-high);
}

.dashboard-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
}

.dashboard-content .section-title {
  margin-bottom: 16px;
}

.cart-layout {
  align-items: start;
}

.compact-heading {
  margin-bottom: 14px;
}

.checkout-card {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 14px;
}

.checkout-card strong {
  font-size: 2rem;
}

@media (max-width: 1080px) {
  .nav-links {
    display: none;
  }

  .auth-layout,
  .profile-layout,
  .detail-layout,
  .dashboard-layout,
  .cart-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-media {
    min-height: 340px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding-inline: 14px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .panel-search {
    grid-template-columns: 1fr;
  }

  .checkout-card {
    position: static;
  }
}
