/* ==========================================================================
   COSECHAS MOCOA - SISTEMA DE CONSENTIMIENTO Y TRATAMIENTO DE DATOS
   Conforme a la Ley 1581 de 2012 (Habeas Data Colombia) y Consent Mode v2
   ========================================================================== */

/* --- BANNER FLOTANTE DE CONSENTIMIENTO --- */
.consent-banner-wrapper {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: calc(100% - 32px);
  max-width: 860px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(109, 35, 106, 0.2), 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1.5px solid rgba(109, 35, 106, 0.12);
  padding: 24px 28px;
  z-index: 99999;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  font-family: var(--font-body, 'Open Sans', sans-serif);
}

.consent-banner-wrapper.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.consent-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.consent-icon-box {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6D236A, #BB4699);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(109, 35, 106, 0.25);
}

.consent-text-box {
  flex: 1;
}

.consent-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #2C282E;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.consent-description {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #555057;
  margin: 0 0 16px 0;
}

.consent-link {
  color: #6D236A;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.consent-link:hover {
  color: #F68B1E;
}

/* Botones del Banner */
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-consent-accept {
  background: linear-gradient(135deg, #23B24A, #1d943d);
  color: #FFFFFF;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(35, 178, 74, 0.3);
}

.btn-consent-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(35, 178, 74, 0.4);
}

.btn-consent-reject {
  background: #F4F1EA;
  color: #555057;
  border: 1px solid #DED7CC;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-consent-reject:hover {
  background: #EAE4D8;
  color: #2C282E;
}

.btn-consent-settings {
  background: transparent;
  color: #6D236A;
  border: 1.5px solid #6D236A;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-consent-settings:hover {
  background: rgba(109, 35, 106, 0.08);
}

/* --- MODAL DE CONFIGURACIÓN DE PREFERENCIAS & POLÍTICA --- */
.consent-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(31, 21, 35, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.consent-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.consent-modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(109, 35, 106, 0.1);
}

.consent-modal-overlay.active .consent-modal-card {
  transform: scale(1) translateY(0);
}

.consent-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #FFF6EC, #FCF7F1);
  border-bottom: 1px solid rgba(109, 35, 106, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.consent-modal-header h3 {
  margin: 0;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.25rem;
  color: #6D236A;
  display: flex;
  align-items: center;
  gap: 10px;
}

.consent-modal-close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: #88828B;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.consent-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #2C282E;
}

.consent-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.9rem;
  color: #555057;
  line-height: 1.6;
}

.consent-modal-body h4 {
  color: #2C282E;
  margin: 16px 0 8px 0;
  font-family: var(--font-heading, 'Outfit', sans-serif);
}

.consent-modal-footer {
  padding: 16px 24px;
  background: #FCF7F1;
  border-top: 1px solid rgba(109, 35, 106, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* --- TARJETAS DE CATEGORÍAS DE COOKIES EN EL PANEL --- */
.consent-category-card {
  background: #FAFAFA;
  border: 1.5px solid #EDE8E1;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease;
}

.consent-category-card:hover {
  border-color: rgba(109, 35, 106, 0.3);
}

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

.consent-category-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 700;
  font-size: 1rem;
  color: #2C282E;
  display: flex;
  align-items: center;
  gap: 8px;
}

.consent-category-desc {
  font-size: 0.84rem;
  color: #6C6670;
  margin: 0;
  line-height: 1.45;
}

/* Toggle Switch */
.consent-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.consent-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D6D0C7;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.consent-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .consent-slider {
  background-color: #23B24A;
}

input:disabled + .consent-slider {
  background-color: #A3D8AF;
  cursor: not-allowed;
}

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

.consent-badge-required {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #EBF7EC;
  color: #23B24A;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* --- CHECKBOX DE HABEAS DATA EN EL FORMULARIO DE PEDIDO --- */
.cart-consent-group {
  margin-top: 14px;
  padding: 12px 14px;
  background: #FFF9F2;
  border: 1px solid rgba(246, 139, 30, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cart-consent-checkbox {
  margin-top: 3px;
  accent-color: #6D236A;
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex-shrink: 0;
}

.cart-consent-label {
  font-size: 0.8rem;
  color: #4A444D;
  line-height: 1.4;
  cursor: pointer;
}

.cart-consent-label a {
  color: #6D236A;
  font-weight: 700;
  text-decoration: underline;
}

.cart-consent-label a:hover {
  color: #F68B1E;
}

/* --- BOTÓN DISCRETO FLOTANTE DE CONFIGURACIÓN DE PRIVACIDAD --- */
.privacy-floating-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
  background: rgba(255, 255, 255, 0.92);
  color: #6D236A;
  border: 1px solid rgba(109, 35, 106, 0.2);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.privacy-floating-trigger:hover {
  background: #6D236A;
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(109, 35, 106, 0.3);
  transform: translateY(-2px);
}

/* Estilos de tabla en modal de política */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.82rem;
}

.legal-table th, .legal-table td {
  border: 1px solid #E2DCD3;
  padding: 8px 10px;
  text-align: left;
}

.legal-table th {
  background: #FCF7F1;
  color: #2C282E;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 640px) {
  .consent-banner-wrapper {
    bottom: 12px;
    width: calc(100% - 20px);
    padding: 18px 16px;
    border-radius: 16px;
  }
  .consent-banner-content {
    flex-direction: column;
    gap: 12px;
  }
  .consent-icon-box {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .consent-actions {
    width: 100%;
    flex-direction: column;
  }
  .btn-consent-accept, .btn-consent-reject, .btn-consent-settings {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
  .privacy-floating-trigger {
    bottom: 80px;
    left: 16px;
    padding: 6px 10px;
    font-size: 0.72rem;
  }
}
