/* =========================================================
   KING'S CAVE — PUBLIC SHELL

   ÚNICO RESPONSABLE DE:
   - Header público
   - Navegación de escritorio
   - Menú hamburguesa
   - Menú lateral móvil
   - Footer
   - Botón flotante de WhatsApp
========================================================= */

:root {
  --kc-shell-header-expanded: 150px;
  --kc-shell-header-upper: 94px;
  --kc-shell-header-nav: 56px;
  --kc-shell-header-mobile: 78px;

  --kc-shell-black: #101415;
  --kc-shell-black-warm: #1d1a13;
  --kc-shell-brown: #463a2c;
  --kc-shell-brown-dark: #2a261d;
  --kc-shell-gold: #bf995a;
  --kc-shell-white: #ffffff;

  --kc-shell-max: 1440px;

  --kc-shell-title-font:
    "Raleway",
    Arial,
    Helvetica,
    sans-serif;

  --kc-shell-body-font:
    "Open Sans",
    Arial,
    Helvetica,
    sans-serif;
}


/* =========================================================
   ACCESIBILIDAD
========================================================= */

.kc-skip-link {
  position: fixed;
  z-index: 5000;

  top: 10px;
  left: 10px;

  padding: 10px 14px;

  border: 1px solid var(--kc-shell-gold);

  background: var(--kc-shell-black);
  color: var(--kc-shell-white);

  font-family: var(--kc-shell-body-font);
  font-size: 0.75rem;
  font-weight: 700;

  transform: translateY(-160%);

  transition: transform 160ms ease;
}

.kc-skip-link:focus {
  transform: translateY(0);
}


/* =========================================================
   CONTENIDO Y COMPENSACIÓN DEL HEADER
========================================================= */

.kc-main {
  width: 100%;
  min-height: 100vh;

  margin: 0;

  padding-top:
    var(--kc-shell-header-expanded) !important;
}

html {
  scroll-padding-top:
    calc(
      var(--kc-shell-header-nav) +
      20px
    );
}


/* =========================================================
   HEADER GENERAL
========================================================= */

.kc-topbar {
  position: fixed;
  z-index: 1000;

  top: 0;
  right: 0;
  left: 0;

  width: 100%;
  height: var(--kc-shell-header-expanded);

  overflow: hidden;

  background: var(--kc-shell-black);

  border-top:
    3px solid
    var(--kc-shell-gold);

  border-bottom:
    1px solid
    rgba(
      191,
      153,
      90,
      0.35
    );

  box-shadow:
    0 10px 28px
    rgba(
      0,
      0,
      0,
      0.28
    );

  transition:
    height 260ms ease,
    border-width 260ms ease;
}


/* =========================================================
   PARTE SUPERIOR
========================================================= */

