/* ===== Material tokens (ajusta a tu marca si quieres) ===== */
:root {
  --md-sys-color-primary: #004277;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-surface: #ffffff;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-outline: rgba(0,0,0,0.28);
  --md-sys-color-outline-variant: rgba(0,0,0,0.12);
  --md-sys-color-surface-variant: #f3f1f5;
  --md-sys-state-hover: rgba(103,80,164,0.08);
  --md-sys-state-focus: rgba(103,80,164,0.12);
  --md-sys-state-pressed: rgba(103,80,164,0.10);
}

/* ===== Elevations ===== */
.elevation-1 { box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.12); }
.elevation-2 { box-shadow: 0 2px 6px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.10); }
.elevation-3 { box-shadow: 0 4px 10px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.10); }

/* ===== Search Bar (Material Search) ===== */
.md-search {
  background: var(--md-sys-color-surface);
  border-radius: 10px;
  height: 56px;
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  align-items: center;
  padding-inline: 4px 8px;
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.md-search:hover {
  background: #fff;
  border-color: var(--md-sys-color-outline);
}

.md-search:focus-within {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--md-sys-color-primary) 20%, transparent);
}

.md-icon {
  width: 56px;
  text-align: center;
  color: var(--md-sys-color-outline);
  font-size: 1.1rem;
}

.md-input {
  border: none !important;
  outline: none !important;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  height: 100%;
  width: 100%;
  padding: 0 8px;
}

.md-input::placeholder { color: rgba(0,0,0,0.45); }

/* Trailing icon button */
.md-icon-button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.md-icon-button:hover { background: var(--md-sys-state-hover); }
.md-icon-button:active { background: var(--md-sys-state-pressed); }

/* ===== Filter Chips (aplica a los <button> generados por tu JS) ===== */
#filtrosCategorias button {
  appearance: none;
  border: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .92rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
#filtrosCategorias button:hover {
  background: var(--md-sys-surface-variant, #f8f6fb);
  border-color: var(--md-sys-color-outline);
}
#filtrosCategorias button:active {
  background: var(--md-sys-state-pressed);
}
#filtrosCategorias button.active {
  background: color-mix(in oklab, var(--md-sys-color-primary) 14%, white);
  border-color: color-mix(in oklab, var(--md-sys-color-primary) 40%, var(--md-sys-color-outline));
  color: color-mix(in oklab, var(--md-sys-color-primary) 80%, black);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--md-sys-color-primary) 35%, transparent);
}

/* Opcional: icono dentro del chip (si en el futuro agregas) */
#filtrosCategorias button i {
  font-size: .9rem;
  margin-right: .35rem;
}

/* Asegura que el contenedor padre sea el referente del absolute */
.container, .page-wrapper, main { position: relative; } /* usa el que corresponda en tu layout */

/* Botón lateral – estilos base */
.side-trigger {
  /* orientación correcta: vertical de arriba → abajo */
  writing-mode: vertical-lr;
  text-orientation:sideways-right;

  display: inline-flex;
  align-items: center;
  gap: .35rem;

  background: #EC7625;
  color: var(--md-sys-color-on-primary, #fff);
  border: none;
  border-radius: 12px 0 0 12px;
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18), 0 2px 4px rgba(0,0,0,.12);
  cursor: pointer;
  z-index: 1040; /* por debajo de backdrop de Bootstrap (~1050+) */
}

/* redondeo correcto cuando está a la izquierda */
.side-trigger.left {
  border-radius: 0 12px 12px 0;
}

/* SIEMPRE visible: fijo al viewport (lo ves mientras haces scroll) */
.side-trigger.fixed {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
}

/* pegado al borde izquierdo del viewport, sin margen */
.side-trigger.fixed.left {
  left: 0; 
  right: auto;
}

/* Hover/Active */
.side-trigger:hover { filter: brightness(1.05); }
.side-trigger:active { filter: brightness(0.98); }
.side-trigger .label { font-weight: 600; letter-spacing: .02em; }

/* Ripple simple (opcional) */
.md-ripple { position: relative; overflow: hidden; isolation: isolate; }
.md-ripple::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,.25) 10%, transparent 11%) center/0 0 no-repeat;
  opacity: 0; transition: background-size .35s ease, opacity .6s ease;
}
.md-ripple:active::after { background-size: 200% 200%; opacity: 1; transition: 0s; }

/* permitir rotar sólo el contenido */
.side-trigger .label,
.side-trigger i {
  display: inline-block;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform .2s ease;
}

/* voltear texto + icono 180° */
.side-trigger.flip-content .label,
.side-trigger.flip-content i {
  transform: rotate(180deg);
}



/* mobile: también pegado al lado izquierdo */
@media (max-width: 991.98px) {
  .side-trigger.fixed.left {
    left: 0;        /* mantiene el borde izquierdo sin margen */
    right: auto;
    /* el resto (bottom, writing-mode, etc.) se mantiene como ya lo tenías */
  }
}
