/* ══════════════════════════════════════
   especialidades.css
   Especialidades Listing Page
   ══════════════════════════════════════ */

/* ════════════════════════
   HEADER
════════════════════════ */
.esp-header {
  background: #fff;
  padding: 44px 24px 32px;
}

.esp-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.esp-header-text h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  color: #0d2d6b;
  line-height: 1.08;
}

.esp-header-text p {
  margin-top: 10px;
  font-size: clamp(13px, 1.6vw, 16px);
  color: #5a6272;
  font-weight: 600;
}

/* ════════════════════════
   SEARCH BOX
════════════════════════ */
.search-box {
  display: flex;
  align-items: center;
  border: 2px solid #d9e2f2;
  border-radius: 50px;
  padding: 6px 8px 6px 20px;
  gap: 10px;
  min-width: 280px;
  max-width: 360px;
  background: #f5f8ff;
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}

.search-box:focus-within {
  border-color: #1a56c4;
  box-shadow: 0 2px 12px rgba(26, 86, 196, .12);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 13.5px;
  color: #1a1a2e;
  background: transparent;
}

.search-box input::placeholder {
  color: #9aa5bb;
}

.search-btn {
  background: #e02020;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}

.search-btn:hover {
  background: #c01010;
  transform: scale(1.05);
}

.search-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: white;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ════════════════════════
   GRID SECTION
════════════════════════ */
.esp-grid-section {
  padding: 32px 24px 60px;
  background: #fff;
}

.esp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

/* ════════════════════════
   CARDS — compact
════════════════════════ */
.esp-card {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
  transition: transform .25s, box-shadow .25s;
}

.esp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

.esp-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: #e8f0fa;
}

.esp-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}

.esp-card:hover .esp-card-img img {
  transform: scale(1.04);
}

.esp-card-img--fallback {
  background: linear-gradient(135deg, #d6e8f8 0%, #b8d8f0 100%);
}

.esp-card-img--fallback img {
  display: none;
}

.esp-card-label {
  display: block;
  text-align: center;
  background: linear-gradient(90deg, #0a3a74 0%, #1093eb 100%);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .5px;
  padding: 8px 12px;
  text-decoration: none;
  text-transform: uppercase;
  transition: filter .2s;
}

.esp-card:hover .esp-card-label {
  filter: brightness(1.1);
}

.esp-card-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 0 11px;
  font-size: 12px;
  font-weight: 600;
  color: #5a6272;
  text-decoration: none;
  transition: color .2s;
}

.esp-card-more:hover {
  color: #1a56c4;
}

.esp-card-more svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ════════════════════════
   PAGINATION
════════════════════════ */
.pagination-wrap {
  display: flex;
  justify-content: center;
  padding: 36px 0 16px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pag-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 50px;
  border: 2px solid #d9e2f2;
  background: #fff;
  color: #0d2d6b;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pag-btn:hover {
  background: #f5f8ff;
  border-color: #1a56c4;
  color: #1a56c4;
}

.pag-btn.active {
  background: #0d2d6b;
  border-color: #0d2d6b;
  color: #fff;
  box-shadow: 0 3px 10px rgba(13, 45, 107, .28);
}

.pag-btn.disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ══════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
══════════════════════════════ */
@media (max-width: 1024px) {
  .esp-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .esp-header-row {
    gap: 24px;
  }

  .search-box {
    min-width: 220px;
    max-width: 280px;
  }
}

/* ══════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
══════════════════════════════ */
@media (max-width: 768px) {
  .esp-header {
    padding: 28px 16px 22px;
  }

  .esp-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .esp-header-text h1 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .esp-header-text p {
    font-size: 13px;
  }

  .search-box {
    width: 100%;
    min-width: unset;
    max-width: 100%;
    box-sizing: border-box;
  }

  .esp-grid-section {
    padding: 20px 12px 50px;
  }

  .esp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .esp-card-label {
    font-size: 10px;
    padding: 6px 8px;
  }

  .esp-card-more {
    font-size: 11px;
    padding: 7px 0 9px;
  }

  .pag-btn {
    min-width: 34px;
    height: 34px;
    font-size: 12px;
    padding: 0 10px;
  }
}

/* ══════════════════════════════
   RESPONSIVE — SMALL (≤ 400px)
══════════════════════════════ */
@media (max-width: 400px) {
  .esp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .esp-header-text h1 {
    font-size: 22px;
  }

  .esp-card-label {
    font-size: 9px;
    padding: 5px 6px;
  }

  .pag-btn {
    min-width: 30px;
    height: 30px;
    font-size: 11px;
  }
}
