/* CONTENEDOR PRINCIPAL */
.rgc-discovery{
  max-width:1120px;
  padding:28px 30px;
}

/* CABECERA */
.rgc-discovery-heading{
  text-align:center;
  margin-bottom:22px;
}
.rgc-discovery-heading h2{
  margin:0 0 8px;
  color:var(--rcs-azul-brujula);
  font-family:var(--rcs-font-title);
}
.rgc-discovery-heading h2 em{
  font-style:italic;
  color:#E87A67;
}
.rgc-discovery-heading p{
  margin:0;
  color:var(--rcs-gris);
  font-size:15px;
}

/* TOOLBAR */
.rgc-toolbar{
  display:flex !important;
  align-items:center;
  width:100%;
  background:var(--rcs-blanco);
  border:1px solid var(--rcs-borde);
  border-radius:var(--rcs-radius-lg);
  padding:12px;
  box-shadow:var(--rcs-sombra);
  transition:box-shadow .2s ease, transform .2s ease;
}
.rgc-toolbar:hover{
  box-shadow:0 18px 44px rgba(22,59,77,.10);
}

/* BUSCADOR */
.rgc-search{
  flex:2;
  display:flex;
  align-items:center;
  gap:16px;
  padding:18px 24px;
  min-height:68px;
}
.rgc-search .rgc-icon{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:50%;
  background:rgba(22,59,77,.04);
  opacity:.9;
}
.rgc-search .rgc-icon .rcs-svg-icon{
  width:24px;
  height:24px;
}
.rgc-search input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  font-size:15px;
}
.rgc-search input::placeholder{
  color:#8A949D;
}

/* FILTROS */
.rgc-filter-wrap{
  position:relative;
  flex:1;
}
.rgc-filter{
  flex:1;
  display:flex !important;
  align-items:center;
  gap:14px;
  padding:16px 20px;
  border:0;
  background:transparent;
  text-align:left;
  cursor:pointer;
  min-height:68px;
  border-radius:var(--rcs-radius-md);
  transition:background .18s ease, transform .18s ease;
}
.rgc-filter:hover{
  background:#FAF8F5;
}
.rgc-filter-wrap.is-open .rgc-filter{
  background:#FAF8F5;
}
.rgc-filter-icon{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  flex:0 0 32px;
  border-radius:50%;
  background:rgba(22,59,77,.04);
}
.rgc-filter-icon .rcs-svg-icon{
  width:30px;
  height:30px;
  margin:0;
}
.rgc-filter small{
  display:block;
  font-size:11px;
  letter-spacing:.02em;
  color:var(--rcs-gris);
  margin-bottom:4px;
}
.rgc-filter strong{
  display:block;
  font-size:14px;
  color:var(--rcs-azul-brujula);
}

/* DIVISOR */
.rgc-toolbar-divider{
  width:1px;
  height:46px;
  background:rgba(22,59,77,.10);
  flex:0 0 1px;
}

/* POPOVER */
.rgc-filter-popover{
  position:absolute;
  top:calc(100% + 14px);
  left:0;
  z-index:50;
  width:260px;
  padding:14px;
  background:var(--rcs-blanco);
  border:1px solid var(--rcs-borde);
  border-radius:var(--rcs-radius-md);
  box-shadow:var(--rcs-sombra-hover);
  animation:rgcPopoverIn .16s ease;
}
@keyframes rgcPopoverIn{
  from{ opacity:0; transform:translateY(-6px); }
  to{ opacity:1; transform:translateY(0); }
}
.rgc-filter-option{
  width:100%;
  display:block;
  padding:12px 14px;
  border:0;
  border-radius:12px;
  background:transparent;
  text-align:left;
  color:var(--rcs-azul-brujula);
  cursor:pointer;
  font-weight:600;
  transition:background .16s ease, color .16s ease, transform .16s ease;
}
.rgc-filter-option:hover{
  background:var(--rcs-coral-soft);
  color:var(--rcs-coral);
  transform:translateX(2px);
}

