* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fb;
  --surface: #fff;
  --line: rgba(15, 23, 42, 0.1);
  --line-soft: rgba(15, 23, 42, 0.06);
  --text: #111827;
  --strong: #0f172a;
  --muted: #64748b;
  --red: #6b21a8;
  --red-dark: #4a1a6b;
  --green: #16a34a;
  --amber: #d97706;
  --blue: #2563eb;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(107, 33, 168, 0.06),
      transparent 30%
    ),
    linear-gradient(180deg, #fff 0%, #f5f7fb 52%, #eef2f7 100%);
  color: var(--text);
}

.orders-navbar {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 14px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 16px 36px rgba(107, 33, 168, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 14px;
  z-index: 50;
}

.brand img {
  width: 132px;
  max-height: 42px;
  object-fit: contain;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-actions a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  padding: 10px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-actions a.active,
.nav-actions a:hover,
.contact-icon {
  background: rgba(255, 255, 255, 0.16);
}

.contact-icon {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
}

.orders-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 50px;
}

.orders-hero {
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(107, 33, 168, 0.1);
  color: var(--red);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orders-hero h1 {
  margin: 8px 0 0;
  color: var(--red);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.95;
  font-weight: 1000;
}

.orders-hero p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-weight: 800;
}

.search-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

.search-card i {
  padding-left: 8px;
  color: var(--red);
  font-size: 24px;
}

.search-card input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  color: var(--strong);
}

.search-card button,
.action-btn {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 1000;
}

.search-card button {
  padding: 13px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
}

.orders-status {
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  font-weight: 800;
  text-align: center;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.order-ticket {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.order-ticket::before,
.order-ticket::after {
  content: "";
  position: absolute;
  top: 132px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  z-index: 2;
}

.order-ticket::before {
  left: -14px;
}

.order-ticket::after {
  right: -14px;
}

.ticket-head {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(107, 33, 168, 0.08), transparent 54%), #fff;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.18);
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.ticket-folio {
  margin: 0;
  color: var(--strong);
  font-size: 22px;
  font-weight: 1000;
}

.ticket-event {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.pendiente {
  color: var(--amber);
  background: rgba(217, 119, 6, 0.12);
}

.badge.pagado,
.badge.entregado {
  color: var(--green);
  background: rgba(22, 163, 74, 0.12);
}

.badge.cancelado {
  color: var(--red);
  background: rgba(107, 33, 168, 0.1);
}

.badge.preparacion {
  color: var(--blue);
  background: rgba(37, 99, 235, 0.12);
}

.ticket-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.meta-item {
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-item strong {
  display: block;
  margin-top: 4px;
  color: var(--strong);
  font-size: 14px;
  font-weight: 1000;
}

.ticket-body {
  padding: 20px;
}

.ticket-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--strong);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-section-title::before,
.ticket-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  border-top: 1px dashed rgba(15, 23, 42, 0.18);
}

.command-list {
  display: grid;
  gap: 10px;
}

.command-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  font-size: 14px;
}

.command-qty {
  color: var(--red);
  font-weight: 1000;
}

.command-name {
  color: var(--strong);
  font-weight: 900;
}

.command-price {
  color: var(--strong);
  font-weight: 1000;
}

.package-detail {
  grid-column: 2 / -1;
  display: grid;
  gap: 4px;
  margin-top: -4px;
  padding-left: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border-left: 2px solid rgba(107, 33, 168, 0.18);
}

.ticket-notes {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ticket-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(15, 23, 42, 0.18);
}

.ticket-total span {
  color: var(--muted);
  font-weight: 900;
}

.ticket-total strong {
  color: var(--red);
  font-size: 28px;
  font-weight: 1000;
}

.ticket-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 20px 20px;
}

.action-btn {
  padding: 12px 10px;
  background: #f8fafc;
  color: var(--strong);
  border: 1px solid var(--line);
}

.action-btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
}

