/* ============================================================
   consent-banner.css - Banner de consentimiento Andina MineTech
   Usa las variables --amt-* del sitio para integrarse a la paleta.
   WCAG 2.1 AA - mobile-first - sin dependencias.
   ============================================================ */

.amt-cc *,
.amt-cc-widget * { box-sizing: border-box; }
.amt-cc [hidden],
.amt-cc-widget[hidden] { display: none !important; }

/* ---- Contenedor: barra inferior fija ---- */
.amt-cc {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--amt-blue-deep, #0A2555);
  color: var(--white, #fff);
  font-family: var(--font-body, "IBM Plex Sans", system-ui, -apple-system, sans-serif);
  border-top: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, .55);
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.amt-cc[data-visible="true"] { transform: translateY(0); }

/* ---- Panel granular: arriba de la barra, expande hacia arriba ---- */
.amt-cc__panel {
  max-height: 0; overflow: hidden;
  transition: max-height .4s ease;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.amt-cc__panel[data-open="true"] { max-height: 72vh; overflow-y: auto; }
.amt-cc__panel-inner { max-width: 1100px; margin: 0 auto; padding: 24px; }
.amt-cc__panel-title { font-size: 17px; font-weight: 700; margin: 0 0 6px; color: var(--white, #fff); }
.amt-cc__panel-intro { font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .8); margin: 0 0 18px; }

.amt-cc__cat { padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.amt-cc__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.amt-cc__cat-title { font-size: 14px; font-weight: 600; }
.amt-cc__cat-desc { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .72); margin: 6px 0 0; }
.amt-cc__always { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--amt-teal-light, #D9EDEC); white-space: nowrap; }

/* ---- Barra principal ---- */
.amt-cc__bar {
  max-width: 1100px; margin: 0 auto; padding: 18px 24px;
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.amt-cc__text { flex: 1 1 420px; min-width: 0; }
.amt-cc__title { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--white, #fff); }
.amt-cc__body { font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .82); margin: 0; }
.amt-cc__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- Botones (Aceptar y Rechazar = mismo tamano = equal prominence) ---- */
.amt-cc__btn {
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 12px 18px; border-radius: var(--radius, 6px);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.amt-cc__btn--primary { background: var(--amt-teal, #1A8782); color: #fff; border-color: var(--amt-teal, #1A8782); }
.amt-cc__btn--primary:hover { background: var(--amt-teal-dark, #0D5C58); border-color: var(--amt-teal-dark, #0D5C58); }
.amt-cc__btn--secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.amt-cc__btn--secondary:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.amt-cc__btn--ghost { background: transparent; color: rgba(255, 255, 255, .8); border-color: transparent; text-decoration: underline; padding: 12px 8px; }
.amt-cc__btn--ghost:hover { color: #fff; }

.amt-cc__panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.amt-cc__link { color: var(--amt-teal-light, #D9EDEC); font-size: 13px; text-decoration: underline; }
.amt-cc__link:hover { color: #fff; }

/* ---- Toggle accesible (input real type=checkbox) ---- */
.amt-cc__switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.amt-cc__switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.amt-cc__slider { position: absolute; inset: 0; background: rgba(255, 255, 255, .25); border-radius: 999px; transition: background .2s; pointer-events: none; }
.amt-cc__slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.amt-cc__switch input:checked + .amt-cc__slider { background: var(--amt-teal, #1A8782); }
.amt-cc__switch input:checked + .amt-cc__slider::before { transform: translateX(20px); }
.amt-cc__switch input:disabled { cursor: not-allowed; }
.amt-cc__switch input:disabled + .amt-cc__slider { opacity: .5; }

/* ---- Widget flotante (reabrir) abajo-izquierda ---- */
.amt-cc-widget {
  position: fixed; left: 18px; bottom: 18px; z-index: 9990;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--amt-blue-deep, #0A2555); color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, .45);
  transition: transform .2s, background .2s;
}
.amt-cc-widget:hover { transform: translateY(-2px); background: var(--amt-blue, #0C3071); }
.amt-cc-widget svg { width: 21px; height: 21px; }

/* ---- Foco visible (accesibilidad) ---- */
.amt-cc__btn:focus-visible,
.amt-cc__link:focus-visible,
.amt-cc-widget:focus-visible,
.amt-cc__switch input:focus-visible + .amt-cc__slider {
  outline: 2px solid var(--amt-teal-light, #D9EDEC); outline-offset: 2px;
}

/* ---- Responsive (mobile) ---- */
@media (max-width: 640px) {
  .amt-cc__bar { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .amt-cc__actions { flex-direction: column; }
  .amt-cc__btn { width: 100%; text-align: center; padding: 14px; }
  .amt-cc__btn--ghost { order: 3; }
  .amt-cc__panel-inner { padding: 18px 16px; }
}

/* ---- Respeto a preferencias del sistema ---- */
@media (prefers-reduced-motion: reduce) {
  .amt-cc, .amt-cc__panel, .amt-cc__slider::before, .amt-cc-widget { transition: none; }
}
@media (forced-colors: active) {
  .amt-cc { border-top: 1px solid CanvasText; }
  .amt-cc__btn, .amt-cc-widget { border: 1px solid ButtonText; }
}