/* CHIPS ACTIVOS */
.rgc-active-filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin-top:18px;
}
.rgc-active-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 13px;
  border:1px solid rgba(232,122,103,.28);
  border-radius:999px;
  background:var(--rcs-coral-soft);
  color:var(--rcs-coral);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.rgc-active-chip span{
  font-size:16px;
  line-height:1;
}

/* BOTÓN AJUSTES */
.rgc-advanced-filter{
  width:62px;
  height:62px;
  border:0;
  border-radius:18px;
  background:linear-gradient(180deg, var(--rcs-azul-brujula), var(--rcs-azul-profundo));
  color:#fff;
  cursor:pointer;
  flex:0 0 62px;
  transition:background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.rgc-advanced-filter .rcs-svg-icon{
  width:28px;
  height:28px;
  display:block;
  margin:0 auto;
  filter: brightness(0) invert(1);
}
.rgc-advanced-filter:hover{
  background:#0F4D5E;
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(22,59,77,.18);
}

.rgc-filter-panel[hidden]{
    display:none !important;
}

.rgc-filter-panel-overlay[hidden]{
    display:none !important;
}


/* RESPONSIVE */
@media(max-width:1000px){
  .rgc-toolbar{
    flex-direction:column;
    align-items:stretch;
  }
  .rgc-toolbar-divider{
    display:none;
  }
  .rgc-search,
  .rgc-filter{
    width:100%;
  }
}

.rgc-filter-panel-overlay{
  position:fixed;
  inset:0;
  background:rgba(22,59,77,.38);
  z-index:9998;
}

.rgc-filter-panel{
  position:fixed;
  top:0;
  right:0;
  width:440px;
  max-width:calc(100vw - 24px);
  height:100vh;
  background:var(--rcs-blanco);
  z-index:9999;
  transform:translateX(110%);
  transition:transform .28s ease;
  display:flex;
  flex-direction:column;
  box-shadow:-20px 0 60px rgba(22,59,77,.18);
}

.rgc-filter-panel.is-open{
  transform:translateX(0);
}

.rgc-filter-panel-header{
  padding:28px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  border-bottom:1px solid rgba(22,59,77,.08);
}

.rgc-filter-panel-header span{
  color:var(--rcs-coral);
  font-size:12px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.rgc-filter-panel-header h3{
  margin:6px 0 0;
  color:var(--rcs-azul-brujula);
  font-family:var(--rcs-font-title);
  font-size:28px;
}

.rgc-filter-panel-close{
  border:1px solid var(--rcs-borde);
  background:var(--rcs-marfil);
  width:42px;
  height:42px;
  border-radius:999px;
  font-size:26px;
  cursor:pointer;
}

.rgc-filter-panel-body{
  flex:1;
  padding:28px;
  overflow:auto;
}

.rgc-panel-placeholder{
  padding:22px;
  border-radius:20px;
  background:var(--rcs-marfil);
  color:var(--rcs-gris);
}

.rgc-filter-panel-footer{
  padding:20px 28px;
  display:flex;
  gap:12px;
  border-top:1px solid rgba(22,59,77,.08);
}

.rgc-panel-clear,
.rgc-panel-apply{
  flex:1;
  height:52px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
}

.rgc-panel-clear{
  border:1px solid var(--rcs-borde);
  background:var(--rcs-blanco);
  color:var(--rcs-azul-brujula);
}

.rgc-panel-apply{
  border:0;
  background:var(--rcs-azul-brujula);
  color:#fff;
}

@media(max-width:768px){
  .rgc-filter-panel{
    width:calc(100vw - 20px);
  }
}

.rgc-filter-panel-close{
  position:relative;
  z-index:10001;
  flex:0 0 42px;
}

@media(max-width:768px){
  .rgc-filter-panel-header{
    padding-top:52px;
  }
}

.rgc-panel-group h4{
  margin:0 0 16px;
  color:#163B4D;
  font-size:18px;
}

.rgc-panel-radio{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 0;
  border-bottom:1px solid rgba(22,59,77,.08);
  cursor:pointer;
}

.rgc-panel-radio span{
  color:#163B4D;
  font-weight:700;
}

.rcs-brujula-continue { display: none; }

/* ==========================================
   SPRINT 16 · Nuevo selector de edad
========================================== */

.rgc-age-filter {
    margin-top: 18px;
}

.rgc-age-label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rcs-azul-brujula);
}

