/* Cookie consent banner — visual only, no backend enforcement (SIT-032) */

#cookie-consent {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1100px;
  z-index: 99999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: left .45s cubic-bezier(.4,0,.2,1), transform .45s cubic-bezier(.4,0,.2,1), width .45s cubic-bezier(.4,0,.2,1);
}

/* ---------- mini / collapsed state ---------- */
#cookie-consent.cc-mini {
  left: 16px;
  transform: none;
  width: 64px;
  max-width: 64px;
  cursor: pointer;
}

#cookie-consent.cc-mini .cc-expand {
  display: none;
}

#cookie-consent.cc-mini .cc-bar {
  width: 64px;
  height: 64px;
  padding: 0;
  justify-content: center;
}

#cookie-consent.cc-mini .cc-bar-text,
#cookie-consent.cc-mini .cc-bar-actions {
  display: none;
}

/* ---------- fading step (text/buttons fade out before the bar shrinks) ---------- */
.cc-bar-text, .cc-bar-actions {
  transition: opacity .3s ease;
}

#cookie-consent.cc-fading .cc-bar-text,
#cookie-consent.cc-fading .cc-bar-actions {
  opacity: 0;
}

#cookie-consent.cc-mini .cc-bar-icon {
  width: 64px;
  height: 64px;
}

#cookie-consent.cc-mini .cc-bar-icon img {
  width: 36px;
  height: 36px;
}

/* ---------- shared panel surface (policy strip + category cards) ---------- */
.cc-panel {
  background: #ffffff;
  border: 1px solid #e2e2e5;
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ---------- top policy strip ---------- */
.cc-policy {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
}

.cc-policy img {
  width: 44px;
  height: 31px;
  flex-shrink: 0;
}

.cc-policy-title {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 4px;
}

.cc-policy-desc {
  font-size: 12.5px;
  color: #333333;
  line-height: 1.6;
}

.cc-policy-desc b, .cc-policy-desc a {
  color: #000000;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* ---------- category cards ---------- */
.cc-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cc-card {
  padding: 16px 18px;
}

.cc-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.cc-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #000000;
}

.cc-card-desc {
  font-size: 11.5px;
  color: #333333;
  line-height: 1.6;
}

.cc-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #e5e5ea;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color .25s ease;
}

.cc-toggle img {
  position: absolute;
  top: 50%;
  left: -5px;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
  transition: left .25s ease;
  display: block;
}

.cc-toggle.cc-on {
  background: #f3dfc7;
}

.cc-toggle.cc-on img {
  left: 19px;
}

.cc-toggle[disabled] {
  cursor: default;
  opacity: 0.9;
}

/* ---------- bottom bar (always visible) ---------- */
.cc-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 14px 10px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: width .45s cubic-bezier(.4,0,.2,1), height .45s cubic-bezier(.4,0,.2,1), padding .45s cubic-bezier(.4,0,.2,1);
}

.cc-bar-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background-color: #f7f7f8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-bar-icon img {
  width: 32px;
  height: 32px;
}

.cc-bar-text {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-bar-title {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  line-height: 1.2;
}

.cc-bar-desc {
  font-size: 12px;
  color: #333333;
  line-height: 1.4;
  font-weight: 400;
}

.cc-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

button.cc-btn {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  background-color: #ffffff;
  background-clip: padding-box;
  border-style: solid;
  border-width: 1px;
  border-color: #d1d1d6;
  white-space: nowrap;
  overflow: hidden;
}

button.cc-btn-reject {
  border-top-left-radius: 22px;
  border-bottom-left-radius: 22px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  color: #000000;
  padding: 0 20px;
}

button.cc-btn-reject:hover { background-color: #f4f4f6; }

button.cc-btn-reject.cc-flash-reject {
  background-color: #e11d1d;
  border-color: #e11d1d;
  color: #ffffff;
}

button.cc-btn-settings {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 0 11px;
  color: #333333;
}

button.cc-btn-settings:hover { background-color: #f4f4f6; }

button.cc-btn-accept {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  border-top-right-radius: 22px;
  border-bottom-right-radius: 22px;
  padding: 0 22px;
}

button.cc-btn-accept:hover { background-color: #222222; }

button.cc-btn-accept.cc-flash-accept {
  background-color: #1a9c4a;
  border-color: #1a9c4a;
  color: #ffffff;
}

/* ---------- expand/collapse animation ---------- */
.cc-expand {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .5s cubic-bezier(.4,0,.2,1), opacity .4s ease;
}

.cc-expand > * {
  overflow: hidden;
  min-height: 0;
  transform: translateY(10px);
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}

#cookie-consent.cc-open .cc-expand {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .5s cubic-bezier(.4,0,.2,1), opacity .18s ease;
}

#cookie-consent.cc-open .cc-expand > * {
  transform: translateY(0);
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .cc-categories { grid-template-columns: 1fr; }
}

@media (max-width: 868px) {
  .cc-bar {
    border-radius: 24px;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .cc-bar-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
}

@media (max-width: 560px) {
  #cookie-consent { bottom: 0; width: 100%; max-width: 100%; }
  .cc-policy, .cc-card { border-radius: 20px; }
  .cc-bar { border-radius: 24px 24px 0 0; }
  .cc-bar-actions .cc-btn { flex: 1; }
}
