@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,850&family=Nunito+Sans:wght@400;700;800;900&display=swap");

:root {
  --ink: #2a1718;
  --muted: #7e6464;
  --paper: #fff3eb;
  --surface: #ffffff;
  --line: #ecd0c7;
  --green: #8a9a54;
  --green-dark: #6f7e42;
  --gold: #d79a3a;
  --red: #a62138;
  --blue: #2b5f77;
  --pink: #c9476f;
  --clay: #bd3c4f;
  --cream: #fff1dc;
  --talavera: #2f6c89;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", Arial, Helvetica, sans-serif;
  --shadow: 0 16px 38px rgba(36, 28, 25, 0.12);
  --soft-shadow: 0 10px 24px rgba(36, 28, 25, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 96px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(201, 71, 111, 0.14), transparent 28rem),
    radial-gradient(circle at 92% 14%, rgba(215, 154, 58, 0.2), transparent 24rem),
    linear-gradient(180deg, #fff3eb, #fde5d8);
  font-family: var(--font-body);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(201, 71, 111, 0.1), transparent 35%),
    rgba(255, 243, 235, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  bottom: -1px;
  width: min(280px, 46vw);
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--red));
  border-radius: 999px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 850;
  letter-spacing: 0;
  color: var(--red);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--cream);
  border: 1px solid rgba(16, 60, 45, 0.14);
  box-shadow: 0 6px 18px rgba(16, 60, 45, 0.16);
}

.nav {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.nav a:hover,
.nav .active {
  color: var(--green-dark);
  background: rgba(31, 111, 85, 0.09);
}

.cart-link span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 4px;
  padding: 0 7px;
  color: white;
  background: var(--red);
  border-radius: 999px;
  font-size: 13px;
}

.hero {
  position: relative;
  min-height: min(680px, calc(100svh - 72px));
  display: grid;
  align-items: end;
  padding: clamp(42px, 5.5vw, 68px) clamp(18px, 6vw, 80px) clamp(62px, 6vw, 82px);
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 22%, rgba(215, 154, 58, 0.26), transparent 18rem),
    linear-gradient(90deg, rgba(74, 19, 26, 0.95) 0%, rgba(116, 31, 47, 0.78) 45%, rgba(42, 23, 24, 0.28)),
    url("assets/fonda-mexicana-hero.png") center right / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 10px;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--red), var(--pink));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  color: white;
}

.hero-content::before {
  content: "✿";
  position: absolute;
  top: -34px;
  left: -10px;
  color: rgba(255, 210, 122, 0.72);
  font-size: 32px;
  text-shadow: 30px 8px 0 rgba(255, 243, 235, 0.28), 60px -3px 0 rgba(201, 71, 111, 0.5);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  max-width: 700px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 12px 30px rgba(36, 28, 25, 0.26);
}

.hero-copy {
  max-width: 560px;
  margin: 16px 0 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(16px, 1.55vw, 19px);
}

