/* =========================================================
   AvalPayCenter — Obligaciones Aval (vista-7)
   Clonación 1:1 de la vista de convenios (idCategory=25).
   Colores/medidas tomados del sitio real (fuente Jost).
   ========================================================= */

:root {
  --navy:   #001635;   /* texto principal / títulos (jost-bold) */
  --blue:   #5dbaeb;   /* azul botones y acentos */
  --blue-soft:#eaf4fc;
  --red:    #e4002b;
  --green:  #00a44a;
  --avatar-green:#7ac143; /* círculo de iniciales (BO) */
  --white:  #ffffff;
  --gray:   #5a6472;
  --line:   #e4e9f0;
  --card-shadow: 0 8px 22px rgba(0, 22, 53, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', 'Segoe UI', system-ui, sans-serif;
  color: var(--navy);
  background: var(--white);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Botones genéricos ---------- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 700;
  border-radius: 25px;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--blue); color: var(--navy); padding: 14px 32px; font-size: 14px; }
.btn-primary:hover { box-shadow: 0 8px 18px rgba(93,186,235,.45); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: 10px 26px; border-radius: 25px; font-weight: 700; }
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* ---------- Puntos decorativos ---------- */
.dots { display: flex; gap: 9px; margin: 10px 0 18px; }
.dot { width: 13px; height: 13px; border-radius: 50%; }
.dot-navy{background:var(--navy);} .dot-red{background:var(--red);}
.dot-blue{background:var(--blue);} .dot-green{background:var(--green);}

/* =========================================================
   HEADER (igual que index)
   ========================================================= */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 34px; width: auto; }
.brand-logo-aval { height: 26px; border-left: 1px solid var(--line); padding-left: 10px; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav ul { display: flex; list-style: none; gap: 26px; align-items: center; }
.main-nav a { font-weight: 500; color: var(--navy); font-size: .98rem; padding: 6px 0; }
.main-nav a:hover { color: var(--blue); }
.main-nav a.active { color: var(--blue); font-weight: 700; }
.nav-cta { padding: 10px 26px; }
.nav-toggle { display: none; }
.nav-burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.nav-burger span { width: 26px; height: 3px; background: var(--navy); border-radius: 3px; }

/* =========================================================
   HERO de la categoría
   ========================================================= */
.cat-hero { padding: 28px 0 10px; }
.breadcrumb { font-size: .85rem; color: var(--gray); margin-bottom: 20px; }
.breadcrumb a { color: var(--navy); }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--line); }
.breadcrumb .current { color: var(--gray); }

.cat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.cat-title { font-size: 32px; font-weight: 700; color: var(--navy); }
.cat-desc { font-size: .95rem; color: var(--navy); max-width: 460px; }
.cat-icon { width: 130px; flex-shrink: 0; }
.cat-icon img { width: 100%; }

.volver { display: block; text-align: right; color: var(--navy); font-weight: 500; margin: 18px 0 6px; }
.volver:hover { color: var(--blue); }
.volver .arrow { color: var(--blue); margin-right: 4px; }

/* =========================================================
   FILTROS
   ========================================================= */
.filters { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 18px 0 30px; }
.search-field { position: relative; flex: 1; min-width: 260px; }
.search-field .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); opacity: .45; }
.search-field input {
  width: 100%;
  border: 1px solid var(--navy);
  border-radius: 25px;
  padding: 13px 20px 13px 46px;
  font-size: 15px;
  font-family: inherit;
  color: var(--navy);
  outline: none;
}
.search-field input::placeholder { color: #9aa3b0; }

.dept-field { position: relative; min-width: 200px; }
.dept-field label { position: absolute; top: -8px; left: 16px; background: var(--white); padding: 0 6px; font-size: .72rem; color: var(--gray); }
.dept-field select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--navy);
  border-radius: 25px;
  padding: 13px 40px 13px 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  outline: none;
}
.dept-field::after {
  content: "⌄";
  position: absolute; right: 18px; top: 46%; transform: translateY(-50%);
  pointer-events: none; color: var(--navy); font-size: 1.1rem;
}

/* =========================================================
   RESULTADOS
   ========================================================= */
.result-area { padding-bottom: 20px; }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.mostrar { position: relative; }
.mostrar .lbl { position: absolute; top: -8px; left: 14px; background: var(--white); padding: 0 6px; font-size: .72rem; color: var(--gray); }
.mostrar .box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 30px 8px 14px; font-size: .9rem; position: relative; }
.mostrar .box::after { content:"⌄"; position:absolute; right:12px; top:44%; transform:translateY(-50%); color:var(--navy); }
.count { color: var(--navy); font-size: .95rem; }
.count .c { display: none; }

