/* =============================================================
   GNJOY Cookie Consent (stand-alone, prefix gg-cookie)
   -------------------------------------------------------------
   1. Banner box
   2. Text
   3. Preferences (toggle switches)
   4. Buttons
   5. Footer "cookie settings" link
   6. Responsive
   ============================================================= */
.gg-cookie {
  --gc-primary: #4f6bff;
  --gc-primary-dark: #3a55e6;
  --gc-text: #2b3a55;
  --gc-muted: #6b7890;
  --gc-line: #e3e8f2;

  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  font-family: "Kanit", system-ui, sans-serif;
}

.gg-cookie[hidden] {
  display: none;
}


/* =============================================================
   1. Banner box
   ============================================================= */
.gg-cookie__box {
  width: 100%;
  max-width: 760px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff;
  color: var(--gc-text);
  box-shadow:
    0 18px 50px rgba(20, 40, 90, .22),
    0 0 0 1px rgba(20, 40, 90, .06);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity .35s cubic-bezier(.22, 1, .36, 1),
    transform .35s cubic-bezier(.22, 1, .36, 1);
}

.gg-cookie.is-show .gg-cookie__box {
  opacity: 1;
  transform: none;
}


/* =============================================================
   2. Text
   ============================================================= */
.gg-cookie__main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.gg-cookie__icon {
  flex: none;
  width: 40px;
  height: 40px;
}

.gg-cookie__title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
}

.gg-cookie__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gc-muted);
}

.gg-cookie__desc a {
  color: var(--gc-primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* =============================================================
   3. Preferences (toggle switches)
   ============================================================= */
.gg-cookie__prefs {
  margin-top: 14px;
  border-top: 1px solid var(--gc-line);
}

.gg-cookie__prefs[hidden] {
  display: none;
}

.gg-cookie__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gc-line);
  cursor: pointer;
}

.gg-cookie__opt.is-locked {
  cursor: default;
}

.gg-cookie__opt-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.gg-cookie__opt-text small {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gc-muted);
}

/* switch */
.gg-cookie__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gg-cookie__switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cdd4e2;
  transition: background .2s;
}

.gg-cookie__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .2s;
}

.gg-cookie__opt input:checked + .gg-cookie__switch {
  background: var(--gc-primary);
}

.gg-cookie__opt input:checked + .gg-cookie__switch::after {
  transform: translateX(18px);
}

.gg-cookie__opt input:disabled + .gg-cookie__switch {
  opacity: .55;
}

.gg-cookie__opt input:focus-visible + .gg-cookie__switch {
  outline: 2px solid var(--gc-primary);
  outline-offset: 2px;
}


/* =============================================================
   4. Buttons
   ============================================================= */
.gg-cookie__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.gg-cookie__btn {
  padding: 8px 18px;
  border: 1.5px solid var(--gc-primary);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.gg-cookie__btn[hidden] {
  display: none;
}

.gg-cookie__btn--solid {
  background: var(--gc-primary);
  color: #fff;
}

.gg-cookie__btn--solid:hover,
.gg-cookie__btn--solid:focus-visible {
  background: var(--gc-primary-dark);
  border-color: var(--gc-primary-dark);
}

.gg-cookie__btn--ghost {
  background: #fff;
  color: var(--gc-primary);
}

.gg-cookie__btn--ghost:hover,
.gg-cookie__btn--ghost:focus-visible {
  background: #eef1ff;
}

.gg-cookie__btn--link {
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  background: none;
  color: var(--gc-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gg-cookie__btn--link:hover,
.gg-cookie__btn--link:focus-visible {
  color: var(--gc-text);
}


/* =============================================================
   5. Footer "cookie settings" link
   ============================================================= */
.gg-cookie-open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.gg-cookie-open:hover,
.gg-cookie-open:focus-visible {
  text-decoration: underline;
}


/* =============================================================
   6. Responsive
   ============================================================= */
@media (max-width: 640px) {
  .gg-cookie {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .gg-cookie__box {
    padding: 16px;
    border-radius: 16px;
  }

  .gg-cookie__icon {
    width: 32px;
    height: 32px;
  }

  .gg-cookie__actions .gg-cookie__btn--solid,
  .gg-cookie__actions .gg-cookie__btn--ghost {
    flex: 1 1 0;
  }

  .gg-cookie__btn--link {
    flex-basis: 100%;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gg-cookie__box,
  .gg-cookie__switch,
  .gg-cookie__switch::after {
    transition: none;
  }
}
