/* Base */
.eco-widget, .eco-widget * { box-sizing: border-box; }

/* =========================
   WIDGET UI (bottom-left)
   ========================= */
.eco-widget {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Botón flotante */
.eco-widget__toggle {
  list-style: none;
  cursor: pointer;

  width: 80px;
  height: 80px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #000;
  color: #EFF3CE;      /* color normal del icono */
  border: 2px solid #fff;
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);

  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.eco-widget__toggle::-webkit-details-marker { display: none; }

.eco-widget__icons{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ícono grande */
.eco-widget__icon{
  width: 40px;
  height: 40px;
  display: block;
}

/* Hover del botón flotante:
   - fondo blanco
   - contorno negro
   - icono #274A46 */
.eco-widget__toggle:hover{
  background: #fff;
  border-color: #000;
  color: #274A46;  /* el SVG usa currentColor */
}

/* (Opcional) focus visible similar al hover para teclado */
.eco-widget__toggle:focus-visible{
  outline: 2px solid #274A46;
  outline-offset: 3px;
}

/* Contenedor para panel + tachita externa */
.eco-widget__panel-wrap{
  position: relative;
  margin-top: 12px;
  width: 300px;
  max-width: min(86vw, 340px);
}

/* Panel */
.eco-widget__panel {
  padding: 14px 12px 12px;

  background: #000;
  color: #fff;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 34px rgba(0,0,0,0.35);
}

/* Título centrado + 18px, sin bold y con color #F9F4ED */
.eco-widget__title{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.2px;
  text-align: center;
  color: #F9F4ED;
}

/* Close: arriba del panel, alineada a la derecha */
.eco-widget__close{
  position: absolute;
  top: -50px;
  right: 0;

  appearance: none !important;
  -webkit-appearance: none !important;

  border: 2px solid rgba(239,243,206,0.95) !important;
  background: #000 !important;
  color: #EFF3CE !important;

  border-radius: 999px;
  width: 38px;
  height: 38px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  line-height: 1 !important;
  font-size: 16px !important;
  font-weight: 900 !important;

  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);

  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

/* Hover: fondo blanco + X negra */
.eco-widget__close:hover{
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}

.eco-widget__close:focus {
  outline: 2px solid rgba(239,243,206,0.90) !important;
  outline-offset: 2px;
}

/* Filas */
.eco-widget__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 10px;
  border-radius: 12px;

  border: 1px solid #274A46;
  background: rgba(255,255,255,0.04);
  margin: 10px 0;
}

/* Labels a 16px */
.eco-widget__label {
  font-size: 16px;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.eco-widget__control{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink: 0;
}

/* Toggle switch */
.eco-switch{
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;

  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.12);
  padding: 0;
}

/* Bolita centrada verticalmente */
.eco-switch::before{
  content:"";
  position:absolute;
  left: 3px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;

  transform: translate(0, -50%);
  transition: transform 180ms ease;
}

/* ON */
.eco-switch[aria-checked="true"]{
  background: rgba(123,160,156,0.95);
  border-color: rgba(123,160,156,0.95);
}
.eco-switch[aria-checked="true"]::before{
  transform: translate(20px, -50%);
}

.eco-switch:focus{
  outline: 2px solid rgba(255,255,255,0.75);
  outline-offset: 2px;
}

/* Hint centrado */
.eco-widget__hint {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: 0.82;
  text-align: center;
}

/* Mobile */
@media (max-width: 480px) {
  .eco-widget { left: 12px; bottom: 12px; }

  .eco-widget__toggle { width: 68px; height: 68px; }
  .eco-widget__icon { width: 34px; height: 34px; }

  .eco-widget__panel-wrap { width: min(86vw, 320px); }

  .eco-widget__close{
    top: -46px;
    right: 0;
    width: 36px;
    height: 36px;
  }
}

/* =========================
   ECO MODES (site-wide)
   ========================= */
html.eco-gray { filter: grayscale(100%); }
html.eco-contrast { filter: contrast(1.25); }
html.eco-gray.eco-contrast { filter: grayscale(100%) contrast(1.25); }

html.eco-contrast a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
html.eco-contrast :focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

html.eco-motion * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
