/* =========================================================
   KANPAI IZAKAYA & SUSHI - VIDEO LANDING + RESERVATION
   Palette lấy từ kanpaidanang.com / kanpainhatrang.com:
   trắng ngà • đỏ crimson (logo/nút) • than chì • vàng đèn lồng
   Layout: toàn bộ nằm gọn trong 1 màn hình (100dvh), không scroll (desktop/tablet)
   ========================================================= */

:root {
  --red: #b3171b;
  --red-dark: #8c1014;
  --red-soft: rgba(179, 23, 27, 0.1);
  --red-glow: rgba(179, 23, 27, 0.35);
  --lantern: #f2b84b;

  --ink: #222226;
  --ink-soft: #5a5a62;
  --ivory: #fbf9f6;
  --paper: #ffffff;
  --line: #e4e0da;

  --font-head: 'Mulish', 'Poppins', sans-serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  /* Kích thước co giãn theo chiều cao màn hình để luôn vừa 1 screen */
  --gap-y: clamp(0.85rem, 2.1vh, 1.15rem);
  --field-py: clamp(0.45rem, 1.2vh, 0.65rem);
}

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

html, body {
  width: 100%;
  height: 100%;
  background: #141416;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* =========================================================
   HERO = 1 SCREEN: header / form / info bar
   ========================================================= */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 20, 22, 0.15) 0%, rgba(20, 20, 22, 0.35) 55%, rgba(20, 20, 22, 0.6) 100%),
    linear-gradient(180deg, transparent 55%, rgba(20, 20, 22, 0.85) 100%);
}

/* =========================================================
   HEADER (trắng như site gốc)
   ========================================================= */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem clamp(1rem, 6vw, 5rem);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
  border-bottom: 3px solid var(--red);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }

.brand-logo {
  display: block;
  height: clamp(40px, 7vh, 58px);
  width: auto;
  max-width: 220px;
  object-fit: contain;
  transition: var(--ease);
}
.brand:hover .brand-logo { transform: scale(1.04); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.call-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 50px;
  background: var(--paper);
  transition: var(--ease);
}
.call-pill svg { color: var(--red); transition: var(--ease); }
.pill-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  background: var(--red);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.call-pill:hover {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--red-glow);
}
.call-pill:hover svg { color: #fff; }
.call-pill:hover .pill-tag { background: #fff; color: var(--red); }

/* =========================================================
   FORM CARD (bên phải, video để trống bên trái)
   ========================================================= */
.hero-content {
  position: relative;
  z-index: 10;
  min-height: 0;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(0.6rem, 1.6vh, 1.2rem) clamp(1rem, 5vw, 4rem);
}

.booking-card {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 100%;
  overflow-y: auto; /* chỉ là lưới an toàn cho màn hình quá thấp */
  scrollbar-width: thin;
  background: rgba(251, 249, 246, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 6px;
  padding: clamp(0.9rem, 2.4vh, 1.6rem) clamp(1.2rem, 2.2vw, 2rem) clamp(1rem, 2.6vh, 1.7rem);
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.55);
  animation: cardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.booking-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--red-dark), var(--red), var(--lantern));
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-header { text-align: center; margin-bottom: clamp(0.6rem, 1.8vh, 1.1rem); }

.form-badge {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.15rem;
}

.form-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4.2vh, 2.1rem);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.15;
  color: var(--ink);
}

.form-subtitle { margin-top: 0.2rem; font-size: 0.8rem; color: var(--ink-soft); }

/* Lưới form 2 cột */
.booking-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.9rem;
  row-gap: var(--gap-y);
}
.form-group { position: relative; display: flex; flex-direction: column; gap: 0.28rem; min-width: 0; }

.form-label { font-size: 0.78rem; font-weight: 600; color: var(--ink); }
.required { color: var(--red); margin-left: 2px; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: 0.72rem; }

.form-control {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: var(--field-py) 0.85rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.4;
  outline: none;
  transition: var(--ease);
}
.form-control::placeholder { color: #a5a5ad; font-size: 0.82rem; }
.form-control:hover { border-color: #cfc9c0; }
.form-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.form-control.invalid { border-color: var(--red); background: #fff6f6; }

textarea.form-control { resize: none; height: calc(1.4em + 2 * var(--field-py) + 2px); overflow: hidden; }
textarea.form-control:focus { overflow-y: auto; }

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23b3171b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 0.85rem;
}
select.form-control:invalid { color: #a5a5ad; }
select.form-control option { color: var(--ink); }

input[type='date']::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.7; }
input[type='date']::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Lỗi hiển thị đè lên khoảng cách giữa các hàng => không làm form cao thêm */
.field-error {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 1px;
  font-size: 0.66rem;
  line-height: 1.2;
  color: var(--red);
  font-weight: 500;
  white-space: nowrap;
}
.field-error:empty { display: none; }

/* Honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Guest stepper */
.stepper { display: flex; align-items: stretch; gap: 0.35rem; }
.stepper-input { text-align: center; font-weight: 600; -moz-appearance: textfield; min-width: 0; }
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  flex: 0 0 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--red);
  cursor: pointer;
  transition: var(--ease);
}
.stepper-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.stepper-btn:active { transform: scale(0.94); }

