/* =========================================================
   DUPLO CAPITAL — Cookie Consent System
   RGPD + LSSI-CE + AEPD 2023 compliant
   ========================================================= */

/* ===== BANNER ===== */
.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
  padding: 24px 32px;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.cc-banner.visible {
  transform: translateY(0);
}
.cc-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}
.cc-banner-text {
  flex: 1;
}
.cc-banner-title {
  font-size: 16px;
  font-weight: 700;
  color: #2D2D2D;
  margin-bottom: 8px;
}
.cc-banner-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}
.cc-banner-desc a {
  color: #C9973A;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc-banner-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Shared button base */
.cc-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  text-align: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* AEPD 2023: Rechazar must be visually equal to Aceptar */
.cc-btn-reject,
.cc-btn-settings {
  background: transparent;
  border: 2px solid #C9973A;
  color: #C9973A;
}
.cc-btn-reject:hover,
.cc-btn-settings:hover {
  background: rgba(201,151,58,0.08);
}

.cc-btn-accept {
  background: #C9973A;
  border: 2px solid #C9973A;
  color: #fff;
}
.cc-btn-accept:hover {
  background: #A87830;
  border-color: #A87830;
}

/* ===== MODAL OVERLAY ===== */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.cc-overlay.visible {
  display: flex;
  animation: ccFadeIn 0.2s ease-out;
}

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

/* ===== MODAL ===== */
.cc-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: ccScaleIn 0.2s ease-out;
}

@keyframes ccScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Header */
.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e8e8e8;
}
.cc-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #2D2D2D;
}
.cc-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}
.cc-modal-close:hover { background: #f0f0f0; }

/* Body */
.cc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.cc-modal-intro {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Category item */
.cc-category {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.cc-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 16px;
  background: #fafafa;
  transition: background 0.15s;
}
.cc-category-header:hover { background: #f5f5f5; }

.cc-category-name {
  font-size: 14px;
  font-weight: 600;
  color: #2D2D2D;
  flex: 1;
}
.cc-category-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(201,151,58,0.12);
  color: #C9973A;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cc-toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.cc-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cc-toggle input:checked + .cc-toggle-slider {
  background: #C9973A;
}
.cc-toggle input:checked + .cc-toggle-slider::before {
  transform: translateX(20px);
}
.cc-toggle input:disabled + .cc-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Category description (collapsible) */
.cc-category-desc {
  display: none;
  padding: 0 20px 16px;
  font-size: 13px;
  color: #777;
  line-height: 1.6;
}
.cc-category.open .cc-category-desc {
  display: block;
}
.cc-category-header .cc-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
  color: #999;
  flex-shrink: 0;
}
.cc-category.open .cc-chevron {
  transform: rotate(180deg);
}

/* Footer */
.cc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid #e8e8e8;
  gap: 12px;
}
.cc-modal-footer a {
  font-size: 13px;
  color: #C9973A;
  text-decoration: underline;
  white-space: nowrap;
}
.cc-modal-footer-buttons {
  display: flex;
  gap: 10px;
}

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

/* Tablet */
@media (max-width: 1024px) {
  .cc-banner { padding: 20px 24px; }
  .cc-banner-inner { gap: 24px; }
}

/* Mobile */
@media (max-width: 768px) {
  .cc-banner { padding: 16px; }
  .cc-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .cc-banner-buttons {
    flex-direction: column;
    gap: 8px;
  }
  .cc-btn { width: 100%; justify-content: center; }

  .cc-overlay { padding: 0; align-items: flex-end; }
  .cc-modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }
  .cc-modal-header { padding: 16px; }
  .cc-modal-body { padding: 16px; }
  .cc-modal-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
  .cc-modal-footer a { text-align: center; margin-bottom: 8px; }
  .cc-modal-footer-buttons {
    flex-direction: column;
    gap: 8px;
  }
  .cc-modal-footer-buttons .cc-btn { width: 100%; }
}

@media (max-width: 480px) {
  .cc-banner-title { font-size: 15px; }
  .cc-banner-desc { font-size: 12px; }
  .cc-btn { font-size: 13px; padding: 11px 18px; }
  .cc-category-header { padding: 14px 16px; }
  .cc-category-name { font-size: 13px; }
}
