/**
 * Age & Cookie Gate for Creative Elements - front styles
 */

.zdg { --zdg-anim-speed: 450ms; }

/* ---- Overlays ------------------------------------------------------- */
.zdg-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: rgba(10, 10, 12, 0.72);
}

/* Cookie banner without a full overlay (card / bar layouts) */
.zdg-nooverlay {
  position: fixed;
  z-index: 2147482000;
  pointer-events: none;
}
.zdg-nooverlay .zdg-panel { pointer-events: auto; }

.zdg-cookie--card { left: 20px; bottom: 20px; }
.zdg-cookie--card_right { right: 20px; bottom: 20px; }
.zdg-cookie--bar { left: 0; right: 0; bottom: 0; }

/* ---- Panel ---------------------------------------------------------- */
.zdg-panel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 460px;
  padding: 32px;
  background: #fff;
  color: #4a4a4a;
  border: 1px solid #a3222f;
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.zdg-cookie--card .zdg-panel,
.zdg-cookie--card_right .zdg-panel {
  max-width: 400px;
  text-align: left;
}

.zdg-cookie--bar .zdg-panel {
  max-width: 100%;
  width: 100%;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  text-align: left;
}
.zdg-cookie--bar .zdg-panel > .zdg-text,
.zdg-cookie--bar .zdg-panel > .zdg-heading { flex: 1 1 320px; margin: 0; }
.zdg-cookie--bar .zdg-actions { margin-top: 0; }

/* ---- Typography ----------------------------------------------------- */
.zdg-logo {
  display: block;
  max-width: 160px;
  max-height: 80px;
  margin: 0 auto 18px;
  object-fit: contain;
}
.zdg-cookie .zdg-logo { margin-left: 0; }

.zdg-heading {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #141414;
}
.zdg-text {
  margin: 0 0 22px;
  font-size: 1rem;
  line-height: 1.55;
  color: #4a4a4a;
}
.zdg-text a {
  color: #a3222f;
  font-weight: 600;
  text-decoration: underline;
}

/* ---- Actions / buttons --------------------------------------------- */
.zdg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.zdg-cookie .zdg-actions { justify-content: flex-start; }

.zdg-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.1;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.08s ease;
  -webkit-appearance: none;
  appearance: none;
}
.zdg-btn:active { transform: translateY(1px); }

.zdg-btn--primary {
  background-color: #8a1a24;
  color: #fff;
}
.zdg-btn--primary:hover { background-color: #6f141c; }

.zdg-btn--secondary {
  background-color: transparent;
  color: #8a1a24;
  border-color: #8a1a24;
}
.zdg-btn--secondary:hover { background-color: #8a1a24; color: #fff; }

.zdg-btn--link {
  background: transparent;
  border-color: transparent;
  color: #8a1a24;
  text-decoration: underline;
  padding-left: 8px;
  padding-right: 8px;
}
.zdg-btn--link:hover { color: #6f141c; }

/* ---- Cookie categories --------------------------------------------- */
.zdg-cats {
  margin: 4px 0 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.zdg-cat {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.zdg-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.zdg-cat-name { font-weight: 600; color: #141414; }
.zdg-cat-desc { margin: 8px 0 0; font-size: 0.85rem; line-height: 1.45; opacity: 0.85; }
.zdg-always { font-size: 0.82rem; font-weight: 600; opacity: 0.6; white-space: nowrap; }
.zdg-cats-actions { margin-top: 4px; }

/* Toggle switch */
.zdg-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}
.zdg-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.zdg-slider {
  position: absolute;
  inset: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}
.zdg-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.zdg-switch input:checked + .zdg-slider { background-color: #8a1a24; }
.zdg-switch input:checked + .zdg-slider::before { transform: translateX(20px); }
.zdg-switch input:disabled + .zdg-slider { opacity: 0.55; cursor: not-allowed; }

/* ---- Entrance animations ------------------------------------------- */
.zdg-panel { animation-duration: var(--zdg-anim-speed); animation-fill-mode: both; }
.zdg-overlay { animation: zdgOverlayIn var(--zdg-anim-speed) both; }

.zdg-anim-fade .zdg-panel { animation-name: zdgFade; }
.zdg-anim-zoom .zdg-panel { animation-name: zdgZoom; }
.zdg-anim-slide-up .zdg-panel { animation-name: zdgSlideUp; }
.zdg-anim-slide-down .zdg-panel { animation-name: zdgSlideDown; }
.zdg-anim-bounce .zdg-panel { animation-name: zdgBounce; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1.3); }
.zdg-anim-none .zdg-panel { animation: none; }

@keyframes zdgOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zdgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zdgZoom { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes zdgSlideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zdgSlideDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zdgBounce {
  0% { opacity: 0; transform: scale(0.7); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .zdg-panel, .zdg-overlay { animation: none !important; }
}

/* Prevent background scroll while a blocking gate is open */
html.zdg-locked, body.zdg-locked { overflow: hidden !important; }

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 600px) {
  .zdg-overlay { padding: 12px; align-items: flex-end; }
  .zdg-cookie--card, .zdg-cookie--card_right { left: 10px; right: 10px; bottom: 10px; }
  .zdg-cookie--card .zdg-panel, .zdg-cookie--card_right .zdg-panel { max-width: 100%; }
  .zdg-panel { padding: 22px; }
  .zdg-heading { font-size: 1.2rem; }
  .zdg-actions { flex-direction: column; }
  .zdg-btn { width: 100%; }
  .zdg-cookie--bar .zdg-actions { flex-direction: column; width: 100%; }
}
