:root {
  --primary: #ff4d00;
  --secondary: #161616;
  --primary-soft: rgba(255, 77, 0, 0.12);
  --bg: #f6f3ef;
  --surface: #ffffff;
  --surface-strong: #fffaf5;
  --border: #e6ded5;
  --text: #1e1a16;
  --text2: #6f6259;
  --muted: #9b8d82;
  --success: #16784a;
  --danger: #b73e32;
  --shadow: 0 18px 44px rgba(36, 24, 12, 0.12);
  --radius: 8px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.store-header {
  background: var(--secondary);
  color: #fff;
}

.store-cover {
  width: min(1160px, calc(100% - 32px));
  min-height: 250px;
  margin: 0 auto;
  padding: 34px 0 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.store-info {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.store-logo {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  background: var(--primary);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.store-logo.has-image {
  background: none;
}

.store-logo img {
  width: 100%;
  height: 100%;
}

.store-copy {
  min-width: 0;
}

.store-kicker {
  color: color-mix(in srgb, var(--primary), white 36%);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.store-copy h1 {
  margin: 4px 0 8px;
  max-width: 760px;
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 5vw, 4.1rem);
  line-height: 0.95;
}

.store-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.5;
}

.store-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.status-badge,
.address-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: #fff;
  font-size: 0.9rem;
}

.status-badge.open {
  background: rgba(22, 120, 74, 0.18);
  border-color: rgba(108, 218, 159, 0.36);
}

.status-badge.closed {
  background: rgba(183, 62, 50, 0.2);
  border-color: rgba(255, 148, 136, 0.4);
}

.status-badge.loading {
  color: rgba(255, 255, 255, 0.76);
}

.store-social-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.store-social-links [hidden] {
  display: none;
}

.whatsapp-link,
.instagram-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 10px 16px;
  background: #25d366;
  color: #0d331c;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.instagram-link {
  background: #c13584;
  color: #fff;
}

.store-layout {
  width: min(1160px, calc(100% - 32px));
  margin: -24px auto 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.menu-column,
.cart-panel,
.closed-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.menu-column {
  min-width: 0;
  overflow: hidden;
}

.closed-panel {
  margin: 16px;
  padding: 18px;
  box-shadow: none;
  background: var(--surface-strong);
}

.closed-panel h2 {
  margin: 0 0 4px;
  font-family: "Syne", sans-serif;
  font-size: 1.35rem;
}

.closed-panel p {
  margin: 0 0 14px;
  color: var(--text2);
}

.hours-list {
  display: grid;
  gap: 8px;
}

.hour-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  color: var(--text2);
  font-size: 0.92rem;
}

.hour-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hour-row strong {
  color: var(--text);
}

.category-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.category-tab {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text2);
  padding: 6px 12px;
  white-space: nowrap;
}

.category-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.products-list {
  display: grid;
  gap: 2px;
}

.product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.product-card:last-child {
  border-bottom: 0;
}

.products-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  color: var(--text2);
  font-size: 0.92rem;
}

.pagination-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 700;
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.product-img,
.product-placeholder {
  width: 112px;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-strong);
}

.product-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.6rem;
}

.product-info {
  min-width: 0;
}

.product-info h3 {
  margin: 0 0 6px;
  font-size: 1.04rem;
}

.product-info p {
  margin: 0 0 10px;
  color: var(--text2);
  line-height: 1.45;
}

.product-price {
  color: var(--text);
  font-weight: 800;
}

.product-price-promo {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

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

.old-price {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: line-through;
}

.price-row strong {
  color: var(--text);
  font-size: 1rem;
}

.add-button,
.checkout-button,
.quantity-button,
.modal-add-button {
  border: 0;
  border-radius: var(--radius);
}

.add-button {
  min-height: 40px;
  padding: 8px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.cart-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.cart-header,
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-header h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.3rem;
}

.cart-header span {
  color: var(--text2);
  font-size: 0.88rem;
}

.cart-items {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  max-height: 36vh;
  overflow-y: auto;
}

.empty-cart,
.loading-state,
.error-state {
  padding: 34px 14px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.empty-cart i {
  font-size: 1.8rem;
}

.cart-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cart-item-title {
  font-weight: 700;
}

.cart-item-detail {
  color: var(--text2);
  font-size: 0.86rem;
  line-height: 1.4;
}

.quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quantity-button {
  width: 30px;
  height: 30px;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

.order-options,
.envio-options {
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.option-title {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.delivery-switch,
.retiro-envio-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.retiro-envio-switch.single-option {
  grid-template-columns: 1fr;
}

.delivery-switch label,
.retiro-envio-switch label {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--text2);
  font-size: 0.88rem;
}

.delivery-switch input,
.retiro-envio-switch input {
  accent-color: var(--primary);
}

.scheduled-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  resize: vertical;
}

.form-control:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.cart-breakdown {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.cart-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-breakdown-row strong {
  color: var(--text);
  font-weight: 600;
}

.cart-total {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
  font-size: 1.05rem;
}

.cart-total strong {
  font-size: 1.28rem;
}

.checkout-button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.checkout-hint {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

body:has(.modal-overlay:not([hidden])) {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(18, 14, 10, 0.58);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 120px));
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.close-wrapper {
  position: sticky;
  height: 0;
  top: 0;
  text-align: right;
}

.modal-close {
  transform: translate3d(-8px, 8px, 0px);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.modal-body {
  overflow-y: auto;
  padding: 0px;
  margin: 0px;
}

.modal-product-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  background: var(--surface-strong);
  display: block;
}

.modal-content {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.modal-content h2 {
  margin: 0 38px 0 0;
  font-family: "Syne", sans-serif;
}

.modal-content p {
  margin: 0;
  color: var(--text2);
}

.extras-list {
  display: grid;
  gap: 8px;
}

.extra-group {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.extra-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.extra-group-heading small,
.extra-description {
  color: var(--text2);
  font-size: 0.78rem;
}

.extra-description {
  display: block;
  margin: 3px 0 0 22px;
}

.extra-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.extra-option input {
  accent-color: var(--primary);
}

.extra-option input:disabled {
  cursor: not-allowed;
}

.modal-add-button {
  min-height: 48px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  transform: translateX(-50%);
  border-radius: var(--radius);
  background: var(--secondary);
  color: #fff;
  padding: 11px 16px;
  box-shadow: var(--shadow);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

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

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

@media (max-width: 900px) {
  .store-cover {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 28px 0 44px;
  }

  .store-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .store-cover,
  .store-layout {
    width: min(100% - 20px, 1160px);
  }

  .store-info {
    align-items: flex-start;
  }

  .store-logo {
    width: 70px;
    height: 70px;
    padding-top: 10px;
    font-size: 1.5rem;
  }

  .product-card {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  .product-img,
  .product-placeholder {
    width: 82px;
  }

  .add-button {
    grid-column: 2;
    width: 100%;
  }

  .products-pagination {
    flex-wrap: wrap;
  }

  .delivery-switch {
    grid-template-columns: 1fr;
  }

  .scheduled-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .products-pagination {
    padding: 10px 0px 10px 0px;
  }

  .store-info {
    gap: 8px;
  }
}
