/* Khaosan Palace Flash Deal popup — isolated styles, safe to remove with flash-deal.js */
:root {
  --kpl-fd-ink: #10261d;
  --kpl-fd-green: #0b5138;
  --kpl-fd-green-dark: #063725;
  --kpl-fd-green-deep: #042a1d;
  --kpl-fd-gold: #c8a44d;
  --kpl-fd-gold-light: #e4c47a;
  --kpl-fd-cream: #f5f0df;
  --kpl-fd-paper: #fffaf0;
  --kpl-fd-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --kpl-fd-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.kpl-flash-deal-open { overflow: hidden; }

.kpl-flash-deal-overlay,
.kpl-flash-deal-overlay * { box-sizing: border-box; }

.kpl-flash-deal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 12%, rgba(224, 189, 114, .18), transparent 34%),
    rgba(4, 24, 16, .82);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  font-family: var(--kpl-fd-sans);
}

.kpl-flash-deal-overlay.is-visible { opacity: 1; visibility: visible; }

.kpl-flash-deal-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: var(--kpl-fd-cream);
  background:
    radial-gradient(circle at 50% -8%, rgba(255,255,255,.08), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.035), transparent 42%),
    var(--kpl-fd-green-dark);
  border: 1px solid rgba(228, 196, 122, .62);
  border-radius: 2px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48), 0 0 0 7px rgba(200, 164, 77, .07);
  transform: translateY(14px) scale(.985);
  transition: transform .32s cubic-bezier(.2,.7,.2,1);
}

.kpl-flash-deal-overlay.is-visible .kpl-flash-deal-dialog { transform: translateY(0) scale(1); }

.kpl-flash-deal-dialog::before,
.kpl-flash-deal-dialog::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.kpl-flash-deal-dialog::before {
  inset: 10px;
  border: 1px solid rgba(200, 164, 77, .26);
}

.kpl-flash-deal-dialog::after {
  top: 0;
  left: 50%;
  width: min(180px, 42%);
  height: 3px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--kpl-fd-gold-light), transparent);
}

.kpl-flash-deal-close {
  position: absolute;
  z-index: 5;
  top: 15px;
  right: 15px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid rgba(245, 240, 223, .3);
  border-radius: 50%;
  background: rgba(255,255,255,.045);
  color: var(--kpl-fd-cream);
  cursor: pointer;
  font: 300 27px/1 var(--kpl-fd-sans);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.kpl-flash-deal-close:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(224,189,114,.75);
  transform: rotate(4deg);
}

.kpl-flash-deal-close:focus-visible,
.kpl-flash-deal-copy:focus-visible,
.kpl-flash-deal-book:focus-visible {
  outline: 3px solid var(--kpl-fd-gold-light);
  outline-offset: 3px;
}

.kpl-flash-deal-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(42px, 5.5vw, 62px) clamp(22px, 6vw, 62px) clamp(28px, 4.8vw, 48px);
  text-align: center;
}

.kpl-flash-deal-stars {
  margin: 0 0 7px;
  color: var(--kpl-fd-gold-light);
  font-size: clamp(13px, 1.7vw, 17px);
  line-height: 1;
  letter-spacing: .32em;
  text-indent: .32em;
}