/* Submit */
.btn-submit {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: clamp(0.6rem, 1.6vh, 0.85rem) 1.5rem;
  border: none;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 22px var(--red-glow);
  transition: var(--ease);
}
.btn-submit::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(20deg);
  animation: shine 4s infinite;
}
@keyframes shine {
  0% { left: -60%; }
  30%, 100% { left: 140%; }
}
.btn-submit:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 12px 28px var(--red-glow); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.7; cursor: wait; transform: none; }

/* =========================================================
   INFO BAR (2 cơ sở)
   ========================================================= */
.info-bar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: clamp(0.5rem, 1.4vh, 0.9rem) clamp(1rem, 6vw, 5rem);
  color: #f2f0ec;
  background: rgba(20, 20, 22, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.info-title {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.info-no {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--red);
  padding: 0.12rem 0.5rem;
  border-radius: 3px;
}
.info-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #d9d6d0;
}
.info-line svg { flex: 0 0 auto; color: var(--lantern); }
.info-line svg:not(:first-child) { margin-left: 0.7rem; }
.info-line a { text-decoration: none; transition: var(--ease); }
.info-line a:hover { color: var(--lantern); text-decoration: underline; }

/* =========================================================
   MODAL
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(15, 15, 17, 0.8);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: var(--ease);
}
.modal-backdrop.show { opacity: 1; visibility: visible; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 94vh;
  overflow-y: auto;
  background: var(--ivory);
  border-radius: 6px;
  border-top: 5px solid var(--red);
  padding: 1.6rem 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.94) translateY(20px);
  transition: var(--ease);
}
.modal-backdrop.show .modal-card { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #efebe5;
  color: var(--ink-soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--ease);
}
.modal-close:hover { background: var(--red); color: #fff; }

.modal-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-soft);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  margin-bottom: 0.6rem;
}
.modal-title { font-family: var(--font-head); font-size: 1.5rem; color: var(--ink); margin-bottom: 0.3rem; }
.modal-desc { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.5; margin-bottom: 1rem; }

.ticket {
  background: var(--paper);
  border: 1px dashed #cfc9c0;
  border-radius: 6px;
  padding: 0.35rem 1.1rem;
  margin-bottom: 1.1rem;
  text-align: left;
}
.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid #f0ece6;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-label { color: var(--ink-soft); flex: 0 0 auto; }
.ticket-val { color: var(--ink); font-weight: 600; text-align: right; word-break: break-word; }
#tCode { color: var(--red); }

.modal-actions { display: flex; gap: 0.7rem; }
.btn-call, .btn-close {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--ease);
}
.btn-call { flex: 1.2; background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn-call:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 8px 18px var(--red-glow); }
.btn-close { flex: 0.8; background: transparent; color: var(--ink); border: 1px solid #cfc9c0; }
.btn-close:hover { border-color: var(--red); color: var(--red); }

/* =========================================================
   MÀN HÌNH THẤP (laptop nhỏ): nén thêm để vẫn đủ 1 screen
   ========================================================= */
@media (max-height: 760px) {
  .form-subtitle { display: none; }
  .form-badge { font-size: 0.62rem; }
  .info-line { font-size: 0.74rem; line-height: 1.4; }
  .info-title { margin-bottom: 0.1rem; }
}
@media (max-height: 640px) {
  :root { --gap-y: 0.6rem; --field-py: 0.34rem; }
  .form-badge { display: none; }
  .form-header { margin-bottom: 0.4rem; }
  .form-title { font-size: 1.3rem; }
  .form-label { font-size: 0.7rem; }
  .form-group { gap: 0.15rem; }
  .form-control { font-size: 0.82rem; }
  .field-error { font-size: 0.6rem; }
  .booking-card { padding: 0.65rem 1.2rem 0.8rem; }
  .btn-submit { padding: 0.5rem 1rem; font-size: 0.88rem; }
  .site-header { padding-top: 0.25rem; padding-bottom: 0.25rem; }
  .brand-logo { height: 34px; }
  .info-bar { padding-top: 0.35rem; padding-bottom: 0.35rem; }
  .info-title { font-size: 0.82rem; }
  .info-line { font-size: 0.7rem; line-height: 1.3; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .pill-text { display: none; }
  .call-pill { padding: 0.42rem 0.7rem; }
  .info-bar { gap: 1rem; }
  .info-line a[href^='mailto'] { display: none; } /* giữ email trong header/phiếu, rút gọn để vừa 1 màn hình */
  .info-line svg:nth-of-type(2) { display: none; }
  .info-line svg:not(:first-child) { margin-left: 0; }
}

@media (max-width: 640px) {
  /* Mobile: ưu tiên dùng được, cho phép cuộn nếu màn hình dọc quá thấp */
  .hero { height: auto; min-height: 100dvh; }
  .site-header { padding: 0.4rem 1rem; }
  .hero-content { padding: 0.8rem 0.7rem 1rem; justify-content: center; }
  .booking-card { max-height: none; padding: 1rem 0.95rem 1.1rem; }
  .booking-form { column-gap: 0.55rem; }
  .branch-group { grid-column: 1 / -1; } /* dropdown Cơ sở full-width */
  .field-error { white-space: normal; }
  .info-bar { grid-template-columns: 1fr; gap: 0.5rem; }
  .info-line a[href^='mailto'] { display: inline; }
  .info-line svg:nth-of-type(2) { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
