/* Reset, typography and shared components (buttons, fields, pills). */

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

/* Keep the scrollbar's space reserved so pages don't shift sideways when one can't scroll. */
html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Text boxes keep the size the layout gives them. */
textarea {
  resize: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(46, 134, 193, 0.5);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.script {
  font-family: var(--font-script);
  font-weight: 600;
  color: var(--orange);
  line-height: 1;
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: 13px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

/* A button that can't be used yet, e.g. Check out while a balance is due. */
.btn:disabled,
.btn:disabled:hover,
.btn:disabled:active {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn--primary {
  background: var(--orange);
  color: #fff;
}

.btn--primary:hover {
  background: var(--orange-strong);
}

.btn--secondary {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 1.5px var(--navy);
}

.btn--secondary:hover {
  background: rgba(31, 45, 92, 0.06);
}

.btn--quiet {
  background: transparent;
  color: var(--ink-muted);
}

.btn--quiet:hover {
  background: rgba(31, 45, 92, 0.06);
  color: var(--ink);
}

.btn--danger {
  background: transparent;
  color: var(--terra);
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.btn--danger:hover {
  background: var(--terra-soft);
}

.btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

/* Form fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink);
}

textarea.input {
  min-height: 96px;
  line-height: 1.5;
  resize: none;
}

.input:hover {
  border-color: var(--line-strong);
}

.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--focus-ring);
}

/* Hints read as hints: a typed value is the darker .input colour. */
.input::placeholder {
  color: var(--ink-hint);
  opacity: 1;
}

/*
 * A dropdown still showing its "Choose…" line reads like a placeholder too —
 * but only the closed control. The options inherit that colour, so they are
 * set back to the normal ink, leaving just the "Choose…" line dimmed.
 */
.input.is-placeholder {
  color: var(--ink-hint);
}

.input.is-placeholder option {
  color: var(--ink);
}

.input option:disabled,
.input.is-placeholder option[value=""] {
  color: var(--ink-hint);
}

/*
 * Dropdowns draw their own arrow so it can sit in from the edge; the browser's
 * built-in one hugs the border and ignores padding. Move it with
 * --select-arrow-inset (distance from the right edge).
 */
select.input {
  --select-arrow-inset: 14px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: calc(var(--select-arrow-inset) + 22px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235E6788' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--select-arrow-inset) center;
  background-size: 12px 8px;
  text-overflow: ellipsis;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.form-error {
  color: var(--terra);
  font-size: 13px;
}

.form-error:empty {
  display: none;
}

/* Pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.pill--success { background: var(--green-soft); color: var(--green-ink); }
.pill--warning { background: var(--orange-soft); color: var(--amber-ink); }
.pill--danger { background: var(--terra-soft); color: var(--terra-ink); }
.pill--info { background: var(--blue-soft); color: var(--blue-ink); }
.pill--event { background: var(--pink-soft); color: var(--pink-ink); }
.pill--neutral { background: var(--sand); color: var(--sand-ink); }
.pill--brand { background: var(--navy-soft); color: var(--navy); }

/* Product category dots */

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.dot--daytour { background: var(--blue); }
.dot--overnight { background: var(--navy); }
.dot--room { background: var(--orange); }
.dot--nighttour { background: var(--plum); }
.dot--overnightstay { background: var(--teal); }
.dot--exclusive { background: var(--gold); box-shadow: 0 0 0 2px var(--navy); }
.dot--cottage { background: var(--green); }
.dot--event { background: var(--pink); }

/* GCash QR payment card (booking page and V6M Desk) */

.pay-qr {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pay-qr__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.pay-qr__code {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 0;
  padding: 10px 10px 8px;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
}

.pay-qr__code .qr {
  display: block;
  width: 148px;
  height: 148px;
}

.pay-qr__code figcaption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-ink);
}

.pay-qr__details {
  display: grid;
  gap: 4px;
  flex: 1 1 180px;
  min-width: 0;
}

.pay-qr__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.pay-qr__amount {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.pay-qr__facts {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  font-size: 13px;
}

.pay-qr__facts div {
  display: flex;
  gap: 8px;
}

.pay-qr__facts dt {
  min-width: 76px;
  color: var(--ink-muted);
}

.pay-qr__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pay-qr__steps {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink-muted);
}

.pay-qr .button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Adding the GCash receipt screenshot. */
.receipt-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--cream);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.receipt-pick:hover,
.receipt-pick:focus-within {
  border-color: var(--blue);
}

.receipt-pick--done {
  border-style: solid;
  cursor: default;
}

.receipt-pick__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.receipt-pick__thumb {
  flex: none;
  width: 48px;
  height: 64px;
  object-fit: cover;
  object-position: top;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.receipt-pick__text {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
}

.receipt-pick__change {
  flex: none;
  margin-left: auto;
  cursor: pointer;
}

.pay-qr .mono,
.pay-qr input.mono {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

/* Guest list rows (booking page and V6M Desk) */

.guest-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guest-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 2fr) minmax(104px, 1fr) 64px minmax(0, 1.5fr) 32px;
  gap: 6px;
  align-items: center;
}

.guest-row--short {
  grid-template-columns: 22px minmax(0, 2fr) minmax(104px, 1fr) 64px 32px;
}

.guest-rows__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
}

.guest-count {
  font-size: 13px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.guest-count--short {
  color: var(--terra-ink);
  font-weight: 600;
}

.field__req {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--orange-soft);
  color: var(--amber-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.guest-row__number {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.guest-row__remove {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.guest-row__remove:hover {
  background: var(--terra-soft);
  color: var(--terra-ink);
}

@media (max-width: 560px) {
  .guest-row,
  .guest-row--short {
    /* Gender gets the wider half: "Female" and its arrow need more room than an age. */
    grid-template-columns: 22px minmax(0, 1.4fr) minmax(0, 1fr) 32px;
    grid-template-areas:
      "num name name remove"
      ". gender age ."
      ". remarks remarks .";
    row-gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
  }

  .guest-row__number { grid-area: num; }
  .guest-row [name="companionName"] { grid-area: name; }
  .guest-row [name="companionGender"] { grid-area: gender; }
  /* The styled button over the gender dropdown (fields.ts) takes the dropdown's place. */
  .guest-row [data-field-for="companionGender"] { grid-area: gender; }
  .guest-row [name="companionAge"] { grid-area: age; }
  .guest-row [name="companionRemarks"] { grid-area: remarks; }
  .guest-row__remove { grid-area: remove; }
}

/* The smallest phones: with remarks, gender takes its own line and age sits
   beside the remarks; without, gender keeps the larger share of its line. */
@media (max-width: 360px) {
  .guest-row {
    grid-template-columns: 22px minmax(0, 0.8fr) minmax(0, 1.2fr) 32px;
    grid-template-areas:
      "num name name remove"
      ". gender gender ."
      ". age remarks .";
  }

  .guest-row--short {
    grid-template-columns: 22px minmax(0, 1.7fr) minmax(0, 1fr) 32px;
    grid-template-areas:
      "num name name remove"
      ". gender age .";
  }
}