.kpl-flash-deal-hotel {
  margin: 0 0 clamp(19px, 3vw, 28px);
  color: rgba(245, 240, 223, .75);
  font-size: clamp(9px, 1.3vw, 11px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* Flash Deal is intentionally prominent */
.kpl-flash-deal-kicker {
  display: block;
  margin: 0 0 8px;
  color: #fff4d7;
  font-family: var(--kpl-fd-serif);
  font-size: clamp(26px, 5.4vw, 42px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .055em;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0,0,0,.18);
}

.kpl-flash-deal-kicker::before,
.kpl-flash-deal-kicker::after { display: none; }

.kpl-flash-deal-title {
  margin: 0;
  font-family: var(--kpl-fd-serif);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.045em;
}

/* 10% OFF is the strongest message in the popup */
.kpl-flash-deal-title em {
  display: block;
  color: var(--kpl-fd-gold-light);
  font-size: clamp(58px, 12vw, 104px);
  font-style: normal;
  font-weight: 700;
  line-height: .88;
  letter-spacing: -.055em;
  text-transform: uppercase;
  text-shadow: 0 3px 24px rgba(0,0,0,.22);
}

.kpl-flash-deal-title span {
  display: block;
  margin-top: 9px;
  color: #fff8ed;
  font-size: clamp(26px, 5.5vw, 44px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.025em;
}

.kpl-flash-deal-subtitle {
  max-width: 540px;
  margin: clamp(16px, 2.5vw, 22px) auto 0;
  color: rgba(245, 240, 223, .9);
  font-family: var(--kpl-fd-serif);
  font-size: clamp(15px, 2.2vw, 19px);
  line-height: 1.52;
}

.kpl-flash-deal-subtitle strong {
  color: #fff8ed;
  font-weight: 700;
}

.kpl-flash-deal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(450px, 88%);
  margin: clamp(20px, 3vw, 28px) auto clamp(18px, 2.8vw, 24px);
}

.kpl-flash-deal-divider::before,
.kpl-flash-deal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(200,164,77,.36);
}

.kpl-flash-deal-divider span {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--kpl-fd-gold);
}

.kpl-flash-deal-count-label {
  margin: 0 0 10px;
  color: rgba(245,240,223,.72);
  font-size: clamp(9px, 1.25vw, 11px);
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.kpl-flash-deal-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.25vw, 9px);
  width: min(480px, 100%);
  margin: 0 auto;
}

.kpl-flash-deal-timebox {
  min-width: 0;
  padding: clamp(10px, 1.8vw, 14px) 4px clamp(9px, 1.5vw, 12px);
  border: 1px solid rgba(224,189,114,.28);
  background: rgba(255,255,255,.035);
}