.hero-proof {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.hero-proof span {
  padding: 8px 11px;
  color: #fff9ec;
  background: rgba(255, 243, 235, 0.15);
  border: 1px solid rgba(255, 246, 231, 0.22);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.service-ribbon {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(900px, 100%);
  margin-top: 28px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 243, 235, 0.92);
  border: 1px solid rgba(255, 243, 235, 0.52);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(16, 60, 45, 0.2);
  backdrop-filter: blur(14px);
}

.service-ribbon article {
  display: grid;
  gap: 2px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(232, 216, 195, 0.75);
  border-radius: 16px;
}

.service-ribbon article::before {
  content: "✿";
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
}

.service-ribbon strong {
  color: var(--red);
  font-size: 14px;
}

.service-ribbon span {
  color: var(--muted);
  font-size: 13px;
}

.hours-pill {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 8px 11px;
  color: var(--red);
  background: rgba(255, 241, 220, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(36, 28, 25, 0.18);
}

.hero-actions,
.page-title,
.product-actions,
.detail-actions,
.cart-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary,
.button.whatsapp {
  color: white;
  background: linear-gradient(135deg, var(--red), var(--pink));
  box-shadow: var(--shadow);
}

.button.primary:hover,
.button.whatsapp:hover {
  background: linear-gradient(135deg, #7e1727, var(--red));
}

.button.whatsapp {
  background: linear-gradient(135deg, #1f7a4d, var(--green-dark));
}

.button.secondary {
  color: var(--red);
  background: var(--cream);
  border-color: #d9cfbd;
}

.button.ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.button.danger {
  color: white;
  background: var(--red);
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.app-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(430px, calc(100% - 22px));
  padding: 7px;
  border: 1px solid rgba(31, 111, 85, 0.2);
  border-radius: 22px;
  background: rgba(255, 248, 236, 0.97);
  box-shadow: 0 18px 44px rgba(36, 28, 25, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.app-nav a {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 7px 8px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.app-nav a.active {
  color: white;
  background: linear-gradient(135deg, var(--red), var(--pink));
}

.app-nav-icon {
  position: relative;
  display: grid;
  place-items: center;
}

.app-nav svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav-badge {
  position: absolute;
  top: -7px;
  right: -12px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: white;
  background: var(--red);
  border: 2px solid var(--paper);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

.section {
  width: min(1180px, calc(100% - clamp(28px, 5vw, 64px)));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) 0;
}

.strip {
  position: relative;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 8% 8%, rgba(215, 154, 58, 0.2), transparent 13rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 230, 222, 0.82));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
}

.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.home-location {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(340px, 1.15fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(28px, 4vw, 44px);
}

.today-menu {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 14px;
  align-items: stretch;
}

.today-feature,
.today-list article {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.today-feature {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
  color: white;
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 218, 134, 0.28), transparent 12rem),
    linear-gradient(135deg, var(--red), var(--pink));
}

.today-feature .section-kicker {
  color: rgba(255, 241, 220, 0.9);
}

.today-feature h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1;
}

.today-feature p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.today-feature .button {
  width: max-content;
  background: var(--cream);
  color: var(--red);
}

.today-list {
  display: grid;
  gap: 10px;
}

.today-list article {
  display: grid;
  gap: 5px;
  padding: 15px 16px 15px 18px;
  background: rgba(255, 255, 255, 0.86);
}

.today-list article::before {
  content: "✿";
  position: absolute;
  top: 12px;
  right: 14px;
  color: rgba(201, 71, 111, 0.22);
  font-size: 26px;
}

.today-list span {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 850;
}

.today-list p {
  margin: 0;
  color: var(--muted);
}

.highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.highlights article,
.review-panel {
  position: relative;
  overflow: hidden;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.highlights article::before,
.review-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), var(--gold), var(--red));
}

.highlights h2,
.review-panel h2 {
  margin: 0 0 8px;
  color: var(--red);
  font-family: var(--font-display);
  line-height: 1.05;
  font-size: clamp(21px, 2.4vw, 30px);
}

.highlights p,
.review-panel p {
  margin: 0;
  color: var(--muted);
}

.review-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(circle at 90% 20%, rgba(29, 77, 119, 0.1), transparent 18rem),
    var(--surface);
}

.review-panel p:last-child {
  font-size: clamp(16px, 1.7vw, 20px);
  color: var(--ink);
}

.location-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.home-location h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 850;
  line-height: 1.02;
}

.home-location p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
}

.store-hours {
  margin-top: 10px;
  color: var(--clay);
  font-weight: 800;
}

.home-map {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-map iframe {
  display: block;
  width: 100%;
  height: clamp(300px, 42vw, 460px);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.page-title {
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title h1,
.strip h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: 0;
}

.page-title h1,
.home-location h2 {
  color: var(--red);
}

.page-title-small {
  margin-top: 30px;
  margin-bottom: 12px;
}

.page-title-small h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--green-dark);
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 16px;
  align-items: end;
  padding: 16px;
  margin-bottom: 22px;
  background:
    linear-gradient(90deg, rgba(31, 111, 85, 0.06), rgba(200, 63, 138, 0.05)),
    rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
}

