:root {
  --bg: #f8f8f6;
  --surface: #ffffff;
  --surface-muted: #f5f4f1;
  --text: #1f2430;
  --text-muted: #626b78;
  --brand: #a56a2b;
  --brand-strong: #7f4f1f;
  --danger: #b83232;
  --radius: 16px;
  --shadow: 0 10px 26px rgba(26, 31, 41, 0.08);
  --container: min(1120px, 92vw);
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-heading: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--brand) 14%, #fff), transparent 50%),
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.9), transparent 35%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 999;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 10px;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-strong);
  font-weight: 700;
}

.app-loading.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.app-loading__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid color-mix(in srgb, var(--brand) 20%, #fff);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

.hero {
  position: relative;
  padding: 24px 0 16px;
  overflow: hidden;
  background: linear-gradient(130deg, color-mix(in srgb, var(--brand) 9%, #fff) 0%, #fff 70%);
  color: var(--text);
  border-bottom: 1px solid #e8e7e2;
}

.hero--with-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.hero__identity {
  display: grid;
  gap: 6px;
}

.hero__logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #ecebe6;
  background: #fff;
}

.hero__badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 0.78rem;
}

.hero h1 {
  font-family: var(--font-heading);
  margin: 8px 0 2px;
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  line-height: 1.15;
}

.hero p {
  max-width: 54ch;
  margin: 0;
}

.hero__status {
  min-width: 170px;
  background: #fff;
  border: 1px solid #eceae5;
  border-radius: 12px;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(15, 22, 34, 0.06);
}

.hero__status-indicator {
  margin: 0;
  font-weight: 800;
  color: #a03232;
}

.hero__status-indicator.is-open {
  color: #26783f;
}

.hero__status-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.hero-cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #ddd9cf;
  background: #fff;
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-cart-btn.is-pulse {
  animation: cart-bump 0.42s ease;
}

.hero-cart-btn svg {
  width: 20px;
  height: 20px;
}

.hero-cart-btn__count {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-strong);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 18px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--brand-strong);
  color: #fff;
}

.toolbar {
  margin: 10px auto 14px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.cart-banner {
  display: grid;
  gap: 10px;
  background: var(--surface);
  border: 1px solid #ecebe6;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(18, 24, 35, 0.05);
}

.cart-banner__status {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.cart-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar__field {
  display: grid;
  gap: 0;
}

.toolbar__field--full {
  grid-column: 1 / -1;
}

.toolbar label {
  font-size: 0.88rem;
  font-weight: 700;
}

.toolbar__label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  border: 1px solid #d8d6cf;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  min-height: 34px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.category-chip.is-active {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dddcd5;
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 45%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, #fff);
}

.hours-section {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.hours-card {
  background: #f9f4e8;
  border: 1px solid #eadcc0;
  border-radius: 16px;
  padding: 16px;
  color: #533a1b;
}

.hours-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
}

.hours-now-label {
  margin: 6px 0 2px;
  color: #7f674b;
  font-weight: 700;
}

.hours-current-time {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.hours-current-date {
  margin: 0 0 10px;
  color: #7f674b;
}

.hours-open-status {
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #6a5a31;
}

.hours-open-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d3932d;
}

.hours-open-status.is-open::before {
  background: #2ca74f;
}

.hours-open-status.is-closed::before {
  background: #bf3b30;
}

.hours-open-status.is-break::before {
  background: #d3932d;
}

.hours-table {
  border-top: 1px solid #dfcda0;
}

.hours-row {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid #dfcda0;
  padding: 10px 0;
}

.hours-row strong {
  font-size: 1.08rem;
}

.hours-row span {
  color: #664f36;
}

.catalog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.catalog-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.status-message {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 42px;
}

.product-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid #ecebe6;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: 200px auto;
  animation: enter 0.35s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.product-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 65%, #fff);
  outline-offset: 2px;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(18, 24, 35, 0.12);
}

.product-card.is-in-cart {
  border-color: color-mix(in srgb, var(--brand) 35%, #ecebe6);
}

.product-card.is-just-added {
  animation: pulse-added 0.85s ease;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-muted);
}

.product-card__body {
  padding: 14px;
  display: grid;
  gap: 9px;
}

.product-card h3 {
  margin: 0;
  font-size: 1.04rem;
}

.product-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

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

.price__current {
  font-weight: 800;
  color: var(--brand-strong);
}

.price__old {
  color: #7a8892;
  text-decoration: line-through;
  font-size: 0.85rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--brand) 15%, #fff);
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 700;
}

.product-actions {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.product-actions .btn {
  font-size: 0.86rem;
  padding: 9px 10px;
}

.btn--icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.btn--icon svg {
  width: 18px;
  height: 18px;
}

.btn--icon.is-in-cart {
  background: color-mix(in srgb, var(--brand) 16%, #fff);
  border-color: color-mix(in srgb, var(--brand) 40%, #d8d6cf);
  color: var(--brand-strong);
}

.dialog-buy {
  display: grid;
  grid-template-columns: auto 90px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.dialog-buy label {
  font-weight: 700;
  color: var(--text);
}

.dialog-buy__note-label,
#dialogNote,
.dialog-buy .btn {
  grid-column: 1 / -1;
}

#dialogNote {
  border-radius: 12px;
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
}

.dialog-buy .qty-input {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn--outline {
  border: 1px solid #d8d6cf;
  color: var(--text);
  background: #fff;
}

.btn--whatsapp {
  background: #13a561;
  color: #fff;
}

.footer {
  border-top: 1px solid #dce4e2;
  margin-top: 26px;
  padding: 16px 0 26px;
  color: var(--text-muted);
}

.product-dialog {
  width: min(720px, 94vw);
  border: 0;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 44px rgba(14, 18, 28, 0.22);
}

.product-dialog::backdrop {
  background: rgba(8, 20, 20, 0.65);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1.4rem;
  background: var(--surface-muted);
  cursor: pointer;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.cart-item {
  border: 1px solid #ecebe6;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: #fffdfa;
}

.cart-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cart-item__name {
  margin: 0;
  font-weight: 700;
}

.cart-item__price {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cart-item__note-field {
  display: grid;
  gap: 4px;
}

.cart-item__note-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.cart-note-input {
  border-radius: 10px;
  min-height: 62px;
  padding: 8px 10px;
  resize: vertical;
}

.cart-item__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  background: #f8f6f1;
  border: 1px solid #ece8dc;
  border-radius: 10px;
  padding: 6px 8px;
}

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

.qty-input {
  width: 78px;
  min-height: 34px;
  padding: 6px 8px;
}

.btn--danger {
  background: #fff0ef;
  color: #8e2f2f;
  border: 1px solid #eecbca;
}

.cart-footer {
  border-top: 1px solid #ecebe6;
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cart-total {
  margin: 0;
  font-weight: 800;
  color: var(--brand-strong);
}

.cart-empty {
  margin: 0;
  color: var(--text-muted);
}

@keyframes enter {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-added {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 28%, transparent);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes cart-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

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

  .hours-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero__content {
    flex-direction: column;
  }

  .hero__status {
    width: 100%;
  }

  .hero-cart-btn {
    align-self: flex-end;
  }

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

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

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

  .cart-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 580px) {
  .hero {
    padding: 16px 0 12px;
  }

  .toolbar {
    margin-top: 8px;
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea {
    min-height: 38px;
  }

  .category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .category-chip {
    flex: 0 0 auto;
  }

  .dialog-buy {
    grid-template-columns: 1fr;
  }

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

  .hours-current-time {
    font-size: 1.6rem;
  }
}