.rgc-age-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 52px;
    border: 1px solid #E6E8EB;
    border-radius: 14px;
    background: #fff;
    transition: .2s ease;
}

.rgc-age-field:focus-within {
    border-color: var(--rcs-coral);
    box-shadow: 0 0 0 3px rgba(232,122,103,.12);
}

.rgc-age-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 18px;
    font-weight: 600;
    color: var(--rcs-azul-brujula);
}

.rgc-age-input::placeholder {
    color: #A5A8AD;
    font-weight: 400;
}

.rgc-age-input::-webkit-inner-spin-button,
.rgc-age-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rgc-age-input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.rgc-age-suffix {
    font-size: 14px;
    color: #7C848C;
    white-space: nowrap;
}

.rgc-age-help {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #7C848C;
}

/* ==========================================================
   SPRINT 16 · SIDEBAR DISCOVERY REFINADO
   Añadir al final del CSS actual
   ========================================================== */

/* OVERLAY */
.rgc-filter-panel-overlay{
  background:rgba(22,59,77,.46);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}

/* PANEL */
.rgc-filter-panel{
  width:400px;
  max-width:calc(100vw - 18px);
  background:#FAF8F5;
  box-shadow:-24px 0 70px rgba(22,59,77,.22);
}

/* CABECERA */
.rgc-filter-panel-header{
  position:relative;
  padding:24px 24px 20px;
  align-items:center;
  background:#fff;
  border-bottom:1px solid rgba(22,59,77,.08);
}

.rgc-filter-panel-header > div{
  min-width:0;
}

.rgc-filter-panel-header span{
  display:block;
  margin:0 0 5px;
  color:#E87A67;
  font-size:11px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:.12em;
}

.rgc-filter-panel-header h3{
  margin:0;
  color:#163B4D;
  font-family:var(--rcs-font-title);
  font-size:25px;
  line-height:1.12;
  letter-spacing:-.02em;
}

/* BOTÓN CERRAR */
.rgc-filter-panel-close{
  position:static;
  z-index:auto;
  flex:0 0 38px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(22,59,77,.08);
  border-radius:50%;
  background:#FAF8F5;
  color:#163B4D;
  font-size:22px;
  line-height:1;
  transition:
    background .18s ease,
    transform .18s ease,
    border-color .18s ease;
}

.rgc-filter-panel-close:hover{
  background:#FFF1EC;
  border-color:rgba(232,122,103,.28);
  transform:rotate(4deg);
}

/* CUERPO */
.rgc-filter-panel-body{
  flex:1;
  padding:22px 24px 28px;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(22,59,77,.18) transparent;
}

.rgc-filter-panel-body::-webkit-scrollbar{
  width:6px;
}

.rgc-filter-panel-body::-webkit-scrollbar-thumb{
  background:rgba(22,59,77,.18);
  border-radius:999px;
}

/* GRUPOS */
.rgc-panel-group{
  margin:0;
  padding:0;
}

.rgc-panel-group + .rgc-panel-group{
  margin-top:22px;
  padding-top:22px;
  border-top:1px solid rgba(22,59,77,.08);
}

.rgc-panel-group h4{
  margin:0 0 12px;
  color:#163B4D;
  font-family:var(--rcs-font-title);
  font-size:18px;
  line-height:1.25;
}

/* EDAD */
.rgc-age-filter{
  margin-top:0;
  padding:20px;
  border:1px solid rgba(22,59,77,.08);
  border-radius:20px;
  background:#fff;
  box-shadow:0 10px 24px rgba(22,59,77,.05);
}

.rgc-age-label{
  display:block;
  margin:0 0 12px;
  color:#163B4D;
  font-family:var(--rcs-font-title);
  font-size:19px;
  line-height:1.25;
  font-weight:700;
}

