/* Navbar, Footer, Buttons, Cards, Cart drawer, Search, Cursor */

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--color-ink);
  color: var(--color-cream);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
}

.announce__track {
  display: inline-flex;
  gap: 2.5rem;
  padding: 0.45rem 0;
  animation: marquee 28s linear infinite;
}

.announce__track span::before {
  content: "✦";
  margin-right: 2.5rem;
  color: var(--color-primary);
}

.announce__track span:nth-child(even)::before {
  color: var(--color-secondary);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-height);
  background: var(--color-cream);
  border-bottom: var(--border);
}

.navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.navbar__brand {
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-bounce);
}

.navbar__brand img {
  width: auto;
  height: 50px;
}

.navbar__brand:hover {
  transform: rotate(-4deg) scale(1.06);
}

.navbar__menu {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.navbar__link {
  display: block;
  padding: 0.3rem 0.9rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), transform 0.3s var(--ease-bounce);
}

.navbar__link:hover,
.navbar__link.is-active {
  background: var(--color-secondary);
  border-color: var(--color-ink);
  transform: rotate(-2deg);
}

.navbar__actions {
  display: flex;
  gap: 0.5rem;
}

.lang-btn {
  height: 44px;
  padding: 0 0.9rem;
  background: var(--color-secondary);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background var(--transition);
}

.lang-btn:hover {
  background: var(--color-primary);
  transform: translate(-1px, -1px) rotate(-3deg);
  box-shadow: 4px 4px 0 var(--color-ink);
}

.lang-btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--color-white);
  border: var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background var(--transition);
}

.icon-btn:hover {
  background: var(--color-primary);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--color-ink);
}

.icon-btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--color-hot);
  color: var(--color-white);
  border: 2px solid var(--color-ink);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.cart-count.is-bump {
  animation: bump 0.45s var(--ease-bounce);
}

@keyframes bump {
  50% { transform: scale(1.6) rotate(12deg); }
}

.navbar__toggle {
  display: none;
}

@media (max-width: 860px) {
  .navbar__toggle {
    display: grid;
  }

  .navbar__actions {
    margin-left: auto;
    gap: 0.35rem;
  }

  .navbar__brand img {
    height: 42px;
  }

  .lang-btn {
    padding: 0 0.65rem;
  }

  .navbar__menu {
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: var(--space-sm) 20px var(--space-md);
    background: var(--color-cream);
    border-bottom: var(--border);
  }

  .navbar__menu.is-open {
    display: flex;
  }

  .navbar__link {
    padding: 0.7rem 1rem;
    font-size: 1.15rem;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.6rem 1.6rem;
  background: var(--color-white);
  color: var(--color-ink);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background var(--transition);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--color-ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.btn--primary { background: var(--color-primary); }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--secondary { background: var(--color-secondary); }
.btn--secondary:hover { background: var(--color-secondary-dark); }
.btn--ink { background: var(--color-ink); color: var(--color-cream); box-shadow: 3px 3px 0 var(--color-hot); }
.btn--ink:hover { box-shadow: 5px 5px 0 var(--color-hot); }
.btn--lg { min-height: 56px; padding-inline: 2rem; font-size: 1.15rem; }
.btn--block { width: 100%; }

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- Card ---------- */
.card {
  padding: var(--space-md);
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Sticker / tag ---------- */
.tag {
  display: inline-block;
  padding: 0.15rem 0.8rem;
  background: var(--color-white);
  border: 2px solid var(--color-ink);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
}

.tag--pink { background: var(--color-primary); }
.tag--green { background: var(--color-secondary); }

/* ---------- Overlay + Cart drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(29, 20, 24, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

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

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--color-cream);
  border-left: var(--border);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
}

.drawer.is-open {
  transform: none;
  visibility: visible;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--color-primary);
  border-bottom: var(--border);
}

.drawer__head h2 {
  font-size: 1.5rem;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.drawer__empty {
  padding: 3rem 1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.drawer__empty b {
  display: block;
  font-size: 3rem;
  line-height: 1.2;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.6rem;
  background: var(--color-white);
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-sm);
  animation: pop-in 0.35s var(--ease-bounce);
}

@keyframes pop-in {
  from { transform: scale(0.85); opacity: 0; }
}

.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.cart-item__name {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
  font-size: 0.95rem;
}

.cart-item__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.cart-item__price {
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: right;
}

.qty {
  display: inline-flex;
  align-items: center;
  margin-top: 0.3rem;
  border: 2px solid var(--color-ink);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-heading);
}

.qty button {
  width: 30px;
  height: 28px;
  background: var(--color-secondary);
  border: 0;
  font-weight: 700;
}

.qty button:hover {
  background: var(--color-secondary-dark);
}

.qty span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.drawer__foot {
  padding: 1.25rem;
  border-top: var(--border);
  background: var(--color-white);
}

.drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.drawer__total strong {
  font-size: 1.9rem;
  font-weight: 800;
}

.drawer__note {
  margin-top: 0.6rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- Search panel ---------- */
.search {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.25rem, 3vw, 2.25rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(158, 216, 155, 0.35), transparent 60%),
    radial-gradient(50% 120% at 0% 0%, rgba(255, 186, 198, 0.45), transparent 60%),
    rgba(255, 250, 247, 0.94);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border-radius: 0 0 36px 36px;
  box-shadow: 0 40px 80px -20px rgba(29, 20, 24, 0.35);
  transform: translateY(-105%);
  visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.55s;
}

.search.is-open {
  transform: none;
  visibility: visible;
}

.search__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.search__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
}

.search__close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--color-white);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(29, 20, 24, 0.12);
  transition: transform 0.35s var(--ease-bounce), background var(--transition), color var(--transition);
}

