/* ============================================================
   Cosmo Clinic Israel — Cookie Consent UI
   Hebrew RTL · Mobile-first · Cosmo branding (terracotta + cream)
   ============================================================ */

:root {
  --cc-terracotta: #C9956A;
  --cc-terracotta-dark: #A87850;
  --cc-cream: #FAF7F4;
  --cc-cream-dark: #EEE9E2;
  --cc-charcoal: #1C1C1C;
  --cc-gray: #555;
  --cc-light-gray: #E4E4E7;
  --cc-white: #FFFFFF;
  --cc-shadow: 0 -10px 40px -10px rgba(28, 28, 28, 0.2);
  --cc-radius: 8px;
  --cc-z: 999990;
}

/* ============================================================
   BANNER — bottom-fixed, slide-up
   ============================================================ */

.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--cc-z);
  background: var(--cc-white);
  box-shadow: var(--cc-shadow);
  direction: rtl;
  text-align: right;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 3px solid var(--cc-terracotta);
}

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

.cc-banner__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cc-banner__content {
  flex: 1;
  min-width: 260px;
}

.cc-banner__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cc-charcoal);
  line-height: 1.2;
}

.cc-banner__desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cc-gray);
}

.cc-banner__link {
  color: var(--cc-terracotta);
  text-decoration: underline;
  font-weight: 500;
  margin-right: 0.4rem;
}

.cc-banner__link:hover {
  color: var(--cc-terracotta-dark);
}

.cc-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.cc-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 150ms ease-out;
  white-space: nowrap;
  line-height: 1;
}

.cc-btn--primary {
  background: var(--cc-terracotta);
  color: var(--cc-white);
}

.cc-btn--primary:hover {
  background: var(--cc-terracotta-dark);
}

.cc-btn--secondary {
  background: var(--cc-cream-dark);
  color: var(--cc-charcoal);
}

.cc-btn--secondary:hover {
  background: var(--cc-light-gray);
}

.cc-btn--ghost {
  background: transparent;
  color: var(--cc-gray);
  text-decoration: underline;
  padding: 0.65rem 0.6rem;
}

.cc-btn--ghost:hover {
  color: var(--cc-charcoal);
}

/* ============================================================
   CUSTOMIZE PANEL — full-screen modal
   ============================================================ */

.cc-panel {
  position: fixed;
  inset: 0;
  z-index: calc(var(--cc-z) + 1);
  direction: rtl;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms;
}

.cc-panel--visible {
  opacity: 1;
  pointer-events: auto;
}

.cc-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 28, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.cc-panel__sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  background: var(--cc-white);
  border-radius: var(--cc-radius) var(--cc-radius) 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-panel--visible .cc-panel__sheet {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .cc-panel__sheet {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    border-radius: var(--cc-radius);
    max-height: 80vh;
  }
  .cc-panel--visible .cc-panel__sheet {
    transform: translateY(-50%) scale(1);
  }
}

.cc-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--cc-light-gray);
  flex-shrink: 0;
}

.cc-panel__header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--cc-charcoal);
}

.cc-panel__close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--cc-gray);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
}

.cc-panel__close:hover {
  background: var(--cc-cream);
  color: var(--cc-charcoal);
}

.cc-panel__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.cc-panel__intro {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cc-gray);
}

.cc-panel__footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--cc-light-gray);
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--cc-cream);
  border-radius: 0 0 var(--cc-radius) var(--cc-radius);
}

@media (min-width: 768px) {
  .cc-panel__footer {
    border-radius: 0 0 var(--cc-radius) var(--cc-radius);
  }
}

/* ============================================================
   CATEGORY ROWS
   ============================================================ */

.cc-category {
  display: block;
  padding: 1rem;
  border: 1px solid var(--cc-light-gray);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.cc-category:hover:not(.cc-category--required) {
  border-color: var(--cc-terracotta);
  background: var(--cc-cream);
}

.cc-category--required {
  background: var(--cc-cream);
  cursor: default;
}

.cc-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.cc-category__title {
  font-weight: 700;
  color: var(--cc-charcoal);
  font-size: 0.95rem;
}

.cc-category__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--cc-gray);
}

.cc-category__note {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--cc-terracotta);
  font-weight: 600;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */

.cc-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--cc-light-gray);
  border-radius: 24px;
  transition: background 150ms;
  cursor: pointer;
}

.cc-toggle__slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  /* RTL: knob starts on the right */
  right: 3px;
  top: 3px;
  background: var(--cc-white);
  border-radius: 50%;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-toggle input:checked + .cc-toggle__slider {
  background: var(--cc-terracotta);
}

/* RTL: when checked, knob slides to the LEFT (visually "on") */
.cc-toggle input:checked + .cc-toggle__slider::before {
  transform: translateX(-20px);
}

.cc-toggle input:disabled + .cc-toggle__slider {
  background: var(--cc-terracotta);
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .cc-banner__inner {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cc-banner__title {
    font-size: 1rem;
  }

  .cc-banner__desc {
    font-size: 0.85rem;
  }

  .cc-banner__actions {
    width: 100%;
    gap: 0.4rem;
  }

  .cc-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
  }

  .cc-btn--ghost {
    flex-basis: 100%;
    order: 3;
    padding: 0.4rem;
  }

  .cc-panel__footer {
    flex-direction: column-reverse;
  }

  .cc-panel__footer .cc-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cc-banner__actions {
    flex-direction: column;
  }

  .cc-btn {
    width: 100%;
  }

  .cc-btn--ghost {
    order: 0;
  }
}

/* ============================================================
   ACCESSIBILITY — focus states
   ============================================================ */

.cc-btn:focus-visible,
.cc-toggle input:focus-visible + .cc-toggle__slider,
.cc-panel__close:focus-visible {
  outline: 2px solid var(--cc-terracotta);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cc-banner,
  .cc-panel,
  .cc-panel__sheet,
  .cc-toggle__slider,
  .cc-toggle__slider::before {
    transition: none;
  }
}