label span,
legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(27, 107, 95, 0.18);
  border-color: var(--green);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fffdf8;
  cursor: pointer;
  font-weight: 800;
}

.chip.active {
  color: white;
  background: linear-gradient(135deg, var(--pink), #a83272);
  border-color: transparent;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
}

.product-card,
.cart-item,
.checkout-panel,
.history-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 4px solid rgba(201, 71, 111, 0.7);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(36, 28, 25, 0.11);
}

.product-card img,
.detail-media img,
.cart-item img {
  display: block;
  width: 100%;
  height: auto;
}

.product-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3eadb;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  flex: 1;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.price {
  font-weight: 900;
  color: var(--green-dark);
}

.product-card h2,
.detail-copy h1,
.checkout-panel h2,
.history-card h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.12;
}

.product-card p,
.detail-copy p,
.muted,
.history-card p {
  margin: 0;
  color: var(--muted);
}

.detail-view {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: clamp(24px, 5vw, 60px);
  align-items: start;
}

.detail-media {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.detail-copy {
  display: grid;
  gap: 18px;
  padding-top: 10px;
}

.detail-copy h1 {
  font-size: clamp(30px, 4.5vw, 50px);
}

.detail-quantity {
  display: grid;
  gap: 8px;
  width: max-content;
}

.quantity-input {
  grid-template-columns: 40px 68px 40px;
}

.quantity-input input {
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-weight: 900;
  appearance: textfield;
}

.quantity-input input:focus {
  outline: 3px solid rgba(27, 107, 95, 0.18);
  border-color: transparent;
}

.quantity-input input::-webkit-outer-spin-button,
.quantity-input input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--green-dark);
  font-weight: 800;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: start;
}

.cart-list {
  display: grid;
  gap: 8px;
  max-height: min(64vh, 680px);
  margin-bottom: 14px;
  padding-right: 3px;
  overflow-y: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
}

.cart-item img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f3eadb;
}

.cart-item-main {
  min-width: 0;
}

.cart-item h2 {
  margin: 0 0 2px;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cart-item-controls {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  align-items: center;
}

.cart-item-controls strong {
  min-width: 72px;
  color: var(--clay);
  font-size: 14px;
  text-align: right;
}

.quantity {
  display: inline-grid;
  grid-template-columns: 36px 42px 36px;
  align-items: center;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.quantity.compact {
  grid-template-columns: 30px 34px 30px;
}

.quantity button {
  width: 36px;
  height: 36px;
  border: 0;
  cursor: pointer;
  color: var(--green-dark);
  background: #edf5ee;
  font-size: 19px;
  font-weight: 900;
}

.quantity.compact button {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.quantity span {
  text-align: center;
  font-weight: 900;
}

.remove-icon {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #eccfcf;
  border-radius: 999px;
  color: var(--red);
  background: #fff7f5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.checkout-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  position: sticky;
  top: 92px;
  border-top: 4px solid rgba(31, 111, 85, 0.55);
}

.field-group {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.location-options {
  display: grid;
  gap: 10px;
}

.payment-code-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 244, 220, 0.66);
}

.payment-code-panel[hidden] {
  display: none;
}

.location-method {
  display: grid;
  gap: 8px;
}

.location-method-body {
  display: none;
  gap: 8px;
}

.location-method.active .location-method-body {
  display: grid;
}

.location-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 244, 220, 0.68);
}

.location-method.active .location-option {
  border-color: rgba(31, 111, 85, 0.42);
  background: rgba(31, 111, 85, 0.09);
}

.location-option input {
  width: auto;
}

.location-option span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #6b7a76);
}

.button.remove {
  color: var(--red);
  background: #fdf1f1;
  border-color: #eccfcf;
  margin-top: 4px;
}

.button.remove:hover {
  background: #fbe4e4;
}

#pickupPanel[hidden],
#deliveryPanel[hidden] {
  display: none;
}

.pickup-card {
  display: grid;
  gap: 10px;
}

.pickup-card iframe {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  border: 0;
  display: block;
}

