.rrg-gallery{
  --rrg-bg:#ffffff;
  --rrg-panel:#f9fafb;
  --rrg-ink:#111827;
  --rrg-muted:#6b7280;
  --rrg-accent:#27338c;
  --rrg-radius:18px;
  --rrg-shadow:0 18px 50px -24px rgba(15,23,42,.55);

  background:var(--rrg-bg);
  color:var(--rrg-ink);
  padding:1.8rem 1.6rem 1.4rem;
  border-radius:var(--rrg-radius);
  box-shadow:var(--rrg-shadow);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  max-width:1100px;
  margin:0 auto;
  border:1px solid #e5e7eb;
}

/* =========================================
   MENÚ HAMBURGUESA – SIEMPRE, DESKTOP Y MOBILE
   ========================================= */

.rrg-gallery__tabs-wrapper{
  position:relative;
  margin-bottom:1.2rem;
}

.rrg-gallery__menu-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center; /* centramos icono + texto */
  gap:.75rem;
  padding:.7rem 1.1rem;
  border-radius:999px;
  border:1px solid #d1d5db;
  background:#ffffff;
  cursor:pointer;
  font-size:.9rem;
  font-weight:600;
  color:var(--rrg-ink);
  box-shadow:0 14px 24px -18px rgba(15,23,42,.4);
  transition:background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease;
}

.rrg-gallery__menu-toggle:hover{
  background:#f9fafb;
  border-color:var(--rrg-accent);
  transform:translateY(-1px);
  box-shadow:0 18px 32px -22px rgba(15,23,42,.55);
}

.rrg-gallery__menu-icon{
  width:22px;
  height:18px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  flex-shrink:0;
  margin-right:.35rem;
}

.rrg-gallery__menu-icon span{
  display:block;
  height:2px;
  border-radius:999px;
  background:#111827;
  transition:transform .18s ease,opacity .18s ease,background .18s ease;
}