.kpl-flash-deal-timebox strong {
  display: block;
  color: #fff8ed;
  font-family: var(--kpl-fd-serif);
  font-size: clamp(25px, 5vw, 39px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpl-flash-deal-timebox span {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: rgba(245,240,223,.6);
  font-size: clamp(7px, 1vw, 9px);
  font-weight: 800;
  letter-spacing: .1em;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

.kpl-flash-deal-code-wrap {
  width: min(480px, 100%);
  margin: clamp(17px, 2.8vw, 23px) auto 0;
}

.kpl-flash-deal-code-label {
  margin: 0 0 8px;
  color: rgba(245,240,223,.7);
  font-size: clamp(9px, 1.1vw, 10px);
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.kpl-flash-deal-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border: 1px solid rgba(224,189,114,.48);
  background: var(--kpl-fd-paper);
}

.kpl-flash-deal-code {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 54px;
  padding: 10px 15px;
  color: var(--kpl-fd-green-dark);
  font-family: var(--kpl-fd-serif);
  font-size: clamp(24px, 4.2vw, 29px);
  font-weight: 700;
  letter-spacing: .16em;
  text-indent: .16em;
}

.kpl-flash-deal-copy {
  min-width: 116px;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid rgba(11,81,56,.18);
  background: var(--kpl-fd-cream);
  color: var(--kpl-fd-green);
  cursor: pointer;
  font: 800 9px/1 var(--kpl-fd-sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease;
}

.kpl-flash-deal-copy:hover,
.kpl-flash-deal-copy.is-copied {
  background: #eee8d9;
  color: var(--kpl-fd-green-dark);
}

.kpl-flash-deal-book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(480px, 100%);
  min-height: 56px;
  margin: clamp(16px, 2.5vw, 20px) auto 0;
  padding: 14px 28px;
  background: var(--kpl-fd-gold);
  color: var(--kpl-fd-ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  transition: transform .2s ease, background .2s ease;
}

.kpl-flash-deal-book:hover {
  background: var(--kpl-fd-gold-light);
  transform: translateY(-1px);
}

.kpl-flash-deal-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Tablets / phones */
@media (max-width: 640px) {
  .kpl-flash-deal-overlay {
    place-items: center;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .kpl-flash-deal-dialog {
    width: 100%;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .kpl-flash-deal-dialog::before { inset: 7px; }
  .kpl-flash-deal-inner { padding: 45px 18px 25px; }
  .kpl-flash-deal-close { top: 11px; right: 11px; width: 38px; height: 38px; }
  .kpl-flash-deal-hotel { margin-bottom: 18px; }
  .kpl-flash-deal-divider { width: 92%; }
}

/* Small phones: preserve 4-column timer, stack promo-code controls */
@media (max-width: 390px) {
  .kpl-flash-deal-inner { padding: 42px 13px 21px; }
  .kpl-flash-deal-stars { font-size: 12px; }
  .kpl-flash-deal-hotel { font-size: 8px; letter-spacing: .15em; }
  .kpl-flash-deal-kicker { font-size: clamp(24px, 8vw, 30px); }
  .kpl-flash-deal-title em { font-size: clamp(52px, 19vw, 70px); }
  .kpl-flash-deal-title span { font-size: clamp(24px, 9vw, 31px); }
  .kpl-flash-deal-subtitle { font-size: 14px; line-height: 1.42; }
  .kpl-flash-deal-countdown { gap: 4px; }
  .kpl-flash-deal-timebox { padding-left: 2px; padding-right: 2px; }
  .kpl-flash-deal-timebox strong { font-size: clamp(23px, 9vw, 30px); }
  .kpl-flash-deal-timebox span { font-size: 6.8px; letter-spacing: .06em; }
  .kpl-flash-deal-code-row { grid-template-columns: 1fr; }
  .kpl-flash-deal-copy {
    min-height: 42px;
    border-left: 0;
    border-top: 1px solid rgba(11,81,56,.18);
  }
  .kpl-flash-deal-book { min-height: 52px; }
}

/* Short screens / landscape phones: reduce vertical rhythm and allow dialog scrolling */
@media (max-height: 620px) {
  .kpl-flash-deal-overlay { place-items: start center; }
  .kpl-flash-deal-dialog { margin-top: auto; margin-bottom: auto; }
  .kpl-flash-deal-inner { padding-top: 37px; padding-bottom: 20px; }
  .kpl-flash-deal-stars { margin-bottom: 4px; }
  .kpl-flash-deal-hotel { margin-bottom: 12px; }
  .kpl-flash-deal-kicker { font-size: clamp(22px, 4.5vw, 32px); margin-bottom: 5px; }
  .kpl-flash-deal-title em { font-size: clamp(49px, 10vw, 74px); }
  .kpl-flash-deal-title span { margin-top: 5px; font-size: clamp(23px, 4.5vw, 32px); }
  .kpl-flash-deal-subtitle { margin-top: 11px; font-size: 14px; line-height: 1.35; }
  .kpl-flash-deal-divider { margin-top: 13px; margin-bottom: 12px; }
  .kpl-flash-deal-count-label { margin-bottom: 7px; }
  .kpl-flash-deal-timebox { padding-top: 8px; padding-bottom: 8px; }
  .kpl-flash-deal-timebox strong { font-size: clamp(23px, 4vw, 31px); }
  .kpl-flash-deal-timebox span { margin-top: 4px; }
  .kpl-flash-deal-code-wrap { margin-top: 12px; }
  .kpl-flash-deal-code { min-height: 47px; }
  .kpl-flash-deal-copy { min-height: 47px; }
  .kpl-flash-deal-book { min-height: 48px; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .kpl-flash-deal-overlay,
  .kpl-flash-deal-dialog,
  .kpl-flash-deal-close,
  .kpl-flash-deal-book { transition: none !important; }
}
