/* ==========================================================
   TRUFFLE WEEK — COOKIE BANNER
   File: /public_html/cookie-banner.css
   Conforme Linee guida Garante Privacy 10/06/2021
   ========================================================== */

/* Overlay di sfondo */
.tw-cookie-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 43, 31, 0.4);
  z-index: 99998;
}
.tw-cookie-overlay.active { display: block; }

/* Banner — Livello 1 */
.tw-cookie-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #F5EDD6;
  border-top: 3px solid #C8982A;
  padding: 24px 32px;
  z-index: 99999;
  font-family: 'Lora', Georgia, serif;
  color: #3D2B1F;
  box-shadow: 0 -4px 20px rgba(61, 43, 31, 0.15);
}
.tw-cookie-banner.active { display: block; }

.tw-cookie-banner__text {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 800px;
}

.tw-cookie-banner__text a {
  color: #C8982A;
  text-decoration: underline;
}

.tw-cookie-banner__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* IMPORTANTE: Pari evidenza — stesso stile per Accetta e Rifiuta */
.tw-cookie-btn {
  font-family: 'Lora', Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.tw-cookie-btn:hover { opacity: 0.85; }

/* Accetta e Rifiuta: IDENTICI per colore, dimensione, font */
.tw-cookie-btn--accept,
.tw-cookie-btn--reject {
  background: #C8982A;
  color: #FFFFFF;
}

/* Personalizza: stile secondario ma comunque ben visibile */
.tw-cookie-btn--customize {
  background: transparent;
  color: #3D2B1F;
  border: 2px solid #C8982A;
}

/* Pannello — Livello 2 */
.tw-cookie-panel {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #F5EDD6;
  border: 2px solid #C8982A;
  border-radius: 8px;
  padding: 32px;
  z-index: 100000;
  font-family: 'Lora', Georgia, serif;
  color: #3D2B1F;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(61, 43, 31, 0.25);
}
.tw-cookie-panel.active { display: block; }

.tw-cookie-panel__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #3D2B1F;
}

.tw-cookie-panel__subtitle {
  font-size: 13px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Categoria cookie */
.tw-cookie-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #E8E0D0;
}
.tw-cookie-category:last-of-type { border-bottom: none; }

.tw-cookie-category__info { flex: 1; padding-right: 16px; }

.tw-cookie-category__name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tw-cookie-category__desc {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* Toggle switch */
.tw-toggle { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.tw-toggle input { opacity: 0; width: 0; height: 0; }
.tw-toggle__slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}
.tw-toggle__slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.tw-toggle input:checked + .tw-toggle__slider { background: #C8982A; }
.tw-toggle input:checked + .tw-toggle__slider::before { transform: translateX(22px); }
.tw-toggle input:disabled + .tw-toggle__slider { background: #C8982A; opacity: 0.6; cursor: default; }
.tw-toggle input:disabled:checked + .tw-toggle__slider::before { transform: translateX(22px); }

/* Pulsanti pannello */
.tw-cookie-panel__buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.tw-cookie-panel__link {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  color: #C8982A;
  text-decoration: underline;
  text-align: center;
}

/* Footer link */
.tw-cookie-footer-link {
  cursor: pointer;
  color: #C8982A;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: 'Lora', Georgia, serif;
  font-size: inherit;
  padding: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .tw-cookie-banner { padding: 16px 20px; }
  .tw-cookie-banner__buttons { flex-direction: column; }
  .tw-cookie-btn { width: 100%; text-align: center; }
  .tw-cookie-panel { padding: 24px 20px; width: 95%; }
  .tw-cookie-panel__buttons { flex-direction: column; }
  .tw-cookie-panel__buttons .tw-cookie-btn { width: 100%; text-align: center; }
}