.rgc-age-field{
  display:flex;
  align-items:center;
  gap:10px;
  height:58px;
  padding:0 17px;
  border:1px solid rgba(22,59,77,.14);
  border-radius:16px;
  background:#FAF8F5;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.rgc-age-field:hover{
  border-color:rgba(22,59,77,.26);
  background:#fff;
}

.rgc-age-field:focus-within{
  border-color:#E87A67;
  background:#fff;
  box-shadow:0 0 0 4px rgba(232,122,103,.12);
}

.rgc-age-input{
  width:100%;
  min-width:0;
  padding:0;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  color:#163B4D;
  font-family:var(--rcs-font-body);
  font-size:22px;
  line-height:1;
  font-weight:700;
}

.rgc-age-input::placeholder{
  color:#9AA2A9;
  font-size:16px;
  font-weight:500;
}

.rgc-age-suffix{
  flex:0 0 auto;
  color:#66707A;
  font-size:14px;
  font-weight:600;
}

.rgc-age-help{
  position:relative;
  margin:12px 0 0;
  padding-left:22px;
  color:#66707A;
  font-size:13px;
  line-height:1.45;
}

.rgc-age-help::before{
  content:"✓";
  position:absolute;
  top:0;
  left:0;
  color:#A7B8A0;
  font-weight:800;
}

/* UBICACIÓN DE EXPERIENCIA */
.rgc-location-filter[hidden]{
  display:none;
}

.rgc-location-input{
  width:100%;
  height:58px;
  padding:0 44px 0 17px;
  border:1px solid rgba(22,59,77,.14);
  border-radius:16px;
  outline:0;
  background:#FAF8F5;
  color:#163B4D;
  font-family:var(--rcs-font-body);
  font-size:16px;
  font-weight:700;
}

.rgc-location-input:focus{
  border-color:#E87A67;
  background:#fff;
  box-shadow:0 0 0 4px rgba(232,122,103,.12);
}