.action-btn.danger {
  color: var(--red);
  background: rgba(107, 33, 168, 0.08);
  border-color: rgba(107, 33, 168, 0.14);
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .orders-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .orders-navbar,
  .orders-page {
    width: calc(100vw - 24px);
  }

  .orders-navbar {
    padding: 10px 12px;
    border-radius: 18px;
  }

  .brand img {
    width: 104px;
  }

  .nav-actions a {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .nav-actions a span {
    display: none;
  }

  .orders-hero {
    padding: 18px;
    border-radius: 20px;
  }

  .search-card {
    grid-template-columns: auto 1fr;
  }

  .search-card button {
    grid-column: 1 / -1;
  }

  .ticket-meta {
    grid-template-columns: 1fr;
  }

  .ticket-actions {
    grid-template-columns: 1fr;
  }

  .ticket-total strong {
    font-size: 24px;
  }
}

.orders-grid {
  display: grid;
  gap: 22px;
}

.orders-block {
  display: grid;
  gap: 12px;
}

.orders-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orders-block-head h3 {
  margin: 0;
  color: var(--strong);
  font-size: 20px;
  font-weight: 1000;
}

.orders-block-head span {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(107, 33, 168, 0.08);
  color: var(--red);
  font-size: 12px;
  font-weight: 1000;
}

.orders-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .orders-track {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .orders-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .orders-track .order-ticket {
    min-width: 92%;
    scroll-snap-align: start;
  }
}

.orders-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 26px !important;
}

.orders-block {
  width: 100%;
  min-width: 0;
}

.orders-track {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
}

.orders-track .order-ticket {
  width: 100%;
  min-width: 0;
}

@media (max-width: 680px) {
  .orders-track {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    padding: 0 4px 12px;
    scroll-snap-type: x mandatory;
  }

  .orders-track .order-ticket {
    flex: 0 0 92%;
    min-width: 92%;
    scroll-snap-align: start;
  }
}


/* ══════════════════════════════════════
   DESGLOSE MESERO EN TICKET
══════════════════════════════════════ */

.ticket-total-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 6px;
}

.ticket-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.mesero-row {
  color: var(--red);
  font-weight: 900;
}

.mesero-row i {
  font-size: 15px;
  vertical-align: middle;
  margin-right: 4px;
}

.ticket-total-block .ticket-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  border: none;
  padding: 0;
}

/* ══════════════════════════════════════
   FOOTER KAI EXPERIENCE
══════════════════════════════════════ */

.kai-footer {
  margin-top: 40px;
  margin-bottom: 24px;
  padding: 16px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 16px 36px rgba(107, 33, 168, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.kai-footer span {
  color: rgba(255, 255, 255, 0.80);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kai-footer img {
  height: 26px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.90;
  transition: opacity 0.2s ease;
}

.kai-footer img:hover {
  opacity: 1;
}

/* Badge mesero en el ticket */
.mesero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(107, 33, 168, 0.08);
  color: var(--red);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.mesero-badge i {
  font-size: 13px;
}


/* ══════════════════════════════════════
   BOTTOM NAV — ESTILO APP
══════════════════════════════════════ */

.bottom-nav {
  display: none;
}

@media (max-width: 760px) {
  body {
    padding-bottom: 72px;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: #fff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 4px 0;
    transition: color 0.15s;
  }

  .bottom-nav-item i {
    font-size: 22px;
    line-height: 1;
  }

  .bottom-nav-item.active {
    color: var(--red);
  }

  .events-navbar,
  .orders-navbar {
    display: none !important;
  }
}


/* ── Header móvil con logo ── */
.mobile-top-bar {
  display: none;
}

@media (max-width: 760px) {
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px 10px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 0 0 20px 20px;
    margin-bottom: 16px;
    box-shadow: 0 6px 20px rgba(107, 33, 168, 0.22);
  }

  .mobile-top-bar img {
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
  }
}