/* ============================================================
   COOKIES GDPR — Estilos para Banner y Páginas Legales
   ============================================================ */

/* ============================================================
   BANNER DE COOKIES
   ============================================================ */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--grey-1);
  border-top: 1px solid rgba(201,168,76,0.2);
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
}

#cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner-content {
  flex: 1;
  min-width: 280px;
}

.cookie-banner-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-banner-content h4::before {
  content: '🍪';
  font-size: 1.1rem;
}

.cookie-banner-content p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.55;
  margin: 0;
}

.cookie-banner-content a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.cookie-banner-content a:hover {
  color: #e0b95a;
}

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

.cookie-btn {
  padding: 10px 20px;
  border-radius: 980px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: var(--gold);
  color: var(--black);
}

.cookie-btn-accept:hover {
  background: #e0b95a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}

.cookie-btn-reject {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1.5px solid rgba(255,255,255,0.2);
}

.cookie-btn-reject:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}

.cookie-btn-settings {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid rgba(201,168,76,0.3);
}

.cookie-btn-settings:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
}

/* ============================================================
   MODAL DE CONFIGURACIÓN DE COOKIES
   ============================================================ */
#cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

#cookie-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

#cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 10001;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s;
}

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

.cookie-modal-header {
  padding: 24px 28px;
  background: var(--grey-6);
  border-bottom: 1px solid var(--grey-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--grey-1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-modal-header h3::before {
  content: '⚙️';
}

.cookie-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--grey-5);
  color: var(--grey-2);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.cookie-modal-close:hover {
  background: var(--grey-4);
  color: var(--grey-1);
}

.cookie-modal-body {
  padding: 24px 28px;
  max-height: calc(85vh - 180px);
  overflow-y: auto;
}

.cookie-modal-body p {
  font-size: 0.88rem;
  color: var(--grey-3);
  line-height: 1.6;
  margin-bottom: 20px;
}

.cookie-option {
  padding: 18px;
  background: var(--grey-6);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}

.cookie-option:hover {
  border-color: var(--grey-4);
}

.cookie-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cookie-option-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-option-title h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--grey-1);
  margin: 0;
}

.cookie-option-icon {
  font-size: 1.1rem;
}

.cookie-option p {
  font-size: 0.82rem;
  color: var(--grey-3);
  line-height: 1.55;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--grey-4);
  border-radius: 26px;
  transition: background 0.3s;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--gold);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-required-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--grey-3);
  background: var(--grey-5);
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-modal-footer {
  padding: 18px 28px;
  background: var(--grey-6);
  border-top: 1px solid var(--grey-5);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============================================================
   PÁGINAS LEGALES (Privacidad y Cookies)
   ============================================================ */
#legal-page {
  padding-top: 120px;
  padding-bottom: 80px;
  min-height: 100vh;
  background: var(--white);
}

.legal-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--grey-5);
}

.legal-header .section-title {
  margin-bottom: 12px;
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--grey-3);
}

.legal-content {
  max-width: 800px;
}

.legal-section {
  margin-bottom: 40px;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--grey-1);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-2);
  margin: 20px 0 12px;
}

.legal-section p {
  font-size: 0.93rem;
  color: var(--grey-3);
  line-height: 1.7;
  margin-bottom: 14px;
}

.legal-section ul {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}

.legal-section ul li {
  font-size: 0.9rem;
  color: var(--grey-3);
  line-height: 1.65;
  padding-left: 20px;
  position: relative;
  margin-bottom: 10px;
}

.legal-section ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

.legal-section ul li strong {
  color: var(--grey-1);
}

.legal-info-box {
  background: var(--grey-6);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  border-left: 3px solid var(--gold);
  margin: 16px 0;
}

.legal-info-box p {
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.legal-info-box p:last-child {
  margin-bottom: 0;
}

.legal-warning {
  background: rgba(255, 200, 80, 0.1);
  border: 1px solid rgba(255, 200, 80, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.88rem;
  color: var(--grey-2);
  line-height: 1.6;
}

.legal-purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.legal-purpose-card {
  background: var(--grey-6);
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1px solid var(--grey-5);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.legal-purpose-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(201,168,76,0.1);
}

.purpose-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 10px;
}

.legal-purpose-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--grey-1);
  margin-bottom: 8px;
}

.legal-purpose-card p {
  font-size: 0.82rem;
  color: var(--grey-3);
  line-height: 1.5;
  margin-bottom: 10px;
}

.legal-basis {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.right-card {
  background: var(--grey-6);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--grey-5);
}

.right-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--grey-1);
  margin-bottom: 6px;
}

.right-card p {
  font-size: 0.78rem;
  color: var(--grey-3);
  margin: 0;
  line-height: 1.5;
}

/* Categorías de cookies */
.cookie-category {
  margin: 24px 0;
  background: var(--grey-6);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--grey-5);
}

.cookie-category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.cookie-category-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--grey-1);
  margin: 0;
}

.cookie-icon {
  font-size: 1.5rem;
}

.cookie-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-badge.required {
  background: rgba(80, 200, 120, 0.15);
  color: #065f46;
}

.cookie-badge.optional {
  background: rgba(201, 168, 76, 0.15);
  color: #92700c;
}

.cookie-category > p {
  font-size: 0.85rem;
  color: var(--grey-3);
  line-height: 1.6;
  margin-bottom: 16px;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cookie-table th,
.cookie-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--grey-5);
}

.cookie-table th {
  background: var(--grey-5);
  font-weight: 700;
  color: var(--grey-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-table td {
  color: var(--grey-3);
}

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

.browser-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.browser-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grey-6);
  border: 1px solid var(--grey-5);
  border-radius: 980px;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--grey-2);
  transition: border-color 0.2s, background 0.2s;
}

.browser-link:hover {
  border-color: var(--gold);
  background: var(--white);
}

.legal-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--grey-5);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.legal-footer .btn-ghost {
  background: var(--grey-6);
  color: var(--grey-2);
  border: 1.5px solid var(--grey-5);
}

.legal-footer .btn-ghost:hover {
  background: var(--grey-5);
  color: var(--grey-1);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .cookie-banner-inner {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .cookie-banner-actions {
    width: 100%;
    justify-content: center;
  }
  
  .cookie-btn {
    flex: 1;
    min-width: 100px;
  }
  
  #cookie-modal {
    width: 95%;
    max-height: 90vh;
  }
  
  .cookie-modal-body {
    max-height: calc(90vh - 200px);
  }
  
  .cookie-modal-footer {
    flex-direction: column;
  }
  
  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
  
  .legal-purpose-grid,
  .rights-grid {
    grid-template-columns: 1fr;
  }
  
  .cookie-table {
    font-size: 0.75rem;
  }
  
  .cookie-table th,
  .cookie-table td {
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  .cookie-banner-actions {
    flex-direction: column;
  }
  
  .cookie-btn {
    width: 100%;
  }
  
  .browser-links {
    flex-direction: column;
  }
  
  .browser-link {
    width: 100%;
    justify-content: center;
  }
}