/* FOOTER FIJO */
.rgc-filter-panel-footer{
  position:sticky;
  bottom:0;
  z-index:3;
  padding:16px 24px 18px;
  gap:10px;
  background:rgba(255,255,255,.96);
  border-top:1px solid rgba(22,59,77,.08);
  box-shadow:0 -10px 28px rgba(22,59,77,.06);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

/* BOTÓN SECUNDARIO */
.rgc-panel-clear{
  flex:.8;
  height:50px;
  padding:0 16px;
  border:1px solid rgba(22,59,77,.14);
  border-radius:14px;
  background:#fff;
  color:#66707A;
  font-size:14px;
  font-weight:700;
  transition:
    border-color .18s ease,
    color .18s ease,
    background .18s ease;
}

.rgc-panel-clear:hover{
  color:#163B4D;
  border-color:rgba(22,59,77,.28);
  background:#FAF8F5;
}

/* CTA PRINCIPAL */
.rgc-panel-apply{
  flex:1.2;
  height:50px;
  padding:0 18px;
  border:0;
  border-radius:14px;
  background:#163B4D;
  color:#fff;
  font-size:14px;
  font-weight:800;
  box-shadow:0 9px 20px rgba(22,59,77,.16);
  transition:
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.rgc-panel-apply:hover{
  background:#204D61;
  transform:translateY(-1px);
  box-shadow:0 13px 26px rgba(22,59,77,.20);
}

/* ELIMINA VISUALMENTE RESTOS DE LA ANTIGUA ORDENACIÓN */
.rgc-filter-panel .rgc-panel-radio{
  padding:12px 0;
}

/* MÓVIL */
@media(max-width:768px){

  .rgc-filter-panel{
    top:auto;
    bottom:0;
    width:100%;
    max-width:100%;
    height:min(82vh,720px);
    border-radius:24px 24px 0 0;
    transform:translateY(110%);
  }

  .rgc-filter-panel.is-open{
    transform:translateY(0);
  }

  .rgc-filter-panel-header{
    padding:20px 20px 16px;
  }

  .rgc-filter-panel-header::before{
    content:"";
    position:absolute;
    top:8px;
    left:50%;
    width:42px;
    height:4px;
    border-radius:999px;
    background:rgba(22,59,77,.18);
    transform:translateX(-50%);
  }

  .rgc-filter-panel-header h3{
    font-size:23px;
  }

  .rgc-filter-panel-body{
    padding:18px 18px 24px;
  }

  .rgc-age-filter{
    padding:18px;
    border-radius:18px;
  }

  .rgc-filter-panel-footer{
    padding:14px 18px max(16px, env(safe-area-inset-bottom));
  }

  .rgc-panel-clear,
  .rgc-panel-apply{
    height:48px;
  }
}

/* ==========================================================
   SPRINT 16 · AJUSTE MÓVIL DEL SIDEBAR
   ========================================================== */

@media (max-width:768px){

  .rgc-filter-panel{
    top:auto;
    right:0;
    bottom:0;

    width:100%;
    max-width:100%;

    height:auto;
    max-height:88vh;

    border-radius:24px 24px 0 0;

    transform:translateY(110%);
    overflow:hidden;
  }

  .rgc-filter-panel.is-open{
    transform:translateY(0);
  }

  .rgc-filter-panel-header{
    position:relative;
    padding:28px 22px 18px;
    align-items:center;
  }

  .rgc-filter-panel-header::before{
    content:"";
    position:absolute;
    top:9px;
    left:50%;

    width:44px;
    height:4px;

    border-radius:999px;
    background:rgba(22,59,77,.18);

    transform:translateX(-50%);
  }

  .rgc-filter-panel-header span{
    margin-bottom:4px;
    font-size:10px;
    letter-spacing:.11em;
  }

  .rgc-filter-panel-header h3{
    font-size:24px;
    line-height:1.15;
  }

  .rgc-filter-panel-close{
    width:38px;
    height:38px;
    flex-basis:38px;
    font-size:21px;
  }

  .rgc-filter-panel-body{
    flex:0 1 auto;
    padding:20px 22px 22px;
    overflow-y:auto;
  }

  .rgc-age-filter{
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }

  .rgc-age-label{
    margin:0 0 14px;
    font-size:20px;
    line-height:1.25;
  }

  .rgc-age-field{
    width:100%;
    height:54px;
    padding:0 16px;
    border-radius:15px;
    background:#fff;
  }

  .rgc-age-input{
    min-width:0;
    font-size:20px;
  }

  .rgc-age-help{
    margin:13px 0 0;
    padding-left:22px;
    font-size:13px;
    line-height:1.45;
  }

  .rgc-filter-panel-footer{
    position:static;
    padding:16px 22px max(18px, env(safe-area-inset-bottom));
    background:#fff;
    box-shadow:0 -8px 24px rgba(22,59,77,.05);
  }

  .rgc-panel-clear{
    flex:.75;
  }

  .rgc-panel-apply{
    flex:1.25;
  }
}

.rgc-discovery-toggle {
  display: none;
}

@media (max-width: 768px) {
  .rgc-discovery-toggle {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    margin: 0 0 14px;
    border: 1px solid rgba(35, 48, 52, 0.12);
    border-radius: 14px;
    background: #ffffff;
    color: #233034;
    font: inherit;
    font-weight: 600;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    box-shadow: 0 4px 16px rgba(35, 48, 52, 0.06);
  }

  .rgc-discovery-toggle__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #faf8f5;
    color: #e87a67;
    font-size: 22px;
    line-height: 26px;
    text-align: center;
    flex: 0 0 28px;
  }

  .rgc-discovery-v2 > [hidden] {
    display: none !important;
  }
}
/* The server sends a closed panel. These selectors remain effective after the
   drawer is portalled to body and do not rely on :has(), which prevents an
   intermediate overlay/panel state in older Safari. */
.rgc-filter-panel[hidden],
.rgc-filter-panel-overlay[hidden]{display:none !important;}
.rgc-filter-panel-overlay{display:none !important;}
.rgc-filter-panel-overlay.is-open{display:block !important;}
