/* ============================================================
   FFG.ro — Cookie Banner
   GDPR / ePrivacy compliant
   ============================================================ */

/* ── Banner container ── */
.cookie-banner {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 9000;
  /* Fundal alb clar — iese în evidență față de orice pagină */
  background: #FFFFFF;
  border-top: 3px solid #B8963E;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.18);
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Main layer ── */
.cookie-banner__inner {
  max-width: 1120px;
  margin-inline: auto;
  /* Compact pe desktop: tot pe un rând */
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

.cookie-banner__text {
  flex: 1 1 0;
  min-width: 0;
}

.cookie-banner__title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  font-style: normal;
  color: #1A1A18;
  margin-bottom: 4px;
  letter-spacing: 0;
}

.cookie-banner__desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: #5A5A52;
  margin: 0;
}

.cookie-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: #B8963E;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s;
}

.cookie-link-btn:hover { color: #8A6A20; }

.cookie-anchor {
  display: inline;
  font-size: inherit;
  font-weight: 500;
  color: #B8963E;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.cookie-anchor:hover { color: #8A6A20; }

/* ── Action buttons — compact row ── */
.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}

/* Reject */
.cookie-btn--reject {
  background: transparent;
  border: 1px solid #C8C8C0;
  color: #5A5A52;
}

.cookie-btn--reject:hover {
  border-color: #888880;
  color: #1A1A18;
  background: #F5F4F0;
}

/* Preferences */
.cookie-btn--prefs {
  background: transparent;
  border: 1px solid #B8963E;
  color: #8A6A20;
}

.cookie-btn--prefs:hover {
  background: #F5EDD6;
  border-color: #8A6A20;
}

/* Accept — solid, impossible to miss */
.cookie-btn--accept {
  background: #B8963E;
  border: 1px solid #B8963E;
  color: #FFFFFF;
  font-weight: 600;
}

.cookie-btn--accept:hover {
  background: #8A6A20;
  border-color: #8A6A20;
}

/* ════════════════════════════════
   PREFERENCES PANEL
   ════════════════════════════════ */
.cookie-banner__prefs {
  max-width: 1120px;
  margin-inline: auto;
  padding: 0 2rem 1.25rem;
  background: #FFFFFF;
}

.cookie-prefs__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
  border-bottom: 1px solid #E8E6E0;
  margin-bottom: 0.5rem;
}

.cookie-prefs__title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  font-style: normal;
  color: #1A1A18;
}

.cookie-prefs__close {
  background: none;
  border: 1px solid #D0CEC8;
  color: #888880;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.15s, color 0.15s;
}

.cookie-prefs__close:hover {
  border-color: #888880;
  color: #1A1A18;
}

.cookie-prefs__body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Cookie category ── */
.cookie-category {
  padding-block: 0.875rem;
  border-bottom: 1px solid #F0EEE8;
}

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

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

.cookie-category__info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-category__name {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A18;
  letter-spacing: 0;
}

.cookie-category__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
}

.cookie-category__badge--required {
  background: #F5EDD6;
  color: #8A6A20;
  border: 1px solid #D4B96A;
}

.cookie-category__badge--provider {
  background: #F5F4F0;
  color: #6A6A62;
  border: 1px solid #D0CEC8;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.cookie-category__desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: #6A6A62;
  max-width: 780px;
  margin-bottom: 0.5rem;
}

/* ── Toggle switch ── */
.cookie-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cookie-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-toggle__track {
  width: 40px;
  height: 22px;
  background: #D0CEC8;
  border: 1px solid #C0BEB8;
  border-radius: 11px;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cookie-toggle__track--on {
  background: #B8963E;
  border-color: #8A6A20;
}

.cookie-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.cookie-toggle__track--on .cookie-toggle__thumb {
  transform: translateX(18px);
}

.cookie-toggle__input:checked + .cookie-toggle__track {
  background: #B8963E;
  border-color: #8A6A20;
}

.cookie-toggle__input:checked + .cookie-toggle__track .cookie-toggle__thumb {
  transform: translateX(18px);
}

.cookie-toggle__input:focus-visible + .cookie-toggle__track {
  outline: 2px solid #B8963E;
  outline-offset: 2px;
}

.cookie-toggle--locked {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Cookie details table ── */
.cookie-category__details {
  margin-top: 0.35rem;
}

.cookie-category__details summary {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #B8963E;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.cookie-category__details summary::-webkit-details-marker { display: none; }

.cookie-category__details summary::before {
  content: '+';
  font-size: 13px;
  line-height: 1;
}

.cookie-category__details[open] summary::before {
  content: '−';
}

.cookie-category__details summary:hover { color: #8A6A20; }

.cookie-table {
  width: 100%;
  margin-top: 0.6rem;
  border-collapse: collapse;
  font-size: 11px;
  color: #6A6A62;
}

.cookie-table th {
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8A6A20;
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid #E8E6E0;
}

.cookie-table td {
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid #F5F4F0;
  vertical-align: top;
  line-height: 1.5;
}

.cookie-table tr:last-child td { border-bottom: none; }

/* ── Prefs footer ── */
.cookie-prefs__footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #E8E6E0;
  flex-wrap: wrap;
}

/* ════════════════════════════════
   RE-OPEN BUTTON
   ════════════════════════════════ */
.cookie-reopen-btn {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline-start: 1.25rem;
  z-index: 8999;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px 7px 9px;
  background: #FFFFFF;
  border: 1px solid #D0CEC8;
  color: #6A6A62;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: border-color 0.15s, color 0.15s;
}

.cookie-reopen-btn:hover {
  border-color: #B8963E;
  color: #8A6A20;
}

/* ════════════════════════════════
   RESPONSIVE — MOBILE OPTIMIZAT
   ════════════════════════════════ */
@media (max-width: 700px) {
  /* Banner container — limitat la conținut, fără scroll inutil */
  .cookie-banner {
    max-height: none;
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0.875rem;
    gap: 0.6rem;
  }

  .cookie-banner__text {
    flex: none;
  }

  .cookie-banner__title {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .cookie-banner__desc {
    font-size: 11px;
    line-height: 1.45;
  }

  /* Butoane: Refuz | Accept pe un rând, Personalizează dedesubt */
  .cookie-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    width: 100%;
  }

  .cookie-btn--reject { grid-column: 1; grid-row: 1; }
  .cookie-btn--accept { grid-column: 2; grid-row: 1; }
  .cookie-btn--prefs  { grid-column: 1 / -1; grid-row: 2; }

  .cookie-btn {
    padding: 9px 6px;
    font-size: 11px;
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  /* Panou preferințe mobil */
  .cookie-banner__prefs {
    padding: 0 0.875rem 0.875rem;
  }

  .cookie-category {
    padding-block: 0.75rem;
  }

  .cookie-category__desc {
    font-size: 11px;
    line-height: 1.5;
  }

  .cookie-prefs__footer {
    flex-direction: row;
    gap: 0.35rem;
  }

  .cookie-prefs__footer .cookie-btn {
    flex: 1;
    justify-content: center;
    padding: 9px 6px;
    font-size: 11px;
  }

  .cookie-reopen-btn {
    inset-block-end: 0.75rem;
    inset-inline-start: 0.75rem;
    font-size: 10px;
    padding: 6px 9px 6px 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-toggle__track,
  .cookie-toggle__thumb,
  .cookie-btn { transition: none; }
}
