/* ==========================================================================
   SECCIÓN PORTAFOLIO Y FILTROS
   ========================================================================== */

/* 1. CONTENEDOR Y BOTONES DE FILTRADO */
.portfolio {
  padding-bottom: 80px;
}

.filter-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}

.btn-filter {
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 16px;
  color: #000;
  transition: color 0.3s ease;
}

.btn-filter:hover,
.btn-filter.active {
  color: #B4CB00;
}

.btn-filter:focus,
.btn-filter:active {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* 2. ESTRUCTURA DE LA CUADRÍCULA (GRID) */

/* Configuración por defecto: 2 Columnas para la sección Web */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  align-items: center;
  justify-content: center;
  justify-items: center;
  margin: 0 auto;
  width: 100%;
}

/* Variante: 4 Columnas Centradas para la sección Logos */
.portfolio-grid.four-columns {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 30px 20px;
  justify-content: center;
  align-items: center;
  justify-items: center;
}

.portfolio-item {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-item.hide {
  display: none !important;
}

/* 3. ESTILOS DE TARJETAS E IMÁGENES WEB */
.inner-box {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.inner-box .image {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: auto;
}

.inner-box .image img {
  width: auto;
  height: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  transition: transform 0.5s ease;
}

/* Overlay flotante al pasar el cursor (Hover) */
.inner-box .overlay-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(47, 50, 56, 0.85);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  box-sizing: border-box;
}

.overlay-content h5 {
  color: #000;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 10px;
  font-size: 16px;
  transform: translateX(-30px);
  transition: transform 0.3s ease;
}

.overlay-content p {
  color: #2f3238;
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 10px;
  font-size: 13px;
  margin-top: 2px;
  transform: translateX(-30px);
  transition: transform 0.4s ease;
}

.overlay-content p a {
  color: #000;
  transition: color 0.3s ease;
}

.overlay-content p a:hover {
  color: #B4CB00;
}

.inner-box:hover .image img {
  transform: scale(1.05);
}

.inner-box:hover .overlay-box {
  opacity: 1;
}

.inner-box:hover .overlay-content h5,
.inner-box:hover .overlay-content p {
  transform: translateX(0);
}

/* 4. ESTILOS Y CENTRADO EXCLUSIVO PARA LOGOS */
.inner-box.logo-box {
  background: none;
  border: none;
  border-radius: 0;
  padding: 10px;
  width: 100%;
  min-height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  text-align: center;
}

.inner-box.logo-box .image {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.inner-box.logo-box .image img {
  max-width: 100%;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto !important;
  transform: none !important;
}

.inner-box.logo-box .overlay-box {
  display: none !important;
}

/* 5. RESPONSIVE (MEDIA QUERIES) */
@media (max-width: 992px) {
  .portfolio-grid.four-columns {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 576px) {
  .portfolio-grid,
  .portfolio-grid.four-columns {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .btn-filter {
    padding: 6px 12px;
    font-size: 13px;
  }
}