/**
 * Estilos para el sistema de consentimiento de cookies
 * Compatible con el diseño de Perruquers Mora
 */

/* ============================================
   BANNER DE COOKIES
   ============================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  border-top: 3px solid #2c2c2c;
}

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

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.cookie-banner-text h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: #2c2c2c;
  margin: 0 0 10px 0;
}

.cookie-banner-text p {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0;
  max-width: 700px;
}

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

/* ============================================
   BOTONES
   ============================================ */

.cookie-btn {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-btn-primary {
  background: #2c2c2c;
  color: #ffffff;
}

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

.cookie-btn-secondary {
  background: transparent;
  color: #2c2c2c;
  border: 2px solid #2c2c2c;
}

.cookie-btn-secondary:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
}

.cookie-btn-text {
  background: transparent;
  color: #666;
  text-decoration: underline;
  padding: 12px 16px;
}

.cookie-btn-text:hover {
  color: #2c2c2c;
}

/* ============================================
   MODAL
   ============================================ */

.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.cookie-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

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

.cookie-modal-header {
  padding: 30px 40px 20px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #2c2c2c;
  margin: 0;
}

.cookie-modal-close {
  background: none;
  border: none;
  font-size: 36px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  line-height: 1;
}

.cookie-modal-close:hover {
  color: #2c2c2c;
}

.cookie-modal-body {
  padding: 30px 40px;
  overflow-y: auto;
  flex: 1;
}

.cookie-modal-intro {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 30px 0;
}

/* ============================================
   CATEGORÍAS DE COOKIES
   ============================================ */

.cookie-category {
  margin-bottom: 25px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.cookie-category:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cookie-category-header {
  padding: 20px;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-category-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 15px;
}

.cookie-category-info h3 {
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #2c2c2c;
  margin: 0;
  flex: 1;
}

.cookie-category-status {
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  background: #e5e5e5;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-category-description {
  padding: 20px;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
}

.cookie-category-description p {
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: #2c2c2c;
}

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

.cookie-toggle input:focus + .cookie-toggle-slider {
  box-shadow: 0 0 0 3px rgba(44, 44, 44, 0.1);
}

/* ============================================
   FOOTER DEL MODAL
   ============================================ */

.cookie-modal-footer-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

.cookie-modal-footer-info p {
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  color: #666;
  margin: 0;
}

.cookie-modal-footer-info a {
  color: #2c2c2c;
  text-decoration: underline;
  font-weight: 500;
}

.cookie-modal-footer-info a:hover {
  color: #000;
}

.cookie-modal-footer {
  padding: 20px 40px 30px;
  border-top: 1px solid #e5e5e5;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================
   BOTÓN FLOTANTE DE CONFIGURACIÓN
   ============================================ */

.cookie-settings-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background: #2c2c2c;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-settings-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  background: #1a1a1a;
}

.cookie-settings-trigger:active {
  transform: scale(0.95);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    padding: 25px 20px;
    gap: 20px;
  }

  .cookie-banner-text h3 {
    font-size: 20px;
  }

  .cookie-banner-text p {
    font-size: 13px;
  }

  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    justify-content: center;
  }

  .cookie-modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .cookie-modal-header {
    padding: 20px 20px 15px;
  }

  .cookie-modal-header h2 {
    font-size: 22px;
  }

  .cookie-modal-body {
    padding: 20px;
  }

  .cookie-modal-footer {
    padding: 15px 20px 20px;
    flex-direction: column-reverse;
  }

  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }

  .cookie-category-header {
    padding: 15px;
  }

  .cookie-category-description {
    padding: 15px;
  }

  .cookie-settings-trigger {
    width: 50px;
    height: 50px;
    font-size: 24px;
    bottom: 15px;
    left: 15px;
  }
}

@media (max-width: 480px) {
  .cookie-banner-text h3 {
    font-size: 18px;
  }

  .cookie-banner-text p {
    font-size: 12px;
  }

  .cookie-btn {
    font-size: 13px;
    padding: 10px 20px;
  }

  .cookie-modal-header h2 {
    font-size: 20px;
  }

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

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */

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

.cookie-banner.visible {
  animation: fadeIn 0.3s ease;
}

/* Accesibilidad */
.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.cookie-modal-close:focus {
  outline: 2px solid #2c2c2c;
  outline-offset: 2px;
}

/* Para usuarios que prefieren movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-modal,
  .cookie-btn,
  .cookie-settings-trigger,
  .cookie-toggle-slider,
  .cookie-toggle-slider:before {
    transition: none;
    animation: none;
  }
}
