/* ===========================================================
   Mr. Gary — A Taste of Asia
   Hoja de estilos principal
   =========================================================== */

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

:root {
  --accent: #00F4D6;
  --accent-dark: #00b3a0;
  --dark: #1a1a1a;
  --dark-soft: #242424;
  --bg: #f4f4f2;
  --wa: #25D366;
  --wa-dark: #1ea952;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--dark);
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ---------- View switching ---------- */
.view { display: none; }
.view.active { display: block; }

/* ---------- LANDING ---------- */
#home {
  position: relative;
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.35), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0,0,0,.10), transparent 50%),
    linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
}
#home.active { display: flex; }

/* decorative floating blobs */
#home::before,
#home::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  background: rgba(255, 255, 255, .18);
  animation: float 9s ease-in-out infinite;
  pointer-events: none;
}
#home::before { width: 220px; height: 220px; top: -60px; left: -60px; }
#home::after { width: 300px; height: 300px; bottom: -100px; right: -80px; animation-delay: -4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-22px) translateX(14px); }
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.logo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(26, 26, 26, .15);
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .22);
  opacity: 0;
  animation: pop-in .7s var(--ease) forwards;
  animation-delay: .05s;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.titles {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  animation: rise-in .6s var(--ease) forwards;
  animation-delay: .2s;
}
.titles h1 {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.titles p { font-size: clamp(13px, 3vw, 15px); color: #333; }

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 100%;
}

.branch-btn {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  border: none;
  border-radius: 14px;
  padding: 20px 24px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  opacity: 0;
  animation: rise-in .55s var(--ease) forwards;
}
.branch-list .branch-btn:nth-child(1) { animation-delay: .30s; }
.branch-list .branch-btn:nth-child(2) { animation-delay: .38s; }
.branch-list .branch-btn:nth-child(3) { animation-delay: .46s; }
.branch-list .branch-btn:nth-child(4) { animation-delay: .54s; }

/* shimmer sweep on hover */
.branch-btn::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.12), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.branch-btn:hover::after { left: 130%; }

.branch-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .32); }
.branch-btn:active { transform: translateY(-1px); }
.branch-btn:focus-visible { outline: 2px solid var(--dark); outline-offset: 3px; }

.b-name { font-size: clamp(16px, 4vw, 20px); font-weight: 700; color: var(--accent); }
.b-arrow {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  transition: transform .2s var(--ease);
}
.branch-btn:hover .b-arrow { transform: translateX(5px); }

.foot {
  font-size: 11px;
  color: #0a5;
  opacity: .85;
  margin-top: 4px;
  text-align: center;
  opacity: 0;
  animation: rise-in .6s var(--ease) forwards;
  animation-delay: .65s;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- MENU VIEW ---------- */
.menu-view { animation: fade-in .35s var(--ease); }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 26, 26, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}

.back {
  background: none;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .2s;
}
.back:hover { background: rgba(0, 244, 214, .12); transform: translateX(-2px); }

.bar-title {
  flex: 1;
  text-align: center;
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wa);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter .2s, transform .2s;
}
.cart-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  transform: scale(0);
  transition: transform .2s var(--ease);
}
.cart-badge.show { transform: scale(1); }

.menu-content { background: var(--bg); padding-bottom: 110px; }

/* ---------- CATEGORY TABS ---------- */
.cat-tabs {
  position: sticky;
  top: 62px;
  z-index: 40;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  background: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.cat-tab:hover { transform: translateY(-1px); }
.cat-tab.active { background: var(--dark); color: var(--accent); }

/* ---------- ANTORCHA BANNER ---------- */
.antorcha-banner {
  max-width: 900px;
  margin: 18px auto 0;
  padding: 0 16px;
}
.antorcha-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

/* ---------- MENU CATEGORY / ITEMS ---------- */
.menu-category { padding: 26px 16px 6px; animation: fade-in .3s var(--ease); }
.menu-category-head { margin-bottom: 14px; }
.menu-category-head h2 { font-size: 22px; font-weight: 800; }
.menu-category-note { font-size: 12.5px; color: #777; margin-top: 2px; }

.item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .item-grid { grid-template-columns: 1fr 1fr; }
}

.item-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s, transform .2s;
}
.item-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .1); transform: translateY(-2px); }

.item-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.item-card.has-photo { flex-direction: row; align-items: flex-start; }
.item-photo-wrap {
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.item-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-card.has-photo .item-body { flex: 1; }

.item-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-name { font-weight: 700; font-size: 15.5px; }
.item-tag {
  background: var(--accent);
  color: var(--dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 5px;
}
.item-meta { font-size: 12px; color: #999; margin-top: -4px; }
.item-desc { font-size: 13px; color: #555; line-height: 1.5; }

.item-variant-select {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  background: var(--bg);
  border: 1.5px solid #e2e2df;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
}

.item-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}
.item-price { font-size: 17px; font-weight: 800; color: var(--accent-dark); }

.add-btn {
  background: var(--dark);
  color: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .15s;
}
.add-btn:hover { background: var(--dark-soft); transform: translateY(-1px); }

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
}
.qty-stepper button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: var(--dark);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.qty-stepper button:hover { background: var(--dark-soft); }
.qty-stepper span { min-width: 16px; text-align: center; font-weight: 700; font-size: 14px; }

/* ---------- FLOATING CART BAR ---------- */
.cart-floatbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(30px);
  z-index: 65;
  background: var(--wa);
  color: #fff;
  border-radius: 50px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(37, 211, 102, .45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: transform .3s var(--ease), opacity .3s, visibility .3s;
}
.cart-floatbar.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.cart-floatbar:hover { box-shadow: 0 12px 40px rgba(37, 211, 102, .55); }
.cfb-count { opacity: .9; font-weight: 600; }
.cfb-total { font-weight: 800; }
.cfb-cta { display: flex; align-items: center; gap: 2px; }

/* ---------- CART DRAWER ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.cart-overlay.show { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 91;
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
  box-shadow: -10px 0 40px rgba(0, 0, 0, .25);
}
.cart-drawer.show { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px;
  background: var(--dark);
  color: #fff;
}
.cart-head h2 { font-size: 18px; font-weight: 800; }
.cart-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.cart-close:hover { background: rgba(255, 255, 255, .1); }

.cart-items { flex: 1; overflow-y: auto; padding: 14px 16px; }
.cart-empty { text-align: center; color: #888; padding: 60px 20px; font-size: 14px; }

.cart-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-weight: 700; font-size: 14px; }
.cart-line-variant { font-size: 12px; color: #888; }
.cart-line-price { font-size: 13px; color: var(--accent-dark); font-weight: 700; margin-top: 4px; }
.cart-line-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line-remove {
  background: none;
  border: none;
  color: #b33;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px;
}

.cart-foot { padding: 16px 18px; background: #fff; box-shadow: 0 -2px 14px rgba(0,0,0,.06); }
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}
.cart-checkout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--wa);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .2s, transform .15s;
}
.cart-checkout:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.cart-checkout:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- SCROLL TO TOP ---------- */
.top-btn {
  position: fixed;
  right: 16px;
  bottom: 22px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--dark);
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.top-btn:hover { background: var(--dark-soft); }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
