/* ==========================================================================
   Cookie Consent Banner — VO GROUP
   Glassmorphism style, BEM naming, responsive
   ========================================================================== */

/* --- Overlay (shown when preferences panel is expanded) --- */
.cookie-consent__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 38, 94, 0.45);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cookie-consent__overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* --- Banner Container --- */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  pointer-events: none;
  font-family: var(--font-family, 'Inter', sans-serif);
}

.cookie-consent.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* --- Inner Card (Glassmorphism) --- */
.cookie-consent__card {
  max-width: 720px;
  margin: 0 auto var(--spacing-sm, 16px);
  padding: var(--spacing-md, 24px);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 38, 94, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

/* --- Header --- */
.cookie-consent__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: var(--spacing-sm, 16px);
}

.cookie-consent__icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.cookie-consent__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary, #00387d);
  margin: 0 0 4px;
  line-height: 1.3;
}

.cookie-consent__text {
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-light, #666);
  line-height: 1.5;
  margin: 0;
}

.cookie-consent__text a {
  color: var(--color-primary, #00387d);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__text a:hover {
  color: var(--color-secondary, #45832e);
}

/* --- Buttons Row --- */
.cookie-consent__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: var(--spacing-sm, 16px);
}

.cookie-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: var(--font-size-sm, 14px);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition, 0.2s ease-in-out);
  white-space: nowrap;
  line-height: 1.4;
}

.cookie-consent__btn--accept {
  background: var(--color-primary, #00387d);
  color: var(--color-white, #fff);
}

.cookie-consent__btn--accept:hover {
  background: #004a9e;
  box-shadow: 0 4px 12px rgba(0, 56, 125, 0.3);
}

.cookie-consent__btn--reject {
  background: transparent;
  color: var(--color-text-light, #666);
  border: 1px solid var(--color-border, #e0e0e0);
}

.cookie-consent__btn--reject:hover {
  border-color: var(--color-primary, #00387d);
  color: var(--color-primary, #00387d);
}

.cookie-consent__btn--customize {
  background: transparent;
  color: var(--color-primary, #00387d);
  border: 1px solid var(--color-primary, #00387d);
}

.cookie-consent__btn--customize:hover {
  background: rgba(0, 56, 125, 0.06);
}

.cookie-consent__btn--save {
  background: var(--color-secondary, #45832e);
  color: var(--color-white, #fff);
}

.cookie-consent__btn--save:hover {
  background: #3a7226;
  box-shadow: 0 4px 12px rgba(69, 131, 46, 0.3);
}

/* --- Preferences Panel (Expandable) --- */
.cookie-consent__preferences {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.cookie-consent__preferences.is-expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: var(--spacing-sm, 16px);
}

.cookie-consent__category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.cookie-consent__category:last-child {
  border-bottom: none;
}

.cookie-consent__category-info {
  flex: 1;
  padding-right: 16px;
}

.cookie-consent__category-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #333);
  margin: 0 0 2px;
}

.cookie-consent__category-desc {
  font-size: 12px;
  color: var(--color-text-light, #666);
  margin: 0;
  line-height: 1.4;
}

/* --- iOS-Style Toggle Switch --- */
.cookie-consent__toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.cookie-consent__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-consent__toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 28px;
  transition: background 0.25s ease;
}

.cookie-consent__toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--color-white, #fff);
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-consent__toggle input:checked + .cookie-consent__toggle-slider {
  background: var(--color-secondary, #45832e);
}

.cookie-consent__toggle input:checked + .cookie-consent__toggle-slider::before {
  transform: translateX(20px);
}

.cookie-consent__toggle input:disabled + .cookie-consent__toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-consent__toggle input:disabled:checked + .cookie-consent__toggle-slider {
  background: var(--color-secondary, #45832e);
}

/* --- Always-On Label --- */
.cookie-consent__always-on {
  font-size: 11px;
  color: var(--color-secondary, #45832e);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

/* --- Re-open Cookie Preferences Button (Small icon) --- */
.cookie-consent__reopen {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border, #e0e0e0);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: all var(--transition, 0.2s ease-in-out);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  padding: 0;
}

.cookie-consent__reopen.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.cookie-consent__reopen:hover {
  box-shadow: 0 4px 20px rgba(0, 56, 125, 0.2);
  transform: scale(1.08);
  border-color: var(--color-primary, #00387d);
}

/* --- Responsive: Full-width on mobile --- */
@media (max-width: 768px) {
  .cookie-consent__card {
    margin: 0;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px;
    max-width: 100%;
  }

  .cookie-consent__actions {
    flex-direction: column;
  }

  .cookie-consent__btn {
    width: 100%;
    justify-content: center;
  }

  .cookie-consent__reopen {
    bottom: 76px; /* Above mobile contact bar */
  }
}

/* --- Fade-in animation for the card content --- */
@keyframes cookieContentFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-consent.is-visible .cookie-consent__card {
  animation: cookieContentFadeIn 0.4s ease 0.15s both;
}
