/* Categorías RR — Front v1.4.0 */
.rr-cats{
  --rr-gap: 18px;
  --rr-radius: 28px;
  --rr-aspect: 3/4;
  --rr-overlay: .35;
  --rr-cols: 6;
  --rr-cols-t: 3;
  --rr-cols-m: 1;
  --rr-safe: clamp(22px, 2.6vw, 40px);

  width: 100%;
  overflow: visible;
  isolation: isolate;
}

.rr-cats__track{
  box-sizing: border-box;
  gap: var(--rr-gap);
  justify-content: center;
  padding: var(--rr-safe);
  overflow: visible;
  position: relative;
  z-index: 0;
}

.rr-cats--grid .rr-cats__track{
  display: grid;
  grid-template-columns: repeat(var(--rr-cols), minmax(0, 1fr));
  align-items: stretch;
}

.rr-cats--scroll .rr-cats__track{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--rr-cols) - 1) * var(--rr-gap)) / var(--rr-cols));
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--rr-safe) + 16px);
  scroll-padding-left: 16px;
  scroll-padding-right: 16px;
}

.rr-cats--scroll .rr-cats__track::-webkit-scrollbar{height:8px}
.rr-cats--scroll .rr-cats__track::-webkit-scrollbar-track{background:rgba(0,0,0,.05);border-radius:999px}
.rr-cats--scroll .rr-cats__track::-webkit-scrollbar-thumb{background:rgba(0,0,0,.14);border-radius:999px}
.rr-cats--scroll .rr-cats__track{scrollbar-color: rgba(0,0,0,.22) rgba(0,0,0,.06); scrollbar-width: thin;}

/* === CARD === */
.rr-cat{
  position: relative;
  display: block;
  border-radius: var(--rr-radius);
  overflow: hidden;
  aspect-ratio: var(--rr-aspect);
  text-decoration: none;
  color: inherit;
  outline: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  transform: translateY(0);
  transition: transform .22s ease, box-shadow .22s ease;
  will-change: transform, box-shadow;
  opacity: 0;
  transform: translateY(10px);
}

.rr-cat[data-click="1"]{ cursor: pointer; }

.rr-cat.is-in{
  opacity: 1;
  transform: translateY(0);
  animation: rr-cat-in .55s cubic-bezier(.22,1,.36,1) both;
  animation-delay: var(--rr-d, 0ms);
}

@keyframes rr-cat-in{
  from{opacity:0; transform: translateY(10px) scale(.99);}
  to{opacity:1; transform: translateY(0) scale(1);}
}

/* === IMAGE === */
.rr-cat__media{
  position:absolute; inset:0;
  display:block;
}

.rr-cat__media img{
  width:100%; height:100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .35s ease;
  will-change: transform;
  display:block;
}

/* === OVERLAY === */
.rr-cat__overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg,
    rgba(0,0,0,var(--rr-overlay)) 0%,
    rgba(0,0,0,calc(var(--rr-overlay) + .08)) 55%,
    rgba(0,0,0,calc(var(--rr-overlay) + .12)) 100%);
  transition: opacity .25s ease;
}

.rr-cat:hover .rr-cat__overlay,
.rr-cat:focus-within .rr-cat__overlay{
  opacity: 1.2; /* slight darkening on hover for legibility */
}

/* === CONTENT === */
.rr-cat__content{
  position:absolute; inset:0;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap: 14px;
  padding: clamp(14px, 2.1vw, 22px);
  z-index: 3;
  pointer-events: none;
}

.rr-cat__title{
  font-weight: 500;
  letter-spacing: var(--rr-letter-spacing, .02em);
  text-transform: var(--rr-text-transform, none);
  color: #fff;
  text-shadow: 0 8px 18px rgba(0,0,0,.36);
  font-size: clamp(16px, 1.15vw + 10px, 24px);
  transition: transform .22s ease;
}

.rr-cat:hover .rr-cat__title,
.rr-cat:focus-within .rr-cat__title{
  transform: translateY(-3px);
}