.kc-topbar__upper {
  width: 100%;
  height: var(--kc-shell-header-upper);

  background: var(--kc-shell-black);

  opacity: 1;

  transform: translateY(0);

  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.kc-topbar__upper-inner {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  width:
    min(
      calc(100% - 64px),
      var(--kc-shell-max)
    );

  height: 100%;

  margin: 0 auto;
}


/* =========================================================
   LOGO
========================================================= */

.kc-topbar__brand {
  position: absolute;

  top: 50%;
  left: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  transform:
    translate(
      -50%,
      -50%
    );
}

.kc-topbar__logo {
  width: 190px;
  max-width: none;
  max-height: 70px;

  object-fit: contain;
}


/* =========================================================
   BOTONES DEL HEADER
========================================================= */

.kc-topbar__actions {
  display: flex;
  align-items: center;

  gap: 14px;
}

.kc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 164px;
  min-height: 44px;

  padding:
    0
    22px;

  border:
    1px solid
    transparent;

  background: transparent;

  font-family: var(--kc-shell-body-font);

  font-size: 0.68rem;
  font-weight: 700;

  letter-spacing: 0.11em;
  line-height: 1;

  text-align: center;
  text-transform: uppercase;

  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.kc-pill:hover,
.kc-pill:focus-visible {
  transform: translateY(-2px);
}

.kc-pill--text,
.kc-pill--outline {
  border-color: var(--kc-shell-gold);

  color: var(--kc-shell-gold);
}

.kc-pill--text:hover,
.kc-pill--text:focus-visible,
.kc-pill--outline:hover,
.kc-pill--outline:focus-visible {
  background: var(--kc-shell-gold);
  color: var(--kc-shell-black-warm);
}

.kc-pill--gold {
  border-color: var(--kc-shell-gold);

  background: var(--kc-shell-gold);
  color: var(--kc-shell-black-warm);
}

.kc-pill--gold:hover,
.kc-pill--gold:focus-visible {
  border-color: var(--kc-shell-white);

  background: var(--kc-shell-white);
  color: var(--kc-shell-black-warm);
}


/* =========================================================
   NAVEGACIÓN DE ESCRITORIO
========================================================= */

.kc-topbar__nav {
  position: absolute;

  right: 0;
  bottom: 0;
  left: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: var(--kc-shell-header-nav);

  gap:
    clamp(
      48px,
      5.5vw,
      96px
    );

  background: var(--kc-shell-black-warm);

  border-top:
    1px solid
    rgba(
      255,
      255,
      255,
      0.06
    );

  transition:
    top 260ms ease,
    bottom 260ms ease,
    box-shadow 260ms ease;
}

.kc-topbar__link {
  position: relative;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 100%;

  padding:
    0
    8px;

  color:
    rgba(
      255,
      255,
      255,
      0.72
    );

  font-family: var(--kc-shell-body-font);

  font-size: 0.74rem;
  font-weight: 600;

  letter-spacing: 0.08em;

  white-space: nowrap;

  text-transform: uppercase;

  transition: color 180ms ease;
}

.kc-topbar__link::after {
  position: absolute;

  right: 8px;
  bottom: 0;
  left: 8px;

  height: 2px;

  background: var(--kc-shell-gold);

  content: "";

  transform: scaleX(0);
  transform-origin: center;

  transition: transform 180ms ease;
}

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

.kc-topbar__link:hover::after,
.kc-topbar__link:focus-visible::after,
.kc-topbar__link.is-active::after {
  transform: scaleX(1);
}


/* =========================================================
   HEADER COLAPSADO EN ESCRITORIO
========================================================= */

.kc-topbar--collapsed {
  height: var(--kc-shell-header-nav);

  border-top-width: 0;
}

.kc-topbar--collapsed
.kc-topbar__upper {
  opacity: 0;

  pointer-events: none;

  transform:
    translateY(
      -100%
    );
}

.kc-topbar--collapsed
.kc-topbar__nav {
  top: 0;
  bottom: auto;

  box-shadow:
    0 8px 24px
    rgba(
      0,
      0,
      0,
      0.28
    );
}


/* =========================================================
   HAMBURGUESA
========================================================= */

.kc-burger {
  display: none;

  width: 44px;
  height: 44px;

  padding: 10px;

  border:
    1px solid
    var(--kc-shell-gold);

  background: transparent;

  cursor: pointer;
}

.kc-burger span {
  display: block;

  width: 100%;
  height: 1px;

  margin:
    5px
    0;

  background:
    var(--kc-shell-white);

  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.kc-burger:focus-visible,
.kc-mobile-close:focus-visible,
.kc-mobile-link:focus-visible,
.kc-pill:focus-visible {
  outline:
    2px solid
    var(--kc-shell-gold);

  outline-offset: 3px;
}


/* =========================================================
   OVERLAY MÓVIL
========================================================= */

.kc-mobile-overlay {
  position: fixed;
  z-index: 1090;

  inset: 0;

  display: block;

  visibility: hidden;

  background:
    rgba(
      0,
      0,
      0,
      0.72
    );

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

body.kc-nav-open
.kc-mobile-overlay {
  visibility: visible;

  opacity: 1;
  pointer-events: auto;
}


/* =========================================================
   MENÚ LATERAL MÓVIL
========================================================= */

.kc-mobile-nav {
  position: fixed;
  z-index: 1100;

  top: 0;
  right: 0;

  display: flex;
  flex-direction: column;

  width:
    min(
      390px,
      90vw
    );

  height: 100dvh;

  padding:
    calc(
      20px +
      env(safe-area-inset-top)
    )
    22px
    calc(
      24px +
      env(safe-area-inset-bottom)
    );

  overflow-x: hidden;
  overflow-y: auto;

  overscroll-behavior: contain;

  background: var(--kc-shell-black-warm);
  color: var(--kc-shell-white);

  box-shadow:
    -16px
    0
    38px
    rgba(
      0,
      0,
      0,
      0.38
    );

  pointer-events: none;

  transform:
    translateX(
      105%
    );

  transition: transform 260ms ease;
}

body.kc-nav-open
.kc-mobile-nav {
  pointer-events: auto;

  transform:
    translateX(
      0
    );
}

.kc-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  flex: 0 0 auto;

  margin-bottom: 18px;
  padding-bottom: 18px;

  border-bottom:
    1px solid
    rgba(
      255,
      255,
      255,
      0.12
    );
}

.kc-mobile-nav__brand {
  display: inline-flex;
  align-items: center;

  min-width: 0;
}

.kc-mobile-nav__brand img {
  width: 150px;
  max-width: 62vw;
  max-height: 58px;

  object-fit: contain;
}

.kc-mobile-close {
  display: grid;
  place-items: center;

  flex: 0 0 42px;

  width: 42px;
  height: 42px;

  padding: 0;

  border:
    1px solid
    var(--kc-shell-gold);

  background: transparent;
  color: var(--kc-shell-white);

  font-size: 1.55rem;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;
}

.kc-mobile-link {
  display: flex;
  align-items: center;

  flex: 0 0 auto;

  width: 100%;
  min-height: 54px;

  padding:
    0
    12px;

  border-bottom:
    1px solid
    rgba(
      255,
      255,
      255,
      0.1
    );

  color:
    rgba(
      255,
      255,
      255,
      0.76
    );

  font-family: var(--kc-shell-body-font);

  font-size: 0.72rem;
  font-weight: 600;

  letter-spacing: 0.09em;

  text-transform: uppercase;
}

.kc-mobile-link:hover,
.kc-mobile-link:focus-visible,
.kc-mobile-link.is-active {
  color: var(--kc-shell-gold);
}

.kc-mobile-actions {
  display: grid;

  flex: 0 0 auto;

  gap: 10px;

  margin-top: 24px;
}

.kc-mobile-actions
.kc-pill {
  width: 100%;
  min-width: 0;
}

.kc-mobile-legal {
  display: grid;

  flex: 0 0 auto;

  gap: 12px;

  margin-top: auto;
  padding-top: 28px;
}

.kc-mobile-legal a {
  color:
    rgba(
      255,
      255,
      255,
      0.5
    );

  font-family: var(--kc-shell-body-font);

  font-size: 0.57rem;
  font-weight: 600;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}


/* =========================================================
   FOOTER
========================================================= */

.kc-footer {
  background: var(--kc-shell-black);
  color: var(--kc-shell-white);

  border-top:
    1px solid
    rgba(
      191,
      153,
      90,
      0.32
    );
}

.kc-footer__inner {
  display: grid;

  grid-template-columns:
    1.2fr
    1fr
    0.8fr
    0.9fr;

  gap: 56px;

  width:
    min(
      calc(100% - 64px),
      var(--kc-shell-max)
    );

  margin: 0 auto;
  padding: 68px 0 52px;
}

.kc-footer__brand {
  min-width: 0;
}

.kc-footer__logo {
  width: 190px;
  max-width: 100%;
  max-height: 88px;

  object-fit: contain;
}

.kc-footer__col,
.kc-footer__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  min-width: 0;

  gap: 10px;
}

.kc-footer h3 {
  margin:
    0
    0
    10px;

  color:
    var(--kc-shell-gold);

  font-family:
    var(--kc-shell-title-font);

  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 0.14em;

  text-transform: uppercase;
}

.kc-footer a,
.kc-footer p {
  max-width: 100%;

  margin: 0;

  overflow-wrap: anywhere;

  color:
    rgba(
      255,
      255,
      255,
      0.67
    );

  font-family: var(--kc-shell-body-font);

  font-size: 0.78rem;
  line-height: 1.8;
}

.kc-footer__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;

  margin-top: 8px;
  padding:
    0
    24px;

  border:
    1px solid
    var(--kc-shell-gold);

  color:
    var(--kc-shell-gold) !important;

  font-size:
    0.68rem !important;

  font-weight: 700;

  letter-spacing: 0.12em;
}

