/* ==========================================================================
   LOMAXFAN.COM - Cookie Consent Banner & Preference Modal
   Cumplimiento GDPR / ePrivacy - Union Europea
   ========================================================================== */

/* ---------- OVERLAY ---------- */
.lf-cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lf-cookie-overlay.lf-visible {
  opacity: 1;
  visibility: visible;
}

/* ---------- BANNER ---------- */
.lf-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  background: #fff;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  padding: 24px 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: #333;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.lf-cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.lf-cookie-banner__text {
  flex: 1 1 500px;
}

.lf-cookie-banner__text h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.lf-cookie-banner__text p {
  margin: 0;
  color: #555;
}

.lf-cookie-banner__text a {
  color: #2563eb;
  text-decoration: underline;
}

.lf-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- BUTTONS ---------- */
.lf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  white-space: nowrap;
}

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

.lf-btn--accept {
  background: #16a34a;
  color: #fff;
}

.lf-btn--accept:hover {
  background: #15803d;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.lf-btn--reject {
  background: #e5e7eb;
  color: #374151;
}

.lf-btn--reject:hover {
  background: #d1d5db;
}

.lf-btn--settings {
  background: transparent;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.lf-btn--settings:hover {
  background: #eff6ff;
}

.lf-btn--save {
  background: #2563eb;
  color: #fff;
}

.lf-btn--save:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* ---------- PREFERENCES MODAL ---------- */
.lf-cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 1000000;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 94%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.lf-cookie-modal.lf-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.lf-cookie-modal__header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.lf-cookie-modal__header h2 {
  margin: 0;
  font-size: 20px;
  color: #1a1a1a;
}

.lf-cookie-modal__header p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.lf-cookie-modal__body {
  padding: 16px 28px;
  overflow-y: auto;
  flex: 1;
}

.lf-cookie-modal__footer {
  padding: 16px 28px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- CATEGORY CARDS ---------- */
.lf-category {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.lf-category:hover {
  border-color: #93c5fd;
}

.lf-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.lf-category__info {
  flex: 1;
}

.lf-category__name {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
}

.lf-category__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.lf-category__badge--required {
  background: #dbeafe;
  color: #1d4ed8;
}

.lf-category__desc {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.45;
}

/* Toggle switch */
.lf-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  margin-left: 16px;
}

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

.lf-toggle__slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.25s;
}

.lf-toggle__slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lf-toggle input:checked + .lf-toggle__slider {
  background: #16a34a;
}

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

.lf-toggle input:disabled + .lf-toggle__slider {
  background: #93c5fd;
  cursor: not-allowed;
}

.lf-toggle input:disabled:checked + .lf-toggle__slider {
  background: #3b82f6;
}

/* Detail list within category */
.lf-category__details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  display: none;
}

.lf-category.lf-expanded .lf-category__details {
  display: block;
}

.lf-category__expand {
  background: none;
  border: none;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  font-weight: 500;
}

.lf-cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lf-cookie-table th {
  text-align: left;
  padding: 6px 8px;
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.lf-cookie-table td {
  padding: 6px 8px;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
}

/* ---------- FLOATING SETTINGS BUTTON ---------- */
.lf-cookie-settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 20px;
  line-height: 1;
}

.lf-cookie-settings-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.lf-cookie-settings-btn.lf-hidden {
  display: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .lf-cookie-banner {
    padding: 18px 16px;
  }

  .lf-cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .lf-cookie-banner__actions {
    flex-direction: column;
  }

  .lf-btn {
    width: 100%;
  }

  .lf-cookie-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: translateY(20px);
  }

  .lf-cookie-modal.lf-visible {
    transform: translateY(0);
  }
}

/* ---------- ACCESSIBILITY / FOCUS ---------- */
.lf-btn:focus-visible,
.lf-toggle input:focus-visible + .lf-toggle__slider,
.lf-cookie-settings-btn:focus-visible,
.lf-category__expand:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* ---------- PRINT ---------- */
@media print {
  .lf-cookie-banner,
  .lf-cookie-modal,
  .lf-cookie-overlay,
  .lf-cookie-settings-btn {
    display: none !important;
  }
}
