/* ============================================================
   JY CAFE — Interactive widgets
   WhatsApp assistant, Scan & Order modal, accordion, carousel,
   newsletter, count-up stats, scroll progress.
   ============================================================ */

/* ---------- WhatsApp assistant ---------- */
.wa-float {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 80;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  box-shadow: 0 12px 30px rgba(18, 140, 126, 0.45);
  transition: transform 0.3s var(--ease);
}

.wa-float:hover { transform: translateY(-4px) scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }

.wa-float::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.55);
  animation: wa-pulse 2.2s infinite;
}

@keyframes wa-pulse {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

.wa-panel {
  position: fixed;
  bottom: 96px;
  left: 22px;
  z-index: 81;
  width: min(340px, calc(100vw - 44px));
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom left;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}

.wa-panel.is-open { opacity: 1; visibility: visible; transform: none; }

.wa-head {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

.wa-head b { display: block; font-size: 0.98rem; }
.wa-head small { opacity: 0.9; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 5px; }
.wa-head small::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #9ff5b2;
}

.wa-body { padding: 18px 18px 20px; display: grid; gap: 12px; }

.wa-greeting {
  background: var(--cream-100);
  border: 1px solid var(--cream-200);
  border-radius: 4px 16px 16px 16px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--ink-900);
  width: fit-content;
  max-width: 88%;
}

.wa-greeting em { font-style: normal; color: var(--lavender-600); font-weight: 700; }

.wa-options { display: grid; gap: 8px; }

.wa-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--cream-50);
  border: 1.5px solid var(--cream-200);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-700);
  transition: all 0.22s var(--ease);
}

.wa-option:hover { border-color: #25D366; color: #0b7a4b; background: #f1fbf5; transform: translateX(4px); }
.wa-option svg { width: 18px; height: 18px; flex: none; color: #25D366; }

.wa-custom { display: grid; gap: 8px; }
.wa-custom.is-hidden { display: none; }

.wa-custom textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--sand-300);
  border-radius: var(--r-sm);
  resize: vertical;
  min-height: 64px;
  font-size: 0.88rem;
}

.wa-custom button {
  padding: 10px;
  border-radius: var(--r-pill);
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s var(--ease);
}
.wa-custom button:hover { background: #1da851; }

.wa-foot {
  font-size: 0.75rem;
  text-align: center;
  color: var(--ink-500);
  padding-bottom: 14px;
}

/* ---------- Ordering modal (Scan & Order) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(45, 34, 64, 0.66);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.modal-overlay.is-open { opacity: 1; visibility: visible; }

.order-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(92vh, 860px);
  background: var(--cream-50);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(30px) scale(0.97);
  transition: transform 0.45s var(--ease);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.is-open .order-modal { transform: none; }

.modal-head {
  padding: 20px 24px;
  background: var(--lavender-800);
  color: var(--cream-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 { color: var(--cream-50); font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.modal-head h3 svg { width: 22px; height: 22px; color: var(--gold-400); }
.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--cream-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.modal-close:hover { background: var(--gold-400); color: var(--lavender-950); }
.modal-close svg { width: 17px; height: 17px; }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

/* Stepper indicator */
.order-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}

.order-steps .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
}

.order-steps .step .dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-200);
  color: var(--ink-500);
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid transparent;
  transition: all 0.3s var(--ease);
}

.order-steps .step .dot.is-done { background: var(--lavender-600); color: var(--cream-50); }
.order-steps .step .dot.is-current {
  background: var(--cream-50);
  border-color: var(--gold-500);
  color: var(--gold-500);
  box-shadow: 0 0 0 5px rgba(212, 165, 116, 0.18);
}

.order-steps .step small { font-size: 0.68rem; font-weight: 600; color: var(--ink-500); letter-spacing: 0.04em; }
.order-steps .line { flex: 1; max-width: 44px; height: 2px; background: var(--cream-200); border-radius: var(--r-pill); }
.order-steps .line.is-done { background: var(--lavender-600); }

/* Step panels */
.order-step-panel { display: none; }
.order-step-panel.is-active { display: block; animation: step-in 0.4s var(--ease); }

