/*
 * styles.css
 * This file contains all the styling for the Fasfú Order Flow application.
 * It includes color variables, layout, component styles, animations, and responsive rules.
 */

:root {
  --cream: #faf6ef;
  --ink: #241c1a;
  --ink-soft: #7a6f68;
  --line: #eae2d6;
  --yellow: #ffc94a;
  --white: #ffffff;
  --burger: #ff5a44;
  --burger-deep: #de4531;
  --pizza: #d9822b;
  --pizza-deep: #b96a1e;
  --sandwich: #6e7e52;
  --sandwich-deep: #576340;
  --bev: #1f4d3a;
  --bev-deep: #153a2b;
  --dessert: #9c4f6e;
  --dessert-deep: #7e3a57;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  min-height: 100vh;
  background: #e7e2d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", sans-serif;
  padding: 32px 16px;
  -webkit-font-smoothing: antialiased;
}
.device {
  position: relative;
  width: 390px;
  height: 780px;
  background: var(--cream);
  border-radius: 44px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(36, 28, 26, 0.35),
    0 0 0 10px #1c1a19,
    0 0 0 11px #3a3634;
}
.device::before {
  /* notch */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 26px;
  background: #1c1a19;
  border-radius: 0 0 18px 18px;
  z-index: 50;
}

/* ---------- HOME VIEW ---------- */
.home-view {
  position: absolute;
  inset: 0;
  padding: 12px 12px 14px !important;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.home-fade {
  transition: opacity 0.25s ease;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand svg {
  width: 24px;
  height: 24px;
}
.brand span {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink);
}
.badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--burger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cream);
}

.hero-copy {
  margin-bottom: 22px;
}
.hero-copy h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.02;
}
.hero-copy p {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--ink-soft);
  font-weight: 500;
}

.cat-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  margin-bottom: 18px;
}
.cat-rail::-webkit-scrollbar {
  display: none;
}
.cat-card {
  flex: 0 0 auto;
  width: 108px;
  height: 140px;
  border: none;
  background: transparent;
  cursor: pointer;
  scroll-snap-align: start;
  position: relative;
}
.cat-visual {
  width: 108px;
  height: 140px;
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: box-shadow 0.25s ease;
}
.cat-visual.is-hero {
  width: 100%;
  height: 100%;
  border-radius: 0;
  position: absolute;
  inset: 0;
}
.cat-visual .cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.06);
}
.cat-visual .cat-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.5) 100%
  );
}
.cat-visual .watermark {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translate(-50%, 0) rotate(-4deg);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.16);
  mix-blend-mode: overlay;
  white-space: nowrap;
  letter-spacing: -0.02em;
  font-size: 30px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cat-visual.is-hero .watermark {
  opacity: 1;
  font-size: 64px;
}
.cat-label {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px 12px;
  border-radius: 20px;
  transition: opacity 0.2s ease;
}
.cat-visual.is-hero .cat-label {
  opacity: 0;
}
.cat-card.active .cat-visual {
  box-shadow: 0 0 0 2.5px var(--ink) inset;
}

.ready-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.ready-strip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--burger);
}
.ready-strip p {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.ready-strip strong {
  color: var(--ink);
  font-weight: 700;
}

.recommended h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
}
.rec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 12px;
}
.rec-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #f1ece2;
}
.rec-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rec-info {
  flex: 1;
  min-width: 0;
}
.rec-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.rec-info span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.rec-add {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: var(--ink);
  color: var(--yellow);
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

/* ---------- DETAIL VIEW ---------- */
.detail-view {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.detail-backdrop {
  position: absolute;
  inset: 0;
  background: var(--cream);
  opacity: 0;
}
.detail-view.active .detail-backdrop {
  opacity: 1;
}
.hero-slot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 452px;
  overflow: hidden;
}
.detail-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 428px;
  background: var(--cream);
  border-radius: 32px 32px 0 0;
  padding: 26px 24px 26px;
  opacity: 0;
  transform: translateY(16px);
  display: flex;
  flex-direction: column;
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.nav-pill {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: "Inter";
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.order-pill {
  flex: 1.5;
  height: 44px;
  border-radius: 22px;
  border: none;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  font-family: "Inter";
}
#itemName {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
#itemPrice {
  font-size: 16px;
  font-weight: 700;
  color: var(--burger-deep);
  margin-bottom: 12px;
  display: inline-block;
}
#itemDesc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 500;
}

