/* ============================================
   Cookie Consent Banner
   Matches Surf City Pier palette
   ============================================ */

/* --- Banner --- */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(26, 60, 77, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 -4px 24px rgba(26, 60, 77, 0.25);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-body, 'Plus Jakarta Sans', -apple-system, sans-serif);
}

.consent-banner.visible {
  transform: translateY(0);
}

.consent-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.consent-text {
  flex: 1 1 400px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.consent-text a {
  color: var(--seafoam, #4BBCAA);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.consent-btn {
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.consent-btn:active {
  transform: scale(0.97);
}

.consent-btn--accept {
  background: var(--coral, #E8725C);
  color: #fff;
}

.consent-btn--accept:hover {
  background: var(--coral-hover, #D4614C);
}

.consent-btn--reject {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.consent-btn--reject:hover {
  background: rgba(255, 255, 255, 0.2);
}

.consent-btn--manage {
  background: transparent;
  color: var(--seafoam, #4BBCAA);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0.6rem 0.75rem;
}

.consent-btn--manage:hover {
  color: #fff;
}

/* --- Preferences Modal --- */
.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(26, 60, 77, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.consent-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.consent-modal {
  background: var(--warm-white, #F7F4EE);
  color: var(--text-dark, #1E3240);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 20px 60px rgba(26, 60, 77, 0.3);
  max-width: 480px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 2rem;
}

.consent-modal-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--midnight, #1A3C4D);
}

.consent-modal-desc {
  font-size: 0.875rem;
  color: var(--text-body, #3D5565);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* --- Toggle Categories --- */
.consent-category {
  border: 1px solid rgba(26, 60, 77, 0.1);
  border-radius: var(--radius-sm, 6px);
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.consent-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.consent-category-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark, #1E3240);
}

.consent-category-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--driftwood, #6D8494);
  background: var(--sand, #E8F0EC);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full, 9999px);
  flex-shrink: 0;
}

.consent-category-desc {
  font-size: 0.8rem;
  color: var(--text-body, #3D5565);
  margin-top: 0.4rem;
  line-height: 1.45;
}

/* --- Toggle Switch --- */
.consent-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.consent-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(26, 60, 77, 0.2);
  cursor: pointer;
  transition: background 0.25s;
}

.consent-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s;
}

.consent-toggle input:checked + .consent-toggle-track {
  background: var(--seafoam, #4BBCAA);
}

.consent-toggle input:checked + .consent-toggle-track::after {
  transform: translateX(20px);
}

.consent-toggle input:disabled + .consent-toggle-track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Modal Footer --- */
.consent-modal-actions {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.consent-modal-actions .consent-btn {
  flex: 1;
  text-align: center;
  min-width: 120px;
}

.consent-btn--save {
  background: var(--coastal-blue, #2E7D96);
  color: #fff;
}

.consent-btn--save:hover {
  background: #256b82;
}

/* --- Mobile --- */
@media (max-width: 600px) {
  .consent-banner {
    padding: 1rem;
  }

  .consent-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .consent-actions {
    flex-direction: column;
  }

  .consent-btn {
    width: 100%;
    text-align: center;
  }

  .consent-modal {
    padding: 1.5rem;
    margin: 1rem;
  }

  .consent-modal-actions {
    flex-direction: column;
  }
}
