/* MACHI AREPAS — pedidos, carrito, checkout */

.app-body {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

.app-shell {
  min-height: 100vh;
}

.app-view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.back-sede {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--yellow, #e2f706);
  text-decoration: none;
}

.back-sede:hover {
  text-decoration: underline;
}

.header--compact {
  margin-bottom: 1.5rem;
}

.header--compact .logo-img {
  width: min(240px, 70vw);
}

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.08em;
  color: var(--yellow);
  margin-bottom: 1.25rem;
}

.container--narrow {
  max-width: 520px;
}

/* Botón añadir en menú */
.btn-add {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #111;
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(226, 247, 6, 0.3);
}

.link-add {
  font: inherit;
  font-weight: 600;
  color: var(--yellow);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.link-add:hover {
  text-decoration: underline;
}

.info-list-plain li {
  justify-content: flex-start;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(226, 247, 6, 0.12);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.bottom-nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.65rem 0.5rem;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.bottom-nav__btn.active {
  color: var(--yellow);
}

.bottom-nav__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.cart-badge {
  position: absolute;
  top: 0.35rem;
  right: calc(50% - 1.5rem);
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  color: #111;
  background: var(--yellow);
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
  margin-top: 0.75rem;
}

.btn-lg {
  padding: 1rem 1.25rem;
  font-size: 1rem;
}

.btn-primary {
  color: #111;
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

/* Carrito */
.cart-lines {
  list-style: none;
  margin-bottom: 1rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-line__main strong {
  display: block;
  color: var(--yellow);
}

.cart-line__note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.cart-line__price {
  font-weight: 700;
  margin-top: 0.35rem;
}

.tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  margin-left: 0.35rem;
  background: rgba(226, 247, 6, 0.15);
  color: var(--yellow);
  border-radius: 4px;
  vertical-align: middle;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.25rem;
}

.qty-btn {
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.cart-line__remove {
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

.cart-line__remove:hover {
  color: var(--red);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

/* Checkout */
.order-type-field,
.form-block {
  margin-bottom: 1.25rem;
  border: none;
}

.order-type-field legend,
.form-block legend {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.chip-radio {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.chip-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-radio span {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, border-color 0.2s;
}

.chip-radio input:checked + span {
  background: rgba(226, 247, 6, 0.15);
  border-color: var(--yellow);
  color: var(--yellow);
}

.pay-badge {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-hint {
  font-size: 0.75rem;
  margin: 0.35rem 0 0;
}

.form-block label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.form-block input,
.form-block textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.form-block input:focus,
.form-block textarea:focus {
  outline: none;
  border-color: var(--yellow);
}

.delivery-address-wrap {
  width: 100%;
}

.delivery-address-wrap gmp-place-autocomplete,
.delivery-address-ac {
  display: block;
  width: 100%;
  color-scheme: dark;
}

.delivery-map {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  margin: 0.75rem 0;
  border: 1px solid rgba(226, 247, 6, 0.2);
}

.map-toolbar {
  margin-bottom: 0.5rem;
}

.delivery-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.delivery-stats div {
  background: var(--bg-card);
  border: 1px solid rgba(226, 247, 6, 0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.delivery-stats span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
}

.delivery-stats strong {
  font-size: 1.1rem;
  color: var(--yellow);
}

.alert {
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-warn {
  background: rgba(226, 247, 6, 0.1);
  border: 1px solid rgba(226, 247, 6, 0.25);
  color: var(--yellow);
}

.alert-warn code {
  font-size: 0.8em;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.alert-error {
  background: rgba(196, 30, 42, 0.2);
  border: 1px solid var(--red);
  color: #ffb4b4;
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(226, 247, 6, 0.12);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.checkout-summary h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--yellow);
  margin-bottom: 0.75rem;
}

.checkout-preview {
  list-style: none;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout-preview li {
  padding: 0.2rem 0;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}

.checkout-row--total {
  font-size: 1.15rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(226, 247, 6, 0.2);
}

.checkout-row--total strong {
  color: var(--yellow);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: #141414;
  border: 1px solid rgba(226, 247, 6, 0.2);
  border-radius: 16px 16px 12px 12px;
  padding: 1.5rem;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

.modal__panel h2 {
  font-size: 1.25rem;
  color: var(--yellow);
  padding-right: 2rem;
}

.modal__price {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  margin: 0.25rem 0;
}

.modal__desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.modal-options {
  margin-bottom: 1rem;
}

.option-group {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.option-group__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--yellow);
  margin-bottom: 0.5rem;
}

.modal-options .chip-radio {
  margin-bottom: 0.35rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal__actions .btn {
  flex: 1;
}

/* Success */
.success-panel {
  text-align: center;
  padding-top: 3rem;
}

.success-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  font-size: 2rem;
  line-height: 4rem;
  color: #111;
  background: var(--yellow);
  border-radius: 50%;
}

.order-id {
  color: var(--muted);
  margin: 1rem 0 1.5rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 3000;
  max-width: 90vw;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  background: var(--yellow);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .modal {
    align-items: center;
  }

  .modal__panel {
    border-radius: 16px;
  }

  .bottom-nav {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
  }
}