.kc-footer__btn:hover,
.kc-footer__btn:focus-visible {
  background:
    var(--kc-shell-gold);

  color:
    var(--kc-shell-black-warm) !important;
}

.kc-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  width:
    min(
      calc(100% - 64px),
      var(--kc-shell-max)
    );

  margin: 0 auto;
  padding:
    24px
    0
    28px;

  border-top:
    1px solid
    rgba(
      255,
      255,
      255,
      0.1
    );
}

.kc-footer__legal {
  display: flex;
  flex-wrap: wrap;

  gap:
    12px
    18px;
}

.kc-footer__bottom a,
.kc-footer__bottom p {
  font-size: 0.58rem;

  letter-spacing: 0.07em;
}


/* =========================================================
   WHATSAPP
========================================================= */

.kc-whatsapp-float {
  position: fixed;
  z-index: 900;

  right:
    calc(
      18px +
      env(safe-area-inset-right)
    );

  bottom:
    calc(
      18px +
      env(safe-area-inset-bottom)
    );

  display: grid;
  place-items: center;

  width: 48px;
  height: 48px;

  border:
    1px solid
    var(--kc-shell-gold);

  border-radius: 50%;

  background:
    var(--kc-shell-black);

  color:
    var(--kc-shell-gold);

  font-family: var(--kc-shell-body-font);

  font-size: 0.62rem;
  font-weight: 700;

  letter-spacing: 0.04em;
}