@keyframes step-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.order-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.order-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  border-radius: var(--r-md);
  border: 2px solid var(--cream-200);
  background: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-700);
  transition: all 0.25s var(--ease);
}

.order-type svg { width: 26px; height: 26px; color: var(--gold-500); transition: color 0.25s var(--ease); }
.order-type:hover { border-color: var(--rose-400); }
.order-type.is-selected {
  border-color: var(--lavender-600);
  background: var(--lavender-800);
  color: var(--cream-50);
}
.order-type.is-selected svg { color: var(--gold-400); }

.detail-row { margin-top: 18px; display: none; }
.detail-row.is-visible { display: block; animation: step-in 0.3s var(--ease); }

.table-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.table-tile {
  padding: 12px 6px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--sand-300);
  background: var(--white);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink-700);
  transition: all 0.2s var(--ease);
}

.table-tile:hover { border-color: var(--lavender-500); }
.table-tile.is-selected { background: var(--lavender-600); border-color: var(--lavender-600); color: var(--cream-50); }

.pay-grid { display: grid; gap: 10px; }

.pay-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: var(--r-md);
  border: 2px solid var(--cream-200);
  background: var(--white);
  text-align: left;
  transition: all 0.25s var(--ease);
}

.pay-opt svg { width: 26px; height: 26px; flex: none; color: var(--gold-500); }
.pay-opt .pay-info { flex: 1; }
.pay-opt .pay-info b { display: block; color: var(--ink-900); font-size: 0.98rem; }
.pay-opt .pay-info small { color: var(--ink-500); font-size: 0.82rem; }

.pay-opt .pay-radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--sand-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: all 0.2s var(--ease);
}

.pay-opt .pay-radio::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--lavender-600);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}

.pay-opt.is-selected { border-color: var(--lavender-600); background: #f0f6f1; }
.pay-opt.is-selected .pay-radio { border-color: var(--lavender-600); }
.pay-opt.is-selected .pay-radio::after { transform: scale(1); }

.review-block {
  background: var(--white);
  border: 1px solid var(--cream-200);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.review-block h4 { font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-500); margin-bottom: 10px; }

.review-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; padding: 4px 0; color: var(--ink-700); }
.review-row.total { font-weight: 800; color: var(--ink-900); border-top: 1.5px dashed var(--sand-300); margin-top: 6px; padding-top: 10px; }
.review-row.total .amt { color: var(--lavender-700); }

.modal-foot {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--cream-200);
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-foot .btn-back { border: 1.5px solid var(--sand-300); color: var(--ink-700); border-radius: var(--r-pill); padding: 12px 22px; font-weight: 600; transition: all 0.2s var(--ease); }
.modal-foot .btn-back:hover { border-color: var(--gold-500); background: var(--white); }
.modal-foot .btn { flex: 1; }

/* Success screen */
.order-success {
  text-align: center;
  padding: 20px 8px 8px;
  display: none;
}

.order-success.is-active { display: block; animation: step-in 0.5s var(--ease); }

.success-rings { position: relative; width: 120px; height: 120px; margin: 0 auto 22px; }

.success-rings .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(212, 165, 116, 0.4);
  animation: ring-grow 1.6s var(--ease) infinite;
}

.success-rings .ring:nth-child(2) { animation-delay: 0.4s; border-color: rgba(201, 123, 139, 0.35); }
.success-rings .ring:nth-child(3) { animation-delay: 0.8s; border-color: rgba(157, 139, 192, 0.35); }

.success-rings .check {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender-600), var(--lavender-800));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cream-50);
}

.success-rings .check svg { width: 46px; height: 46px; }

@keyframes ring-grow {
  0%   { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.order-success h3 { font-size: 1.6rem; margin-bottom: 8px; }
.order-success .order-id-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 22px;
  background: var(--lavender-800);
  color: var(--cream-50);
  border-radius: var(--r-pill);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: var(--font-body);
  box-shadow: var(--shadow-md);
}

.order-success .order-id-box svg { width: 20px; height: 20px; color: var(--gold-400); }
.order-success p { color: var(--ink-500); font-size: 0.94rem; max-width: 380px; margin-inline: auto; }

.success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; }

