/* ==========================================================================
   APEX AUTO — components: buttons, header, mobile menu, booking sheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  min-height: 54px;
  padding: 0.95em 1.8em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  font-size: 0.72rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}

/* Brushed-metal sheen sweeps across on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--metal);
  background-size: 200% 100%;
  transform: translateX(-101%);
  transition: transform 0.6s var(--ease-cine);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateX(0);
}

.btn:hover,
.btn:focus-visible {
  color: var(--ink);
  border-color: var(--chrome-hi);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.5s var(--ease-cine);
}

.btn:hover svg,
.btn:focus-visible svg {
  transform: translateX(5px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  border-color: var(--line-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--chrome-hi);
}

.btn--sm {
  min-height: 44px;
  padding: 0.85em 1.4em;
  font-size: 0.66rem;
}

.btn--lg {
  min-height: 66px;
  padding-inline: 2.4em;
  font-size: 0.78rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding-block: 0.55em;
  font-size: 0.7rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(var(--chrome), var(--chrome)) left bottom / 100% 1px no-repeat;
  transition: color 0.3s var(--ease), background-size 0.6s var(--ease-cine);
}

.link-arrow svg {
  width: 15px;
  height: 15px;
  transition: transform 0.5s var(--ease-cine);
}

.link-arrow:hover,
.link-arrow:focus-visible {
  color: var(--chrome-hi);
}

.link-arrow:hover svg,
.link-arrow:focus-visible svg {
  transform: translateX(6px);
}

/* --------------------------------------------------------------------------
   Header: transparent over the hero, solid once scrolled
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding-block: 28px;
  border-bottom: 1px solid transparent;
  transition: padding 0.5s var(--ease), background-color 0.5s var(--ease), border-color 0.5s var(--ease);
}

.site-header.is-scrolled {
  padding-block: 14px;
  background: rgba(6, 6, 7, 0.92);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  position: relative;
  z-index: 2;
  display: inline-grid;
  gap: 0.5em;
  line-height: 1;
}

.logo__apex {
  font-size: 1.5rem;
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
}

.logo__auto {
  display: flex;
  align-items: center;
  gap: 0.8em;
  font-size: 0.6rem;
  font-weight: 500;
  font-stretch: 125%;
  letter-spacing: 0.9em;
  color: var(--chrome);
}

.logo__auto::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--metal);
  transform-origin: left;
  transition: transform 0.7s var(--ease-cine);
}

.logo:hover .logo__auto::after {
  transform: scaleX(0.5);
}

.nav {
  display: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 2.8vw, 3rem);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding-block: 0.6em;
  font-size: 0.7rem;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 0.3s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1em;
  height: 1px;
  background: var(--metal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.55s var(--ease-cine);
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link.is-active {
  color: var(--white);
}

.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-header__cta {
  display: none;
}

.menu-toggle {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin-right: -10px;
  display: grid;
  place-items: center;
}

.menu-toggle__bars {
  position: relative;
  width: 28px;
  height: 10px;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.6s var(--ease-cine), top 0.6s var(--ease-cine), width 0.6s var(--ease-cine);
}

.menu-toggle__bars::before {
  top: 0;
  left: 0;
  right: 0;
}

.menu-toggle__bars::after {
  top: 9px;
  left: 0;
  width: 60%;
}

.menu-open .menu-toggle__bars::before {
  top: 4px;
  transform: rotate(45deg);
}

.menu-open .menu-toggle__bars::after {
  top: 4px;
  width: 100%;
  transform: rotate(-45deg);
}

/* Mobile menu: full-screen, lines rise into place */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  background: var(--ink);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
  overflow-y: auto;
}

.menu-open .mobile-menu {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s var(--ease), visibility 0s;
}

.mobile-menu__list {
  display: grid;
  margin-block: auto;
}

.mobile-menu__link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.32em;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  font-stretch: 125%;
  font-size: clamp(1.7rem, 8vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.3s;
}

.mobile-menu__link span {
  font-size: 0.66rem;
  font-stretch: 112%;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--chrome-lo);
}

