/**
 * PORTOCARRERO WEB - COOKIES BANNER & MODAL
 * Diseño industrial premium RGPD-compliant
 * Minimalista, profesional, accesible
 */

/* ============================================
   COOKIE BANNER - BOTTOM BAR
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(0, 0, 0, 0.98) 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(58, 194, 248, 0.2);
  padding: 2rem;
  z-index: 10000;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-banner-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.cookie-banner-text {
  flex: 1;
  max-width: 800px;
}

.cookie-banner-title {
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.cookie-banner-desc {
  font-size: clamp(0.875rem, 1vw, 0.9375rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.cookie-link {
  color: #3ac2f8;
  text-decoration: none;
  border-bottom: 1px solid rgba(58, 194, 248, 0.4);
  transition: all 0.3s ease;
}

.cookie-link:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.cookie-banner-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* ============================================
   BOTONES COOKIES
   ============================================ */
.btn-cookie {
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  white-space: nowrap;
  border-radius: 0;
}

.btn-cookie-accept {
  background: #3ac2f8;
  color: #0a0a0a;
  border-color: #3ac2f8;
}

.btn-cookie-accept:hover {
  background: #ffffff;
  color: #0a0a0a;
  border-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(58, 194, 248, 0.4);
}

.btn-cookie-reject {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-cookie-reject:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-cookie-configure {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-cookie-configure:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

/* ============================================
   MODAL DE COOKIES
   ============================================ */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.cookie-modal-container {
  position: relative;
  background: #ffffff;
  max-width: 700px;
  width: calc(100% - 3rem);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: slideUpModal 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes slideUpModal {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* HEADER */
.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.cookie-modal-header h2 {
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  font-weight: 700;
  color: #0a0a0a;
  letter-spacing: -0.025em;
  margin: 0;
}

.cookie-modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
}

.cookie-modal-close:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.2);
  color: #0a0a0a;
  transform: rotate(90deg);
}

/* BODY */
.cookie-modal-body {
  padding: 2rem 2.5rem;
  overflow-y: auto;
  flex: 1;
}

.cookie-modal-intro {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #404040;
  margin-bottom: 2rem;
}

/* CATEGORÍAS DE COOKIES */
.cookie-category {
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.cookie-category:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

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

.cookie-category-title-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.cookie-category h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #0a0a0a;
  margin: 0;
}

.cookie-status {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cookie-status-always {
  background: rgba(58, 194, 248, 0.1);
  color: #2da8d8;
}

.cookie-category-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #666;
  margin: 0;
}

/* SWITCH TOGGLE */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.cookie-slider:before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-slider {
  background: #3ac2f8;
}

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

.cookie-switch input:disabled + .cookie-slider {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ENLACES */
.cookie-modal-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.875rem;
}

.cookie-modal-links a {
  color: #3ac2f8;
  text-decoration: none;
  border-bottom: 1px solid rgba(58, 194, 248, 0.3);
  transition: all 0.3s ease;
}

.cookie-modal-links a:hover {
  color: #2da8d8;
  border-bottom-color: #2da8d8;
}

.cookie-modal-links span {
  color: rgba(0, 0, 0, 0.2);
}

/* FOOTER */
.cookie-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2.5rem 2.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.btn-cookie-save {
  flex: 1;
  background: #0a0a0a;
  color: #ffffff;
  border-color: #0a0a0a;
}

.btn-cookie-save:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-cookie-reject-modal {
  background: transparent;
  color: #666;
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-cookie-reject-modal:hover {
  background: #f5f5f5;
  color: #0a0a0a;
  border-color: rgba(0, 0, 0, 0.3);
}

.btn-cookie-accept-modal {
  background: #3ac2f8;
  color: #0a0a0a;
  border-color: #3ac2f8;
}

.btn-cookie-accept-modal:hover {
  background: #2da8d8;
  border-color: #2da8d8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 194, 248, 0.4);
}

/* ============================================
   BOTÓN FLOTANTE DE CONTACTO (SOLO MÓVIL)
   ============================================ */
.contact-float-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: #3ac2f8;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: none; /* Oculto por defecto en desktop */
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(58, 194, 248, 0.4);
  transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 9999;
}

.contact-float-btn:hover {
  background: #2da8d8;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(58, 194, 248, 0.6);
}

/* DESACTIVADO - Ahora solo usamos el botón de WhatsApp del footer */
/* @media (max-width: 768px) {
  .contact-float-btn {
    display: flex;
  }
} */

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 1.5rem;
  }

  .cookie-banner-content {
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
  }

  .cookie-banner-text {
    max-width: 100%;
  }

  .cookie-banner-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-cookie {
    width: 100%;
    padding: 1rem;
    text-align: center;
  }

  .cookie-modal-container {
    width: calc(100% - 2rem);
    max-height: 90vh;
  }

  .cookie-modal-header {
    padding: 2rem 1.5rem 1rem;
  }

  .cookie-modal-body {
    padding: 1.5rem;
  }

  .cookie-modal-footer {
    flex-direction: column;
    padding: 1rem 1.5rem 2rem;
  }

  .cookie-category {
    padding: 1.5rem;
  }

  .cookie-category-header {
    flex-wrap: wrap;
  }

  .contact-float-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 480px) {
  .cookie-banner {
    padding: 1.25rem;
  }

  .cookie-modal-header h2 {
    font-size: 1.375rem;
  }

  .cookie-modal-header {
    padding: 1.5rem 1.25rem 1rem;
  }

  .cookie-modal-body {
    padding: 1.25rem;
  }

  .cookie-modal-footer {
    padding: 1rem 1.25rem 1.5rem;
  }

  .cookie-category {
    padding: 1.25rem;
  }

  .cookie-modal-links {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .cookie-modal-links span {
    display: none;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-modal,
  .cookie-modal-container,
  .btn-cookie,
  .cookie-slider,
  .contact-float-btn {
    animation: none;
    transition: none;
  }
}

/* Focus visible para accesibilidad */
.btn-cookie:focus-visible,
.cookie-modal-close:focus-visible,
.cookie-switch input:focus-visible + .cookie-slider,
.contact-float-btn:focus-visible {
  outline: 3px solid #3ac2f8;
  outline-offset: 2px;
}