.back-btn {
  position: absolute;
  top: 44px;
  right: 20px;
  z-index: 40;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.back-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}
.detail-cart {
  position: absolute;
  top: 44px;
  left: 20px;
  z-index: 40;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.detail-cart svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
}

.dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 35;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.dot-btn {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition:
    width 0.25s ease,
    background 0.25s ease;
}
.dot-btn.active {
  width: 20px;
  background: #fff;
  border-radius: 4px;
}

.detail-view.active {
  pointer-events: auto;
}
.detail-view.active .back-btn,
.detail-view.active .detail-cart,
.detail-view.active .mini-cat-rail,
.detail-view.active .dots {
  opacity: 1;
  pointer-events: auto;
}

.mini-cat-rail {
  position: absolute;
  top: 92px;
  left: 0;
  right: 0;
  z-index: 38;
  display: flex;
  gap: 9px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mini-chip {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.55);
  opacity: 0.55;
  transform: scale(0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease;
}
.mini-chip svg {
  width: 16px;
  height: 16px;
}
.mini-chip.active {
  opacity: 1;
  transform: scale(1);
  border-color: #fff;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

.order-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: rgba(20, 15, 13, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  opacity: 0;
  pointer-events: none;
}
.order-modal {
  width: 100%;
  max-width: 340px;
  background: var(--cream);
  border-radius: 28px;
  padding: 22px 22px 20px;
  position: relative;
}
.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 3px;
  background: var(--line);
  margin: 0 auto 16px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: none;
  background: var(--line);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modalItemName {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding-right: 34px;
}
#modalItemPrice {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 4px;
  margin-bottom: 18px;
  display: block;
}
.modal-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 9px;
}
.modal-section {
  margin-bottom: 18px;
}
.size-row {
  display: flex;
  gap: 8px;
}
.size-pill {
  flex: 1;
  height: 42px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: "Inter";
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.size-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--yellow);
}
.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}
.qty-stepper button {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#qtyValue {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  min-width: 14px;
  text-align: center;
}
.modal-cta {
  width: 100%;
  height: 48px;
  border-radius: 18px;
  border: none;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: "Inter";
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--yellow);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- CART VIEW ---------- */
.cart-view {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease;
}
.cart-view.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cart-header {
  padding: 44px 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--line);
}
.cart-header h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.empty-cart-msg {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 500;
  margin-top: 40px;
  font-size: 15px;
}
.cart-item {
  display: flex;
  gap: 14px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  align-items: center;
}
.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  background: #f1ece2;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 6px;
}
.cart-item-price {
  font-weight: 700;
  font-size: 14px;
  color: var(--burger-deep);
}
.cart-item-remove {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #fbeae8;
  color: var(--burger-deep);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cart-footer {
  padding: 20px 22px 32px;
  background: var(--white);
  border-top: 1.5px solid var(--line);
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.02);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--ink-soft);
  font-weight: 600;
}
#cartTotalPrice {
  font-size: 20px;
  color: var(--ink);
  font-weight: 700;
}
.checkout-btn {
  width: 100%;
  height: 52px;
  border-radius: 20px;
  border: none;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  font-family: "Inter";
}

/* USER ORDERS */
.user-order-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    opacity 0.6s ease,
    filter 0.6s ease;
}
.user-order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 12px;
}
.user-order-queue {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.user-order-time {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.user-order-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.user-order-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-order-item {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.user-order-total {
  text-align: right;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  border-top: 1.5px dashed var(--line);
  padding-top: 12px;
}

@media (max-width: 430px) {
  body {
    padding: 0;
  }
  .device {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .device::before {
    display: none;
  }
}