/* Grids de página */
.pages { min-height: 420px; }
.page { display: none; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.conv-card {
  background: var(--white);
  border-radius: 25px;
  box-shadow: var(--card-shadow);
  min-height: 150px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.conv-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,22,53,.14); }
.conv-logo { height: 46px; max-width: 150px; object-fit: contain; }
.conv-name { font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.3; }

/* Avatar de iniciales (cuando no hay logo, ej. "BO") */
.conv-initials {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--avatar-green);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; letter-spacing: .02em;
}

/* =========================================================
   PAGINACIÓN (radio-hack, sin JS)
   ========================================================= */
.pg-radio { position: absolute; opacity: 0; pointer-events: none; }

.pager { display: flex; justify-content: center; margin: 34px 0 10px; }
.pager-inner { display: flex; align-items: center; gap: 14px; }

.pg-num, .arrow {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-weight: 600; cursor: pointer; user-select: none; font-size: .95rem;
}
.pg-num { color: var(--navy); background: transparent; }
.pg-num:hover { background: #eef2f8; }

.arrow { background: var(--navy); color: var(--white); font-size: 1rem; }
.arrow.disabled { opacity: .35; cursor: default; pointer-events: none; }
.arrow:hover:not(.disabled) { background: #0a2452; }

/* Estado activo de cada número según el radio marcado */
#pg1:checked ~ .pager .pager-inner label[for="pg1"],
#pg2:checked ~ .pager .pager-inner label[for="pg2"],
#pg3:checked ~ .pager .pager-inner label[for="pg3"],
#pg4:checked ~ .pager .pager-inner label[for="pg4"] {
  background: var(--navy); color: var(--white);
}

/* Mostrar la página correspondiente */
#pg1:checked ~ .pages .page1,
#pg2:checked ~ .pages .page2,
#pg3:checked ~ .pages .page3,
#pg4:checked ~ .pages .page4 { display: grid; }

/* Contador "X de 38 resultados" por página */
#pg1:checked ~ .result-head .count .c1,
#pg2:checked ~ .result-head .count .c2,
#pg3:checked ~ .result-head .count .c3,
#pg4:checked ~ .result-head .count .c4 { display: inline; }

/* Flechas prev/next: solo se muestra la del estado actual */
.arrow.prev, .arrow.next { display: none; }
#pg1:checked ~ .pager .prev1, #pg1:checked ~ .pager .next1,
#pg2:checked ~ .pager .prev2, #pg2:checked ~ .pager .next2,
#pg3:checked ~ .pager .prev3, #pg3:checked ~ .pager .next3,
#pg4:checked ~ .pager .prev4, #pg4:checked ~ .pager .next4 { display: flex; }

/* =========================================================
   FOOTER (igual que index)
   ========================================================= */
.site-footer { padding: 40px 0; border-top: 1px solid var(--line); position: relative; margin-top: 30px; }
.footer-inner { text-align: center; position: relative; }
.footer-vigilado { position: absolute; left: -4px; top: 0; height: 90px; width: auto; opacity: .9; }
.footer-banks { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-banks-sprite { height: 34px; width: auto; }
.footer-aval { height: 40px; width: auto; }
.footer-norton { height: 44px; width: auto; }
.footer-phones { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; font-weight: 600; margin-bottom: 16px; }
.footer-phones a { color: var(--navy); }
.footer-links { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; color: var(--gray); }
.footer-links a:hover { color: var(--blue); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1000px) {
  .page { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .nav-burger { display: flex; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0; background: var(--white);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 0 24px;
    max-height: 0; overflow: hidden; box-shadow: var(--card-shadow);
    transition: max-height .3s ease, padding .3s ease;
  }
  .main-nav ul { flex-direction: column; width: 100%; gap: 0; align-items: stretch; }
  .main-nav ul li { border-bottom: 1px solid var(--line); }
  .main-nav ul li a { display: block; padding: 14px 0; }
  .nav-cta { margin: 16px 0; }
  .nav-toggle:checked ~ .main-nav { max-height: 520px; padding: 10px 24px 20px; }
  .page { grid-template-columns: repeat(2, 1fr); }
  .cat-icon { width: 90px; }
}
@media (max-width: 520px) {
  .page { grid-template-columns: 1fr 1fr; gap: 14px; }
  .filters { flex-direction: column; align-items: stretch; }
  .footer-phones, .footer-links { flex-direction: column; gap: 10px; }
}