/* === CTA BUTTON === */
.rr-cat .rr-cat__cta{
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(16px, 2vw, 24px);
  z-index: 4;
  pointer-events: auto;
  padding: 0 clamp(14px, 2.2vw, 22px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.rr-cat__btn{
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  width: auto;
  max-width: min(360px, 100%);
  padding: clamp(10px, 2.2vw, 12px) clamp(12px, 3vw, 20px);
  font-size: clamp(12px, 2.8vw, 15px);
  line-height: 1.15;
  text-align: center;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
  transform: translateY(0) scale(1);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  /* WhatsApp icon via SVG data URI */
}

.rr-cat__btn::before{
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z'/%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12c0 2.126.558 4.115 1.522 5.843L.062 23.056a.75.75 0 0 0 .916.916l5.21-1.46A11.938 11.938 0 0 0 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 21.75a9.71 9.71 0 0 1-4.988-1.37l-.355-.21-3.684 1.032 1.03-3.682-.217-.364A9.71 9.71 0 0 1 2.25 12C2.25 6.615 6.615 2.25 12 2.25S21.75 6.615 21.75 12 17.385 21.75 12 21.75z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.rr-cat__btn:hover,
.rr-cat__btn:focus-visible{
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px rgba(37,211,102,.35);
  filter: brightness(1.05);
}

.rr-cat__btn:focus-visible{
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 3px;
}

/* === STRETCHED LINK === */
.rr-cat__link{
  position:absolute;
  inset:0;
  z-index: 2;
  border-radius: inherit;
  display: block;
}

/* === HOVER STATE === */
.rr-cat:hover,
.rr-cat:focus-within{
  box-shadow: 0 20px 50px rgba(0, 122, 255, .28), 0 8px 18px rgba(0,0,0,.12);
  transform: translateY(-3px);
  z-index: 30;
}

.rr-cat:hover .rr-cat__media img,
.rr-cat:focus-visible .rr-cat__media img{
  transform: scale(1.08);
}

.rr-cat__link:focus-visible{
  outline: 2px solid rgba(255,255,255,.7);
  outline-offset: 3px;
}

/* === SCROLL SNAP === */
.rr-cats--scroll .rr-cat{ scroll-snap-align: start; }

/* === TABLET === */
@media (max-width: 900px){
  .rr-cats--grid .rr-cats__track{
    grid-template-columns: repeat(var(--rr-cols-t), minmax(0, 1fr));
  }
  .rr-cats--scroll .rr-cats__track{
    grid-auto-columns: calc((100% - (var(--rr-cols-t) - 1) * var(--rr-gap)) / var(--rr-cols-t));
  }
}

/* === MÓVIL === */
@media (max-width: 600px){
  .rr-cats--grid .rr-cats__track{
    grid-template-columns: repeat(var(--rr-cols-m), minmax(0, 1fr));
  }

  /* En móvil, "scroll" se convierte en grid vertical */
  .rr-cats--scroll .rr-cats__track{
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-template-columns: repeat(var(--rr-cols-m), minmax(0, 1fr));
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: auto;
    padding-bottom: var(--rr-safe);
    scroll-padding-left: 0;
    scroll-padding-right: 0;
    justify-content: stretch;
    align-content: start;
  }

  .rr-cats--scroll .rr-cat{
    scroll-snap-align: unset;
  }
}

@media (max-width: 420px){
  .rr-cat__btn{ width: 100%; max-width: 100%; }
}

/* === ACCESIBILIDAD: REDUCED MOTION === */
@media (prefers-reduced-motion: reduce){
  .rr-cat,
  .rr-cat__media img,
  .rr-cat__title,
  .rr-cat__overlay{
    transition:none !important;
    animation:none !important;
  }
  .rr-cat{opacity:1; transform:none;}
}

/* === HIGH CONTRAST MODE === */
@media (forced-colors: active){
  .rr-cat__overlay{ display: none; }
  .rr-cat__title{ color: CanvasText; text-shadow: none; }
  .rr-cat{ border: 2px solid ButtonText; }
}

/* === CARD DESCRIPTION (opcional) === */
.rr-cat__desc{
  color: rgba(255,255,255,.85);
  font-size: clamp(12px, 1vw + 8px, 14px);
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  max-width: 90%;
}