/* =========================================================
   PORTÁTILES
========================================================= */

@media (max-width: 1080px) {
  .kc-topbar__logo {
    width: 165px;
  }

  .kc-pill {
    min-width: 146px;
  }

  .kc-topbar__nav {
    gap: 38px;
  }

  .kc-footer__inner {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap:
      44px
      54px;
  }
}


/* =========================================================
   ESCRITORIO: EL MENÚ MÓVIL NO PARTICIPA
========================================================= */

@media (min-width: 961px) {
  .kc-mobile-overlay,
  .kc-mobile-nav {
    display: none !important;
  }
}


/* =========================================================
   TABLET Y MÓVIL
========================================================= */

@media (max-width: 960px) {
  :root {
    --kc-shell-header-expanded:
      var(--kc-shell-header-mobile);
  }

  .kc-topbar,
  .kc-topbar--collapsed {
    height:
      var(--kc-shell-header-mobile) !important;

    overflow: visible;

    border-top-width: 3px;
  }

  .kc-main {
    padding-top:
      var(--kc-shell-header-mobile) !important;
  }

  .kc-topbar__upper,
  .kc-topbar--collapsed
  .kc-topbar__upper {
    height:
      var(--kc-shell-header-mobile);

    opacity: 1 !important;

    pointer-events: auto;

    transform: none !important;
  }

  .kc-topbar__upper-inner {
    display: grid;

    grid-template-columns:
      48px
      minmax(0, 1fr)
      48px;

    align-items: center;

    width:
      calc(
        100% -
        28px
      );

    height: 100%;

    margin: 0 auto;
  }

  .kc-topbar__brand {
    position: static;

    grid-column: 2;

    justify-self: center;

    min-width: 0;

    transform: none;
  }

  .kc-topbar__logo {
    width:
      min(
        142px,
        46vw
      );

    max-width: 100%;
    max-height: 56px;
  }

  .kc-topbar__actions,
  .kc-topbar__nav {
    display: none !important;
  }

  .kc-burger {
    position: static;

    grid-column: 3;

    justify-self: end;

    display: block !important;
  }

  .kc-mobile-overlay {
    display: block !important;
  }

  .kc-mobile-nav {
    display: flex !important;
  }
}


/* =========================================================
   CELULARES
========================================================= */

@media (max-width: 680px) {
  .kc-footer__inner {
    grid-template-columns: 1fr;

    gap: 34px;

    width:
      calc(
        100% -
        36px
      );

    padding:
      50px
      0
      38px;
  }

  .kc-footer__logo {
    width: 160px;
  }

  .kc-footer__bottom {
    align-items: flex-start;
    flex-direction: column;

    width:
      calc(
        100% -
        36px
      );

    gap: 18px;

    padding:
      22px
      0
      28px;
  }

  .kc-footer__legal {
    display: grid;

    grid-template-columns: 1fr;

    width: 100%;

    gap: 10px;
  }

  .kc-footer__cta {
    width: 100%;
  }

  .kc-footer__btn {
    width: 100%;
  }
}


/* =========================================================
   CELULARES PEQUEÑOS
========================================================= */

@media (max-width: 390px) {
  .kc-mobile-nav {
    width: 100vw;

    padding-right: 18px;
    padding-left: 18px;
  }

  .kc-topbar__upper-inner {
    width:
      calc(
        100% -
        20px
      );
  }

  .kc-topbar__logo {
    width:
      min(
        130px,
        44vw
      );
  }

  .kc-burger {
    width: 42px;
    height: 42px;
  }

  .kc-whatsapp-float {
    width: 46px;
    height: 46px;
  }
}


/* =========================================================
   PANTALLAS BAJAS EN HORIZONTAL
========================================================= */

@media
  (max-width: 960px)
  and (orientation: landscape)
  and (max-height: 520px) {

  .kc-mobile-nav {
    width:
      min(
        440px,
        78vw
      );
  }

  .kc-mobile-link {
    min-height: 46px;
  }

  .kc-mobile-actions {
    margin-top: 18px;
  }

  .kc-mobile-legal {
    margin-top: 22px;
    padding-top: 0;
  }
}


/* =========================================================
   MOVIMIENTO REDUCIDO
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .kc-topbar,
  .kc-topbar__upper,
  .kc-topbar__nav,
  .kc-pill,
  .kc-topbar__link,
  .kc-burger span,
  .kc-mobile-overlay,
  .kc-mobile-nav,
  .kc-skip-link {
    transition-duration:
      0.01ms !important;
  }
}
