/* ==========================================================================
   itDealSg — cookie consent banner (inc/cookies.php, assets/js/cookies.js)
   Desktop: floating card bottom-left, like the mega menu card.
   Mobile: bottom sheet over the tab bar, like the Added-to-cart sheet.
   ========================================================================== */

.itd-ck { position: fixed; left: 20px; bottom: 20px; z-index: 80; width: min(440px, calc(100% - 40px)); opacity: 0; transform: translateY(16px); transition: opacity .25s ease, transform .25s ease; }
.itd-ck.is-open { opacity: 1; transform: none; }
.itd-ck__card { background: #fff; border: 1px solid var(--itd-line); border-radius: 20px; box-shadow: 0 24px 60px rgba(11,13,18,.22); padding: 20px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 40px); overflow-y: auto; outline: none; }

.itd-ck__head { display: flex; align-items: center; gap: 12px; }
.itd-ck__ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--itd-red-soft); color: var(--itd-red); display: flex; align-items: center; justify-content: center; }
.itd-ck__title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: var(--itd-ink); }
.itd-ck__text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--itd-ink-3); }
.itd-body .itd-ck__text a { color: var(--itd-red); font-weight: 600; white-space: nowrap; }
.itd-body .itd-ck__text a:hover { color: var(--itd-red-dark); text-decoration: underline; }

/* Settings: one row per category with a switch */
.itd-ck__prefs { display: flex; flex-direction: column; border-top: 1px solid var(--itd-line); }
.itd-ck__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--itd-line); cursor: pointer; }
.itd-ck__rowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.itd-ck__rowtext strong { font-size: 14px; font-weight: 600; color: var(--itd-ink); }
.itd-ck__rowtext small { font-size: 13px; line-height: 1.45; color: var(--itd-muted); }
.itd-ck__switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; width: 40px; height: 24px; border-radius: 12px; background: #C9CDD4; margin: 0; cursor: pointer; transition: background .15s; }
.itd-ck__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.itd-ck__switch:checked { background: var(--itd-green); }
.itd-ck__switch:checked::after { left: 19px; }
.itd-ck__switch:disabled { cursor: default; opacity: .55; }
.itd-body .itd-ck__switch:focus-visible { outline: 2px solid var(--itd-red); outline-offset: 2px; }

/* Buttons: Reject and Accept are the same size */
.itd-ck__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.itd-ck__actions .itd-btn { padding: 11px 10px; }

@media (max-width: 767px) {
  .itd-ck { left: 0; right: 0; bottom: 0; width: 100%; transform: translateY(100%); }
  .itd-ck__card { border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(11,13,18,.22); padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 85vh; }
  .itd-ck__head { gap: 10px; }
  .itd-ck__ico { width: 36px; height: 36px; }
  .itd-ck__title { font-size: 16px; }
  .itd-ck__text { font-size: 13.5px; }
  /* Reject | Accept all, then Settings / Save choices across the full width */
  .itd-ck__actions { grid-template-columns: 1fr 1fr; }
  .itd-ck__actions [data-itd-ck-settings], .itd-ck__actions [data-itd-ck-save] { grid-column: 1 / -1; order: 3; }
  .itd-ck__actions .itd-btn { padding: 13px 10px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .itd-ck, .itd-ck__switch, .itd-ck__switch::after { transition: none; }
}