.search__close svg {
  width: 18px;
  height: 18px;
}

.search__close:hover {
  background: var(--color-ink);
  color: var(--color-white);
  transform: rotate(90deg);
}

.search__field {
  position: relative;
}

.search__field svg {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 66px;
  padding: 0 1.6rem 0 3.9rem;
  background: var(--color-white);
  border: 2px solid transparent;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(29, 20, 24, 0.08);
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.search__input:focus,
.search__input:focus-visible {
  outline: none;
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 6px rgba(255, 186, 198, 0.45), 0 10px 30px rgba(29, 20, 24, 0.08);
}

.search__input::-webkit-search-cancel-button {
  display: none;
}

.search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.search__chip {
  padding: 0.3rem 1rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(29, 20, 24, 0.12);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform 0.3s var(--ease-bounce), background var(--transition), color var(--transition), border-color var(--transition);
}

.search__chip:hover {
  transform: translateY(-2px);
  border-color: var(--color-ink);
}

.search__chip.is-active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-white);
}

.search__count {
  margin: 1.4rem 0 0.8rem;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.search__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
}

.search__hit {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.6rem 1rem;
  background: var(--color-white);
  border: 0;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(29, 20, 24, 0.07);
  text-align: left;
  transition: transform 0.4s var(--ease-bounce), box-shadow 0.3s ease;
  animation: hit-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

@keyframes hit-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
}

.search__hit:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(29, 20, 24, 0.14);
}

.search__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  background: #ffe6eb;
  overflow: hidden;
}

.search__hit--green .search__thumb { background: #dff3dd; }
.search__hit--cream .search__thumb { background: #fff1e4; }

/* รูปอยู่กลางช่องพร้อมขอบว่างเท่ากันทุกด้าน เห็นสินค้าทั้งชิ้น ไม่ถูกตัด */
.search__thumb img {
  position: absolute;
  inset: 12%;
  width: 76%;
  height: 76%;
  object-fit: contain;
  mix-blend-mode: multiply; /* พื้นขาวของรูปกลืนไปกับสีพื้น */
  transition: transform 0.5s var(--ease-bounce);
}

.search__hit:hover .search__thumb img {
  transform: scale(1.1) rotate(-4deg);
}

.search__cat {
  margin: 0.75rem 0.35rem 0.1rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ชื่อจองที่ 2 บรรทัดเสมอ (ยาวกว่านั้นตัดด้วย …) — ราคาทุกใบจึงอยู่แนวเดียวกัน */
.search__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
  margin: 0 0.35rem 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.search__price {
  align-self: flex-start;
  margin: auto 0.35rem 0;
  padding: 0.1rem 0.8rem;
  background: var(--color-ink);
  color: var(--color-white);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.search__none {
  grid-column: 1 / -1;
  padding: 2.5rem 1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.search__none b {
  display: block;
  font-size: 2.6rem;
  line-height: 1.3;
}

@media (max-width: 560px) {
  .search {
    border-radius: 0 0 26px 26px;
  }

  .search__input {
    height: 56px;
  }

  .search__results {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 300;
  padding: 0.6rem 1.4rem;
  background: var(--color-ink);
  color: var(--color-cream);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, 300%);
  transition: transform 0.4s var(--ease-bounce);
}

.toast.is-show {
  transform: translate(-50%, 0);
}

/* ---------- Custom cursor (เฉพาะอุปกรณ์ที่มีเมาส์) ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 2.5px solid var(--color-ink);
  border-radius: 50%;
  background: rgba(158, 216, 155, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: width 0.25s var(--ease-bounce), height 0.25s var(--ease-bounce), margin 0.25s var(--ease-bounce), background 0.2s, opacity 0.2s;
}

.cursor.is-on { opacity: 1; }

.cursor.is-hover {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(255, 186, 198, 0.5);
}

/* ---------- Sparkle burst ---------- */
.spark {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  font-size: 20px;
  line-height: 1;
  color: var(--color-hot);
  -webkit-text-stroke: 1px var(--color-ink);
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  width: 100%;
  height: 5px;
  background: var(--color-hot);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  padding: var(--space-lg) 0 var(--space-md);
  background: var(--color-ink);
  color: var(--color-cream);
  overflow: hidden;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-lg);
}

.footer h3 {
  margin-bottom: 0.6rem;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.footer__logo {
  width: 190px;
  height: auto;
  margin-bottom: 0.8rem;
}

.footer a:hover {
  color: var(--color-secondary);
  text-decoration: underline wavy;
}

.footer__big {
  margin-top: var(--space-lg);
  font-family: var(--font-display);
  font-synthesis: none;
  font-weight: 900;
  font-size: clamp(3rem, 14.5vw, 13rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 2px var(--color-primary);
  user-select: none;
}

.footer__copy {
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  text-align: center;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

.footer__copy a,
.sfoot__bar a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* รายการเมนูรอง — แสดงเฉพาะในเมนูเต็มจอของดีไซน์ใหม่ (story.css) */
.navbar__item--sub { display: none; }
