/* ============================================
   COOKIE BANNER — Teorema Fine Jewellery
   ============================================ */

#tfj-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--blu-notte);
  color: var(--bianco-perla);
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

#tfj-cookie-banner.is-visible {
  transform: translateY(0);
}

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

.cookie-banner__text p {
  font-size: 0.88rem;
  color: rgba(246,244,239,0.85);
  line-height: 1.6;
  margin: 0;
}

.cookie-banner__text a {
  color: var(--oro-satinato);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.cookie-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.cookie-btn--accept {
  background: var(--oro-satinato);
  color: var(--blu-notte);
  border: 1px solid var(--oro-satinato);
}

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

.cookie-btn--necessary {
  background: transparent;
  color: var(--bianco-perla);
  border: 1px solid rgba(246,244,239,0.4);
}

.cookie-btn--necessary:hover {
  border-color: var(--bianco-perla);
}

.cookie-btn--manage {
  background: transparent;
  color: rgba(246,244,239,0.6);
  border: none;
  padding: 0.7rem 0.5rem;
  font-size: 0.75rem;
  text-decoration: underline;
}

.cookie-btn--manage:hover {
  color: var(--bianco-perla);
}

/* ===== MODALE PREFERENZE ===== */

#tfj-cookie-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(12,35,64,0.75);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#tfj-cookie-modal.is-open {
  display: flex;
}

.cookie-modal__box {
  background: var(--bianco-perla);
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-modal__title {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  color: var(--blu-notte);
  margin-bottom: 0.5rem;
}

.cookie-modal__subtitle {
  font-size: 0.88rem;
  color: var(--titanio-scuro);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.cookie-category {
  border-top: 1px solid rgba(12,35,64,0.1);
  padding: 1rem 0;
}

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

.cookie-category__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blu-notte);
}

.cookie-category__desc {
  font-size: 0.82rem;
  color: var(--titanio-scuro);
  line-height: 1.5;
}

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

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

.cookie-toggle__slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cookie-toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle__slider {
  background: var(--oro-satinato);
}

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

.cookie-toggle input:disabled + .cookie-toggle__slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(12,35,64,0.1);
}

/* ===== LINK RIAPERTURA PREFERENZE (nel footer) ===== */
.cookie-reopen {
  font-size: 0.78rem;
  color: rgba(246,244,239,0.55);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
}

.cookie-reopen:hover {
  color: var(--oro-satinato);
}

@media (max-width: 600px) {
  #tfj-cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem;
  }

  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-btn--accept,
  .cookie-btn--necessary {
    flex: 1;
    text-align: center;
  }
}