/* ---------- Accordion (FAQ) ---------- */
.accordion { display: grid; gap: 12px; }

.acc-item {
  background: var(--white);
  border: 1.5px solid var(--cream-200);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.acc-item.is-open { border-color: var(--rose-400); box-shadow: var(--shadow-sm); }

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-900);
}

.acc-head .acc-icon {
  width: 32px; height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--cream-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lavender-700);
  transition: all 0.3s var(--ease);
}

.acc-head .acc-icon svg { width: 15px; height: 15px; transition: transform 0.3s var(--ease); }

.acc-item.is-open .acc-icon { background: var(--lavender-600); color: var(--cream-50); }
.acc-item.is-open .acc-icon svg { transform: rotate(45deg); }

.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease); }

.acc-body p { padding: 0 20px 20px; font-size: 0.93rem; color: var(--ink-500); }

/* ---------- Carousel (testimonials) ---------- */
.carousel { position: relative; }

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide { scroll-snap-align: start; padding: 6px; }

.testi-card {
  height: 100%;
  background: var(--white);
  border: 1px solid var(--cream-200);
  border-radius: var(--r-lg);
  padding: clamp(26px, 4vw, 44px);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.testi-card::before {
  content: "\201C";
  position: absolute;
  top: -26px;
  right: 12px;
  font-family: var(--font-display);
  font-size: 130px;
  color: rgba(212, 165, 116, 0.18);
  line-height: 1;
}

.testi-card blockquote {
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  color: var(--ink-900);
  font-family: var(--font-display);
  line-height: 1.55;
  margin-bottom: 22px;
  max-width: 640px;
}

.testi-person { display: flex; align-items: center; gap: 14px; }

.testi-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--cream-50);
  flex: none;
}

.testi-person b { display: block; color: var(--ink-900); }
.testi-person small { color: var(--ink-500); }

.testi-stars { display: flex; gap: 3px; margin-bottom: 16px; }
.testi-stars svg { width: 18px; height: 18px; color: var(--gold-500); }

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
}

.carousel-arrow {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--sand-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lavender-800);
  transition: all 0.25s var(--ease);
}

.carousel-arrow:hover { background: var(--lavender-800); color: var(--cream-50); border-color: var(--lavender-800); }
.carousel-arrow svg { width: 19px; height: 19px; }

.carousel-dots { display: flex; gap: 7px; }

.carousel-dots button {
  width: 9px; height: 9px;
  border-radius: var(--r-pill);
  background: var(--sand-300);
  transition: all 0.3s var(--ease);
}

.carousel-dots button.is-active { width: 26px; background: var(--gold-500); }

/* ---------- Newsletter ---------- */
.newsletter-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(212, 165, 116, 0.22), transparent 60%),
    linear-gradient(135deg, var(--lavender-700), var(--lavender-950));
  border-radius: 40px;
  padding: clamp(34px, 6vw, 64px);
  color: var(--cream-100);
  box-shadow: var(--shadow-lg);
}

.newsletter-card h2 { color: var(--cream-50); font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 560px; }
.newsletter-card > p { margin: 12px 0 26px; color: rgba(255, 245, 238, 0.82); max-width: 520px; }

.newsletter-form { display: flex; flex-wrap: wrap; flex-direction: column; gap: 12px; max-width: 560px; }

.newsletter-form input {
  flex: 1;
  padding: 15px 20px;
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(255, 245, 238, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream-50);
}

.newsletter-form input::placeholder { color: rgba(255, 245, 238, 0.6); }
.newsletter-form input:focus { outline: none; border-color: var(--gold-400); }

.newsletter-form .form-msg { font-size: 0.9rem; min-height: 22px; flex-basis: 100%; }
.newsletter-form button { flex: none; }
.newsletter-form .form-msg.ok { color: #9ff5b2; }
.newsletter-form .form-msg.err { color: #ffb4a6; }

@media (min-width: 640px) {
  .newsletter-form { flex-direction: row; align-items: stretch; }
}
