/* === BOTÓN OPCIONES AVANZADAS – DISEÑO MODERNO VERDE === */
.qr-advanced-toggle {
  all: unset;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 5px 14px !important;      /* MÁS PEQUEÑO */
  min-height: 32px !important;
  max-width: 100%;

  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a); /* VERDE */
  color: #ffffff;

  font-size: 13px;
  font-weight: 600;
  line-height: 1;

  cursor: pointer;
  box-shadow: 0 4px 10px rgba(34,197,94,.35);
  transition: all .2s ease;

  margin-top: 6px;
  width: 100%;
}

.qr-advanced-toggle:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 16px rgba(34,197,94,.45);
}

.qr-advanced-toggle:active {
  transform: scale(.97);
}

/* Icono usando ::after */
.qr-advanced-toggle::after {
  content: "▼";
  font-size: 11px;
  transition: transform .2s ease;
}

.qr-advanced-toggle.is-open::after {
  transform: rotate(180deg);
}

/* Soporte para icono en span (compatibilidad con HTML existente) */
.qr-advanced-toggle .advanced-icon {
  font-size: 11px;
  transition: transform .2s ease;
}

.qr-advanced-toggle.is-open .advanced-icon {
  transform: rotate(180deg);
}

/* MODO OSCURO */
body.dark-mode .qr-advanced-toggle,
[data-theme="dark"] .qr-advanced-toggle {
  background: linear-gradient(135deg, #16a34a, #065f46);
  color: #ecfdf5;
  box-shadow: 0 4px 10px rgba(6,95,70,.4);
}

body.dark-mode .qr-advanced-toggle:hover,
[data-theme="dark"] .qr-advanced-toggle:hover {
  box-shadow: 0 6px 16px rgba(6,95,70,.5);
}

/* ==============================
   BOTÓN OPCIONES AVANZADAS
   TAMAÑO + RESPONSIVE
   ============================== */

.qr-advanced-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 13px;
  height: 34px;
  width: auto;
  max-width: 220px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Tablets */
@media (max-width: 768px) {
  .qr-advanced-toggle {
    font-size: 13px;
    padding: 8px 18px;
    max-width: 240px;
  }
}

/* Móviles */
@media (max-width: 480px) {
  .qr-advanced-toggle {
    width: 100%;
    max-width: 260px;   /* No ocupa todo el contenedor */
    padding: 10px 16px;
    font-size: 14px;
    height: 38px;
  }
}

/* ==============================
   FIX RESPONSIVE SAFARI iOS
   BOTÓN OPCIONES AVANZADAS
   ============================== */

.qr-advanced-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;

  padding: 8px 18px;
  height: auto;
  min-height: 36px;

  line-height: 1.2;
  font-size: 14px;

  margin: 0 auto;
  text-align: center;

  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

/* Icono flecha */
.qr-advanced-toggle span,
.qr-advanced-toggle svg {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}

/* Móviles pequeños (iPhone SE / mini) */
@media (max-width: 480px) {
  .qr-advanced-toggle {
    width: auto;
    max-width: 90%;
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* iOS Safari fix extra */
@supports (-webkit-touch-callout: none) {
  .qr-advanced-toggle {
    transform: translateZ(0);
  }
}
