:root {
  --primary: #ff4d00;
  --secondary: #161616;
  --primary-soft: rgba(255, 77, 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, .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: 76px;
  height: 76px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

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

.store-kicker {
  color: color-mix(in srgb, var(--primary), white 36%);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .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: .95;
}

.store-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, .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,.2);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: #fff;
  font-size: .9rem;
}

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

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

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

.whatsapp-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;
}

.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: .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, .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;
}

.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;
}

.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: .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: .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 {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

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

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

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

.delivery-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-total {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
  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: .55;
}

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

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

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

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

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  color: var(--text);
}

.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-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);
}

.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 .75s linear infinite;
}

.is-hidden {
  display: none;
}

@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: 58px;
    height: 58px;
    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%;
  }

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

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