.mobile-menu__link:hover,
.mobile-menu__link.is-active {
  color: var(--chrome-hi);
}

.menu-open .mobile-menu__link {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease-cine), transform 0.9s var(--ease-cine), color 0.3s;
  transition-delay: calc(0.15s + var(--i) * 70ms);
}

.mobile-menu__foot {
  display: grid;
  gap: 1.4rem;
  padding-top: 2rem;
  margin-top: 2rem;
  color: var(--dim);
  font-size: 0.9rem;
}

.mobile-menu__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
}

.mobile-menu__meta a:hover {
  color: var(--chrome-hi);
}

/* Sticky booking bar, mobile only */
.book-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(6, 6, 7, 0.96);
  border-top: 1px solid var(--line);
  transform: translateY(101%);
  transition: transform 0.6s var(--ease-cine);
}

.book-bar.is-visible {
  transform: none;
}

.book-bar .btn {
  width: 100%;
}

.menu-open .book-bar {
  transform: translateY(101%);
}

@media (min-width: 1020px) {
  .nav {
    display: block;
  }

  .site-header__cta {
    display: inline-flex;
  }

  .menu-toggle,
  .mobile-menu,
  .book-bar {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Booking sheet (native <dialog>)
   -------------------------------------------------------------------------- */

.sheet {
  width: min(700px, 100%);
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  color: var(--white);
  background: var(--coal);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.7s var(--ease-cine) both;
}

.sheet::backdrop {
  background: rgba(2, 2, 3, 0.82);
  animation: fade-in 0.5s ease both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 28px clamp(20px, 4vw, 40px) 22px;
  border-bottom: 1px solid var(--line);
}

.sheet__title {
  margin-top: 0.9rem;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
}

.sheet__close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -8px -10px 0 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  transition: color 0.3s, transform 0.6s var(--ease-cine);
}

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

.sheet__close svg {
  width: 22px;
  height: 22px;
}

.sheet__body {
  overflow-y: auto;
  padding: 26px clamp(20px, 4vw, 40px) 30px;
  display: grid;
  gap: 28px;
}

.field {
  display: grid;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field__label {
  padding: 0;
  font-size: 0.66rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--chrome);
}

.field__row {
  display: grid;
  gap: 16px;
}

@media (min-width: 560px) {
  .field__row {
    grid-template-columns: 1fr 1fr;
  }
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0.9em 1em;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: inherit;
  font-size: 1rem;
  color-scheme: dark;
  transition: border-color 0.3s;
}

.input::placeholder {
  color: var(--mute);
}

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

.input:focus-visible {
  outline: none;
  border-color: var(--chrome-hi);
  box-shadow: 0 0 0 1px var(--chrome-hi);
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.choice__face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95em 1.1em;
  border: 1px solid var(--line);
  background: var(--ink);
  font-size: 0.92rem;
  transition: border-color 0.3s, background-color 0.3s;
}

.choice__face b {
  font-weight: 600;
}

.choice__face span {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

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

.choice input:checked + .choice__face {
  border-color: var(--chrome);
  background: var(--graphite);
}

.choice input:checked + .choice__face span {
  color: var(--chrome-hi);
}

.choice input:focus-visible + .choice__face {
  outline: 2px solid var(--chrome-hi);
  outline-offset: 2px;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.slot .choice__face {
  justify-content: center;
  padding: 0.75em 0.4em;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.slot input:disabled + .choice__face {
  color: var(--mute);
  opacity: 0.45;
  text-decoration: line-through;
  border-style: dashed;
  cursor: not-allowed;
}

.slot input:disabled {
  cursor: not-allowed;
}

.slots__note {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--mute);
  padding: 0.6em 0;
}

.sheet__foot {
  display: grid;
  gap: 14px;
}

.form-error {
  min-height: 1.4em;
  font-size: 0.9rem;
  color: #e8a49a;
}

.sheet__fine {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--mute);
}

@media (min-width: 641px) {
  .sheet {
    max-height: calc(100dvh - 48px);
  }
}

@media (max-width: 640px) {
  .sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    max-height: 94dvh;
    border-inline: 0;
    border-bottom: 0;
  }
}