.rrg-gallery__menu-label{
  flex:0 0 auto;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Caja desplegable con las galerías (vertical, con scroll) */

.rrg-gallery__tabs{
  position:absolute;
  top:100%;
  left:0;
  right:0;
  margin-top:.4rem;
  background:#ffffff;
  border-radius:16px;
  border:1px solid #e5e7eb;
  box-shadow:0 22px 40px -24px rgba(15,23,42,.55);
  padding:.35rem;
  max-height:0;
  overflow-y:hidden;
  opacity:0;
  pointer-events:none;
  transform:translateY(-6px);
  transition:opacity .18s ease,transform .18s ease,max-height .22s ease;
  z-index:40;
}

.rrg-gallery__tabs-wrapper.is-open .rrg-gallery__tabs{
  max-height:320px;       /* scroll interno si hay muchas */
  overflow-y:auto;
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

/* Scroll agradable */
.rrg-gallery__tabs::-webkit-scrollbar{
  width:6px;
}
.rrg-gallery__tabs::-webkit-scrollbar-track{
  background:transparent;
}
.rrg-gallery__tabs::-webkit-scrollbar-thumb{
  background:#d1d5db;
  border-radius:999px;
}

/* Ítems del menú: lista limpia, NO burbujas */

.rrg-gallery__tab{
  width:100%;
  display:block;
  border-radius:8px;
  border:0;
  background:transparent;
  color:var(--rrg-muted);
  padding:.5rem .9rem;
  font-size:.86rem;
  text-transform:none;
  text-align:left;
  white-space:nowrap;
  cursor:pointer;
  transition:background .16s ease,color .16s ease;
}

.rrg-gallery__tab:hover{
  background:#f3f4f6;
  color:var(--rrg-ink);
}

.rrg-gallery__tab.is-active{
  background:var(--rrg-accent);
  color:#ffffff;
}

/* =========================================
   CUERPO PRINCIPAL
   ========================================= */

.rrg-gallery__body{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:1rem;
  align-items:center;
}

.rrg-gallery__main{
  background:var(--rrg-panel);
  border-radius:16px;
  border:1px solid #e5e7eb;
  padding:1rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  position:relative;
  min-height:260px;
}

.rrg-gallery__main-image{
  width:100%;
  aspect-ratio:16/9;
  border-radius:12px;
  overflow:hidden;
  position:relative;
  background:#0f172a;
}

/* imagen con fondo desenfocado */

.rrg-gallery__image-frame{
  position:relative;
  width:100%;
  height:100%;
}

.rrg-gallery__image-blur{
  position:absolute;
  inset:-10px;
  background-position:center;
  background-size:cover;
  filter:blur(18px);
  transform:scale(1.08);
  opacity:.8;
}

.rrg-gallery__image{
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  object-fit:contain;
  cursor:zoom-in;
  transition:transform .45s ease;
  border-radius:12px;
  background:transparent;
}

.rrg-gallery__main:hover .rrg-gallery__image{
  transform:scale(1.02);
}

/* VIDEO EN MAIN */

.rrg-gallery__video{
  width:100%;
  height:100%;
  border-radius:12px;
  background:#000;
  object-fit:contain;
}

/* HINT */

.rrg-gallery__hint{
  margin-top:.6rem;
  font-size:.78rem;
  color:var(--rrg-muted);
}

/* FLECHAS */

.rrg-gallery__nav{
  border-radius:999px;
  width:40px;
  height:40px;
  border:1px solid #d1d5db;
  background:#ffffff;
  color:#111827;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:1.3rem;
  line-height:1;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;
}

.rrg-gallery__nav:hover{
  background:var(--rrg-accent);
  border-color:var(--rrg-accent);
  color:#ffffff;
  transform:translateY(-1px);
  box-shadow:0 12px 24px -16px rgba(176,12,10,.55);
}

/* MINIATURAS */

.rrg-gallery__thumbs-wrapper{
  margin-top:1rem;
  padding-top:.6rem;
  border-top:1px solid #e5e7eb;
}

.rrg-gallery__thumbs{
  display:flex;
  gap:.5rem;
  overflow-x:auto;
  padding:.1rem .1rem .2rem;
  justify-content:center; /* centrar en desktop */
}

.rrg-gallery__thumb{
  border:none;
  background:transparent;
  padding:0;
  border-radius:10px;
  overflow:hidden;
  flex:0 0 80px;
  height:60px;
  cursor:pointer;
  position:relative;
  opacity:.85;
  transition:opacity .18s ease,transform .18s ease,box-shadow .18s ease;
  box-shadow:0 0 0 1px #e5e7eb;
  display:block;
}

.rrg-gallery__thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.rrg-gallery__thumb.is-active{
  opacity:1;
  transform:translateY(-2px);
  box-shadow:0 0 0 2px var(--rrg-accent),0 16px 28px -18px rgba(0,0,0,.35);
}

/* Miniatura solo botón play para videos */
.rrg-gallery__thumb--video{
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f9fafb;
}

.rrg-gallery__thumb-playbig{
  width:30px;
  height:30px;
  border-radius:999px;
  border:2px solid #111827;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  background:rgba(0,0,0,.04);
}

/* OVERLAY FULLSCREEN */

.rrg-gallery__overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  cursor:zoom-out;
}

.rrg-gallery__overlay-inner{
  width:100vw;
  height:100vh;
  padding:0;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:center;
}

.rrg-gallery__overlay-image,
.rrg-gallery__overlay-video{
  max-width:100vw;
  max-height:100vh;
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:16px;
  box-shadow:0 22px 60px -30px rgba(0,0,0,.9);
  background:#000;
}

/* MENSAJE VACÍO */

.rrg-gallery__empty{
  text-align:center;
  font-size:.95rem;
  color:#4b5563;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width:768px){
  .rrg-gallery{
    padding:1.3rem 1.1rem 1.1rem;
  }

  .rrg-gallery__menu-toggle{
    font-size:.85rem;
    padding:.6rem 1rem;
  }

  .rrg-gallery__body{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto;
    row-gap:.75rem;
    align-items:center;
  }

  .rrg-gallery__main{
    grid-column:1;
    grid-row:1;
    min-height:200px;
  }

  .rrg-gallery__main-image{
    aspect-ratio:4/3;
  }

  .rrg-gallery__nav{
    grid-row:2;
    width:44px;
    height:44px;
    margin:0;
  }

  .rrg-gallery__nav--prev{
    grid-column:1;
    justify-self:flex-start;
  }

  .rrg-gallery__nav--next{
    grid-column:1;
    justify-self:flex-end;
  }

  .rrg-gallery__thumbs{
    justify-content:flex-start; /* en mobile, alineado a la izquierda con scroll */
  }
}
