/* ========================= 
   RL HOME CATEGORIES – FINAL PRO
   - Fondo sección blanco
   - Header (título) con franja FULL WIDTH
   - Cards premium + hover
   - Responsive mejorado (grid)
========================= */

.rlhomecategories{
  background:#fff;
  padding: 0 0 110px!important;
  margin-top: 50px;
}

/* Necesario para pseudo-elementos full width */
.rlhomecategories .container{
  position: relative;
}

/* ===== FRANJA FULL WIDTH DETRÁS DEL TÍTULO ===== */
.rlhomecategories .container::before{
  content:"";
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;

  width: 100vw;                 /* ✅ full width real */
  height: 96px;                 /* altura franja */
  background: #0c1c3d;
  box-shadow: 0 18px 45px rgba(12,28,61,0.22);
  z-index: 0;
}

/* Fade inferior para integrar con blanco */
.rlhomecategories .container::after{
  content:"";
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 82px;

  width: 100vw;
  height: 44px;
  background: linear-gradient(180deg, rgba(12,28,61,0.22), rgba(12,28,61,0.00));
  z-index: 0;
  pointer-events:none;
}

/* ===== TÍTULO ===== */
.rlhomecategories .title{
  position: relative;
  z-index: 1;

  margin: 0;
  padding: 28px 0 22px;

  font-size: 32px;
  font-weight: 950;
  color: #fff !important;
  letter-spacing: -0.6px;

  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* subrayado elegante */
.rlhomecategories .title::after{
  content:"";
  position:absolute;
  left: 0;
  bottom: 12px;        
  width: 72px;         
  height: 4px;         
  border-radius: 999px;
  background: #00b1d7; 
}

/* ===== LISTA (GRID RESPONSIVE, no rompe nada) ===== */
ul.rlhomecategories_list{
  list-style: none;
  padding: 0;
  margin: 110px 0 0;    /* separación respecto a la franja */

  position: relative;
  z-index: 1;

  /* ✅ Grid sólido: evita 1 columna en móvil por min-width + width 100% */
  display: grid;
  gap: 18px;

  /* Desktop: tantas columnas como quepan con mínimo consistente */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  justify-items: stretch;
  align-items: stretch;
}

/* ===== CARD ===== */
ul.rlhomecategories_list > a.home_cat{
  width: 100%;      /* ✅ ocupa la celda del grid */
  min-width: 0;     /* ✅ deja que el grid pueda encoger sin forzar 1 columna */
  height: 260px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;

  text-decoration: none;
  padding: 18px 16px;
  border-radius: 20px;

  background: #fff;
  border: 1px solid rgba(12,28,61,0.10);
  box-shadow: 0 14px 34px rgba(12,28,61,0.10);

  position: relative;
  overflow: hidden;

  transition:
    transform .18s ease,
    box-shadow .22s ease,
    border-color .22s ease;
}

/* línea superior hover */
ul.rlhomecategories_list > a.home_cat::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height: 4px;
  background: #00b1d7;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}

/* ===== IMAGEN ===== */
ul.rlhomecategories_list > a.home_cat img{
  width: 100%;
  max-width: 120px;
  height: 110px;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
  transition: transform .22s ease;
}

/* ===== NOMBRE ===== */
ul.rlhomecategories_list > a.home_cat .name{
  margin: 0;
  color: #fff !important;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: .15px;
  text-align: center;

  padding: 7px 14px;
  background: #0c1c3d;
  border-radius: 999px;

  transition: background .2s ease, transform .18s ease;
}

/* ===== HOVER ===== */
ul.rlhomecategories_list > a.home_cat:hover{
  transform: translateY(-7px);
  box-shadow: 0 26px 65px rgba(12,28,61,0.18);
  border-color: rgba(0,177,215,0.55);
}

ul.rlhomecategories_list > a.home_cat:hover::before{
  transform: scaleX(1);
}

ul.rlhomecategories_list > a.home_cat:hover img{
  transform: scale(1.06);
}

ul.rlhomecategories_list > a.home_cat:hover .name{
  background: #00b1d7;
  transform: translateY(-1px);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px){
  /* En grid no hace falta calcular % */
  ul.rlhomecategories_list{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  ul.rlhomecategories_list > a.home_cat{
    height: 250px;
  }
}

@media (max-width: 991px){
  .rlhomecategories .container::before{
    height: 90px;
  }
  .rlhomecategories .container::after{
    top: 78px;
    height: 40px;
  }

  .rlhomecategories .title{
    padding: 24px 0 18px;
    font-size: 28px;
  }

  ul.rlhomecategories_list{
    gap: 14px;
    margin-top: 100px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  ul.rlhomecategories_list > a.home_cat{
    height: 240px;
  }
}

@media (max-width: 768px){
  ul.rlhomecategories_list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  ul.rlhomecategories_list > a.home_cat{
    height: 230px;
  }
}

/* ✅ MÓVIL: 2 columnas (en vez de 1) y más compacto */
@media (max-width: 480px){
  .rlhomecategories{
    margin-top: 26px;
  }

  .rlhomecategories .container::before{
    height: 86px;
  }

  .rlhomecategories .title{
    padding: 22px 0 16px;
    font-size: 24px;
  }

  ul.rlhomecategories_list{
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  ul.rlhomecategories_list > a.home_cat{
    height: 190px;
    padding: 14px 12px;
  }

  ul.rlhomecategories_list > a.home_cat img{
    max-width: 90px;
    height: 80px;
  }
}

/* Extra: móviles muy pequeños → 1 columna para no aplastar */
@media (max-width: 340px){
  ul.rlhomecategories_list{
    grid-template-columns: 1fr;
  }

  ul.rlhomecategories_list > a.home_cat{
    height: auto;
    padding: 18px 14px;
  }
}
/* =========================
   AJUSTE DE ESPACIADO EN MÓVIL
========================= */

@media (max-width: 480px){
  /* Menos aire arriba del bloque */
  ul.rlhomecategories_list{
    margin-top: 72px;   /* antes 110px */
  }

  /* Menos aire abajo de la sección */
  .rlhomecategories{
    padding-bottom: 64px!important; /* antes 110px */
  }
}