
/* =========================================================
   NISCALA EKSOTIKA
   Cookie Consent
   File: /assets/css/consent.css
   ========================================================= */

:root {
  --consent-navy: #081b3a;
  --consent-navy-soft: #102a52;
  --consent-blue: #176ee8;
  --consent-cyan: #20c6df;
  --consent-white: #ffffff;
  --consent-text: #25344b;
  --consent-muted: #66758a;
  --consent-border: rgba(8, 27, 58, 0.14);
  --consent-shadow: 0 24px 80px rgba(8, 27, 58, 0.22);
}

/* Pastikan padding tidak bikin elemen melebar */
.cookie-consent,
.cookie-consent *,
.cookie-consent *::before,
.cookie-consent *::after {
  box-sizing: border-box;
}

/* Hidden wajib menang melawan display flex */
.cookie-consent[hidden] {
  display: none !important;
}

/* Full viewport wrapper */
.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  width: 100%;
  max-width: 100vw;

  padding:
    1rem
    1rem
    max(1rem, env(safe-area-inset-bottom));

  pointer-events: none;
}

/* Panel utama */
.cookie-consent__panel {
  width: min(100%, 1080px);
  max-width: 1080px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;

  padding: 1.35rem 1.45rem;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;

  background:
    radial-gradient(
      circle at 90% 20%,
      rgba(32, 198, 223, 0.16),
      transparent 18rem
    ),
    linear-gradient(
      145deg,
      rgba(8, 27, 58, 0.98),
      rgba(16, 42, 82, 0.98)
    );

  box-shadow: var(--consent-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  overflow: hidden;
  pointer-events: auto;

  animation: consent-panel-in 360ms ease both;
}

/* Copy */
.cookie-consent__copy {
  min-width: 0;
}

.cookie-consent__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  margin-bottom: 0.55rem;

  color: #9cefff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cookie-consent__eyebrow::before {
  content: "";

  width: 22px;
  height: 1px;

  flex: 0 0 auto;

  background: currentColor;
}

.cookie-consent__title {
  margin: 0;

  color: var(--consent-white);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.cookie-consent__description {
  max-width: 720px;

  margin: 0.65rem 0 0;

  color: rgba(255, 255, 255, 0.72);
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  line-height: 1.7;

  overflow-wrap: anywhere;
}

.cookie-consent__link {
  display: inline-flex;
  align-items: center;

  margin-top: 0.65rem;

  color: #9cefff;
  font-family: "Manrope", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.cookie-consent__link:hover {
  color: var(--consent-white);
}

/* Actions */
.cookie-consent__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;

  min-width: max-content;
}

.cookie-consent__button {
  min-height: 46px;
  min-width: 150px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 0.8rem 1rem;

  border-radius: 999px;

  font-family: "Manrope", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;

  cursor: pointer;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

/* Tolak */
.cookie-consent__button[data-consent-reject] {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
}

.cookie-consent__button[data-consent-reject]:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
  color: var(--consent-white);
}

/* Terima */
.cookie-consent__button[data-consent-accept] {
  border: 1px solid transparent;

  background:
    linear-gradient(
      135deg,
      var(--consent-blue),
      var(--consent-cyan)
    );

  color: var(--consent-white);

  box-shadow: 0 12px 28px rgba(23, 110, 232, 0.28);
}

.cookie-consent__button[data-consent-accept]:hover {
  box-shadow: 0 16px 34px rgba(23, 110, 232, 0.36);
}

/* Hover hanya untuk device yang memang punya hover */
@media (hover: hover) and (pointer: fine) {
  .cookie-consent__button:hover {
    transform: translateY(-2px);
  }
}

/* Accessibility */
.cookie-consent__button:focus-visible,
.cookie-consent__link:focus-visible {
  outline: 3px solid rgba(156, 239, 255, 0.72);
  outline-offset: 3px;
}

/* Hindari bentrok dengan floating WhatsApp */
.is-consent-open .whatsapp-float {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px);
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {
  .cookie-consent {
    padding:
      0.85rem
      0.85rem
      max(0.85rem, env(safe-area-inset-bottom));
  }

  .cookie-consent__panel {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 1.1rem;

    width: 100%;
    max-height: calc(100dvh - 1.7rem);

    padding: 1.25rem;

    border-radius: 22px;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .cookie-consent__actions {
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cookie-consent__button {
    width: 100%;
    min-width: 0;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 580px) {
  .cookie-consent {
    align-items: flex-end;

    padding:
      0.65rem
      0.65rem
      max(0.65rem, env(safe-area-inset-bottom));

    background: rgba(3, 13, 30, 0.3);
  }

  .cookie-consent__panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 1.3rem);

    gap: 1rem;

    padding: 1.15rem;

    border-radius: 20px;
  }

  .cookie-consent__eyebrow {
    margin-bottom: 0.45rem;

    font-size: 0.62rem;
    letter-spacing: 0.13em;
  }

  .cookie-consent__title {
    font-size: clamp(1.55rem, 8vw, 1.9rem);
    line-height: 1.02;
  }

  .cookie-consent__description {
    margin-top: 0.55rem;

    font-size: 0.76rem;
    line-height: 1.65;
  }

  .cookie-consent__link {
    margin-top: 0.55rem;

    font-size: 0.72rem;
  }

  .cookie-consent__actions {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .cookie-consent__button {
    min-height: 44px;

    padding: 0.72rem 0.9rem;

    font-size: 0.74rem;
  }

  /* Terima diletakkan paling atas di mobile */
  .cookie-consent__button[data-consent-accept] {
    order: -1;
  }
}

/* HP pendek seperti landscape */
@media (max-height: 560px) {
  .cookie-consent {
    align-items: center;
  }

  .cookie-consent__panel {
    max-height: calc(100dvh - 1.3rem);
  }
}

/* Animasi */
@keyframes consent-panel-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent__panel {
    animation: none;
  }

  .cookie-consent__button,
  .whatsapp-float {
    transition: none;
  }
}