.pickup-address {
  margin: 0;
  font-weight: 700;
  color: var(--ink, #16302b);
}

.map-preview {
  display: none;
}

.map-preview.show {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line, #d9e2df);
  border-radius: 14px;
  background: rgba(31, 111, 85, 0.06);
}

.map-preview strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand, #1b6b5f);
}

.map-preview a {
  font-size: 14px;
  color: var(--brand, #1b6b5f);
  word-break: break-all;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(36, 28, 25, 0.58);
}

.map-modal.open {
  display: flex;
}

.map-modal-body {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(12, 32, 29, 0.35);
}

.map-modal-body h2 {
  margin: 0;
  font-size: 20px;
}

.map-style-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line, #d9e2df);
  border-radius: 999px;
  background: rgba(31, 111, 85, 0.06);
}

.map-style-switch button {
  padding: 9px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #16302b);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.map-style-switch button.active {
  background: var(--brand, #1b6b5f);
  color: #fff7e8;
}

#mapPicker {
  width: 100%;
  height: 46vh;
  min-height: 260px;
  border-radius: 14px;
  overflow: hidden;
}

.map-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.map-modal-actions .button {
  width: 100%;
}

.loading-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(42, 23, 24, 0.54);
  backdrop-filter: blur(8px);
}

.loading-modal.show {
  display: grid;
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(320px, 100%);
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card strong {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 22px;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(201, 71, 111, 0.18);
  border-top-color: var(--red);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.radio-row input {
  width: auto;
}

.radio-row span {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  font-family: var(--font-display);
  color: var(--green-dark);
}

.history-list {
  display: grid;
  gap: 8px;
}

.current-orders {
  display: grid;
  gap: 12px;
}

.current-order-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background:
    radial-gradient(circle at top left, rgba(217, 165, 51, 0.18), transparent 16rem),
    var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid rgba(31, 111, 85, 0.62);
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
}

.current-order-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.current-order-head h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--green-dark);
}

.current-order-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.current-order-head strong {
  color: var(--clay);
  font-size: 20px;
}

.status-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-timeline li {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.status-timeline li span {
  height: 8px;
  border-radius: 999px;
  background: #eadfce;
}

.status-timeline li.done span,
.status-timeline li.current span {
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.status-timeline li.current {
  color: var(--green-dark);
}

.current-order-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.current-order-grid span {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(31, 111, 85, 0.08);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.history-card {
  padding: 0;
  overflow: hidden;
}

.history-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(90deg, rgba(255, 244, 220, 0.6), rgba(255, 255, 255, 0));
}

.history-card summary::-webkit-details-marker {
  display: none;
}

.history-card summary span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.history-card summary small,
.history-card summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.history-card summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-total {
  color: var(--clay);
  font-weight: 900;
}

.history-detail {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.history-detail p {
  margin: 10px 0 0;
  color: var(--muted);
}

.history-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.history-card li strong {
  color: var(--clay);
}

.location-display {
  display: grid;
  gap: 4px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.location-display a {
  width: max-content;
  max-width: 100%;
  color: var(--green-dark);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.panel-board {
  display: grid;
  gap: 24px;
}

.local-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.local-stats article,
.report-stats article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.local-stats span,
.report-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.local-stats strong,
.report-stats strong {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.local-stats small,
.report-stats small {
  color: var(--clay);
  font-weight: 800;
}

.work-queue {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.work-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.work-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid rgba(31, 111, 85, 0.54);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.work-card h3 {
  margin: 2px 0;
}

.work-card small,
.work-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-section {
  display: grid;
  gap: 12px;
}

.panel-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(31, 111, 85, 0.09), rgba(200, 63, 138, 0.06)),
    var(--surface);
  box-shadow: var(--soft-shadow);
}

.panel-section-title h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--green-dark);
}

.panel-section-title span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  color: white;
  background: var(--green);
  border-radius: 999px;
  font-weight: 900;
}

.panel-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 340px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.panel-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--soft-shadow);
}

.panel-column-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-column-title h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--green-dark);
  font-size: 20px;
}

.panel-column-title span {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  color: white;
  background: var(--pink);
  border-radius: 999px;
  font-weight: 900;
}

.local-order-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.local-order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.local-order-head h3 {
  margin: 2px 0;
}

.local-order-head small,
.local-order-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.local-order-card ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
}

.local-order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.local-order-actions span {
  color: var(--green-dark);
  font-weight: 900;
}

.local-history-panel {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.calendar-card,
.day-report {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.calendar-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-controls h3 {
  margin: 0;
  color: var(--green-dark);
  font-family: var(--font-display);
  text-align: center;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-grid > strong {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-grid button,
.calendar-empty {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
}

.calendar-grid button {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 8px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.calendar-grid button span {
  font-weight: 900;
}

.calendar-grid button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.calendar-grid button.has-orders {
  border-color: rgba(31, 111, 85, 0.42);
  background: rgba(31, 111, 85, 0.08);
}

.calendar-grid button.selected {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--pink));
}

.calendar-grid button.selected small {
  color: rgba(255, 255, 255, 0.84);
}

.day-report {
  display: grid;
  gap: 12px;
}

.day-report-head h3 {
  margin: 0;
  color: var(--green-dark);
  font-family: var(--font-display);
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.report-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.report-order-row:last-child {
  border-bottom: 0;
}

.report-order-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.report-order-row span,
.report-order-row small {
  color: var(--muted);
  font-size: 12px;
}

.report-order-row b {
  color: var(--clay);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fffdf8;
  border: 1px dashed #d8cdbd;
  border-radius: 16px;
}

.toast {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 120;
  width: max-content;
  max-width: min(440px, calc(100% - 28px));
  padding: 13px 16px;
  color: white;
  background: linear-gradient(135deg, var(--red), var(--pink));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(42, 23, 24, 0.28);
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  text-align: center;
  font-weight: 900;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.internal-topbar {
  gap: 12px;
  flex-wrap: wrap;
}

.internal-topbar .nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.internal-topbar .session-chip {
  display: grid;
  gap: 1px;
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-align: right;
}

.internal-topbar .session-chip strong {
  font-size: 13px;
}

.internal-topbar .session-chip span {
  color: var(--clay);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-section {
  max-width: 720px;
  margin-inline: auto;
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.role-card {
  display: grid;
  gap: 6px;
  padding: 16px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.role-card:hover {
  transform: translateY(-2px);
}

.role-card strong {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 17px;
}

.role-card span {
  color: var(--muted);
  font-size: 12px;
}

.role-card.active {
  border-color: var(--green);
  background: #e7f2ed;
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-error {
  min-height: 18px;
  color: var(--clay);
  font-weight: 800;
  font-size: 13px;
}

.login-back {
  margin-top: 16px;
  text-align: center;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-family: var(--font-display);
  font-size: 20px;
}

.orders-layout {
  margin-top: 16px;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.internal-order {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.internal-order header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.internal-order header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.internal-order header h3 {
  margin: 2px 0;
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 20px;
}

.internal-order header p {
  color: var(--muted);
  font-size: 12px;
}

.order-total {
  color: var(--clay);
  font-family: var(--font-display);
  font-size: 22px;
  white-space: nowrap;
}

.internal-order-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.tone-nuevo {
  color: #5a4a3a;
  background: #f0e6d8;
}

.tone-aceptado {
  color: #1c5a7e;
  background: #dceaf5;
}

.tone-alistando {
  color: #8a6410;
  background: #fdf0cd;
}

.tone-listo {
  color: #4a3c86;
  background: #e6e1f7;
}

.tone-asignado {
  color: #0f5f52;
  background: #d5ece5;
}

.tone-recogido {
  color: #7a4b12;
  background: #fbe6cd;
}

.tone-en-camino {
  color: #1c5a7e;
  background: #d2e6f7;
}

.tone-entregado {
  color: #2c6a34;
  background: #d8f0dc;
}

.tone-cancelado {
  color: #8f2f2f;
  background: #f8dede;
}

.driver-tag {
  padding: 5px 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.internal-items {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf6ef;
  font-size: 13px;
  list-style: none;
}

.internal-items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.location-display-wrap {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.problem-box {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #eccfcf;
  border-radius: 12px;
  background: #fdf1f1;
  color: #8f2f2f;
  font-size: 13px;
}

.problem-box ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.problem-box span {
  color: var(--muted);
  font-size: 11px;
}

.inline-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.inline-field select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
}

.internal-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.internal-order-actions .button {
  margin-top: 0;
}

.route-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: #faf6ef;
  font-size: 13px;
}

.route-box p {
  margin: 0;
}

.code-hint {
  color: var(--muted);
  font-size: 12px;
}

.driver-totals {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.driver-totals small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.driver-offers {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border: 2px dashed var(--gold);
  border-radius: 18px;
  background: #fffaf0;
}

.driver-offers h2 {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 18px;
}

.driver-offers .driver-order {
  background: var(--surface);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi strong {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.kpi small {
  color: var(--clay);
  font-weight: 800;
}

.admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.admin-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.admin-card h2 {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 18px;
}

.admin-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.admin-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.admin-list span {
  color: var(--muted);
  font-size: 12px;
}

.whatsapp-order {
  border-color: #cfe6d8;
  background: linear-gradient(180deg, #f4fbf6 0%, var(--surface) 60%);
}

.whatsapp-order .current-order-head h2 {
  color: #16803e;
}

.whatsapp-order-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: #eaf7ee;
  color: #14663a;
  font-size: 13px;
  font-weight: 700;
}

.whatsapp-order-items {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #faf6ef;
  font-size: 14px;
  list-style: none;
}

.whatsapp-order-items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.whatsapp-order-foot {
  display: grid;
  gap: 8px;
}

.whatsapp-order-foot .muted {
  text-align: center;
  font-size: 12px;
}

.client-code {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 16px;
  border: 2px dashed var(--gold);
  border-radius: 16px;
  background: #fffaf0;
  text-align: center;
}

.client-code span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-code strong {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.18em;
}

.client-code small {
  color: var(--clay);
  font-weight: 700;
}

.panel-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-dialog::backdrop {
  background: rgba(24, 33, 31, 0.45);
}

.panel-dialog form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.panel-dialog h2 {
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 20px;
}

.panel-dialog textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 820px) {
  .role-picker {
    grid-template-columns: 1fr;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .internal-topbar .session-chip {
    display: none;
  }

  .internal-order-actions .button {
    flex: 1 1 auto;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    min-height: auto;
    padding: 10px 14px;
  }

  .nav {
    justify-content: flex-end;
    gap: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: auto;
    padding: 34px clamp(14px, 4vw, 24px) 76px;
  }

  .hero-bg {
    background:
      linear-gradient(180deg, rgba(92, 24, 36, 0.94), rgba(42, 23, 24, 0.36)),
      url("assets/fonda-mexicana-hero.png") center / cover no-repeat;
  }

  .service-ribbon {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 20px;
  }

  .section {
    width: min(100% - 24px, 1180px);
    padding: 28px 0;
  }

  .page-title {
    margin-bottom: 16px;
  }

  .catalog-tools {
    gap: 12px;
    padding: 12px;
    margin-bottom: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card img {
    aspect-ratio: 1.08 / 1;
  }

  .product-body {
    gap: 7px;
    padding: 10px;
  }

  .product-card h2 {
    font-size: 16px;
  }

  .product-card p {
    font-size: 13px;
  }

  .product-meta {
    align-items: flex-start;
    gap: 6px;
    flex-direction: column;
  }

  .category {
    font-size: 12px;
  }

  .catalog-tools,
  .detail-view,
  .cart-layout,
  .today-menu,
  .home-location,
  .strip,
  .review-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-map iframe {
    height: clamp(280px, 58vw, 390px);
  }

  .checkout-panel {
    position: static;
  }

  .local-stats,
  .report-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-controls {
    grid-template-columns: 1fr;
  }

  .status-timeline {
    grid-template-columns: repeat(4, 1fr);
  }

  .current-order-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: 86px;
  }

  .toast {
    top: calc(10px + env(safe-area-inset-top));
    width: calc(100% - 20px);
    max-width: none;
    padding: 12px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.25;
  }

  .topbar {
    padding: 9px 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .brand span:last-child {
    font-size: 14px;
  }

  .nav {
    width: 100%;
    gap: 4px;
    justify-content: space-between;
  }

  .nav a {
    flex: 1;
    padding: 7px 6px;
    font-size: 12px;
    text-align: center;
  }

  .cart-link span {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
  }

  .app-nav {
    bottom: 0;
    width: 100%;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .app-nav a {
    min-height: 54px;
    padding: 6px 5px;
    border-radius: 14px;
    font-size: 11px;
  }

  .app-nav svg {
    width: 21px;
    height: 21px;
  }

  .hero {
    padding: 26px 12px 72px;
  }

  .hero-bg {
    background:
      linear-gradient(180deg, rgba(92, 24, 36, 0.96), rgba(42, 23, 24, 0.4)),
      url("assets/fonda-mexicana-hero.png") center / cover no-repeat;
  }

  .hero h1 {
    font-size: clamp(29px, 8.8vw, 36px);
    line-height: 1;
  }

  .hero-copy {
    margin: 14px 0 18px;
    font-size: 15px;
  }

  .hero-actions,
  .location-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-proof span {
    flex: 1 1 auto;
    font-size: 12px;
    text-align: center;
  }

  .service-ribbon {
    padding: 8px;
    border-radius: 18px;
  }

  .service-ribbon article {
    padding: 10px;
  }

  .section {
    width: min(100% - 18px, 1180px);
    padding: 20px 0;
  }

  .page-title h1,
  .strip h2,
  .home-location h2 {
    font-size: 25px;
  }

  .highlights {
    grid-template-columns: 1fr;
  }

  .highlights article,
  .review-panel,
  .strip,
  .today-feature,
  .today-list article {
    padding: 16px;
    border-radius: 18px;
  }

  .today-feature .button {
    width: 100%;
  }

  .home-map iframe {
    height: 300px;
  }

  .catalog-tools {
    padding: 10px;
  }

  input,
  textarea {
    padding: 10px 11px;
  }

  .chip {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .product-actions,
  .detail-actions,
  .page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .product-actions {
    flex-direction: row;
    gap: 6px;
  }

  .product-actions .button {
    flex: 1;
    width: auto;
    padding-inline: 7px;
  }

  .detail-copy {
    gap: 12px;
  }

  .detail-copy h1 {
    font-size: 28px;
  }

  .detail-media img {
    max-height: 260px;
    object-fit: cover;
  }

  .cart-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .cart-item h2 {
    font-size: 14px;
  }

  .cart-item-controls {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .cart-item-controls strong {
    min-width: 0;
    text-align: center;
  }

  .cart-list {
    max-height: none;
    overflow: visible;
  }

  .checkout-panel,
  .history-card {
    padding: 12px;
  }

  .history-card {
    padding: 0;
  }

  .history-card summary {
    padding: 11px 12px;
  }

  .history-detail {
    padding: 0 12px 12px;
  }

  .checkout-total {
    font-size: 18px;
  }

  .current-order-head,
  .local-order-head,
  .local-order-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .status-timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-columns {
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .local-stats,
  .report-stats {
    grid-template-columns: 1fr;
  }

  .work-list {
    max-height: none;
    overflow: visible;
  }

  .work-card,
  .report-order-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-grid button,
  .calendar-empty {
    min-height: 52px;
    border-radius: 10px;
  }

  .calendar-grid button {
    padding: 6px;
  }

  .calendar-grid button small {
    font-size: 9px;
  }
}

.code-hint {
  padding: 10px 12px;
  color: var(--green-dark);
  background: rgba(31, 111, 85, 0.08);
  border: 1px solid rgba(31, 111, 85, 0.18);
  border-radius: 12px;
  font-weight: 800;
}

.problem-box strong + ul {
  margin-top: 6px;
}

.problem-box strong:not(:first-child) {
  display: block;
  margin-top: 10px;
}
