/* Reproducción de las tarjetas de la referencia del usuario. Solo afecta a esta sección. */
/* Inicio: comparte las ilustraciones y colores de las categorías oficiales. */
#home-sectores .home-category-card { --category-color:#1577cd; --category-tint:#f4f9ff; display:flex; flex-direction:column; align-items:center; gap:12px; min-width:0; padding:20px 12px 14px; border:1px solid #e8ecf2; border-radius:14px; background:#fff; color:#07182f; text-align:center; text-decoration:none; box-shadow:0 2px 3px #15284606; }
#home-sectores .home-category-card:hover { border-color:var(--category-color); background:var(--category-tint); }
#home-sectores .home-category-card:focus-visible { outline:3px solid var(--category-color); outline-offset:3px; }
#home-sectores .home-category-card h3 { margin:0; font-size:13px; line-height:1.4; overflow-wrap:anywhere; }
#home-sectores .home-category-count { display:flex; align-items:center; justify-content:center; gap:5px; margin-top:auto; color:#526b91; font-size:12px; }
#home-sectores .home-category-action { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding-top:12px; border-top:1px solid var(--category-tint); color:var(--category-color); font-size:12px; font-weight:700; }
#home-sectores .home-category-count svg, #home-sectores .home-category-action svg { width:15px; height:15px; flex:none; }
#home-sectores .home-category-status { grid-column:1/-1; padding:20px; text-align:center; color:#526b91; }
#home-sectores .home-category-status p { margin-bottom:12px; }
.directory-categories { padding:20px; background:#f6f8fa; scroll-margin-top:80px; }
.category-surface { max-width:1496px; margin:auto; padding:22px 30px 16px; background:#fff; border-radius:16px; }
.category-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:20px; }
.category-heading h2 { margin:0; color:#07182f; font-size:clamp(24px,2.25vw,34px); font-weight:700; line-height:1.25; letter-spacing:-1.2px; }
.category-heading p { margin:8px 0 0; color:#526b91; font-size:14px; }
.category-heading .category-total { display:flex; align-items:center; gap:5px; font-size:13px; margin-top:14px; }
.category-total svg, .category-company-count svg { width:15px; height:15px; flex:none; }
.category-tools { display:flex; gap:20px; padding-top:16px; min-width:0; flex:0 1 596px; }
.category-tools form { display:flex; align-items:center; min-width:0; flex:1; border:1px solid #e0e6ef; border-radius:9px; height:44px; background:#fff; }
.category-tools form:focus-within { outline:2px solid #187acb; outline-offset:2px; }
.category-tools form button { padding:10px 12px; border:0; background:none; color:#526b91; cursor:pointer; display:flex; }
.category-tools form svg { width:19px; height:19px; }
.category-tools input { min-width:0; width:100%; height:100%; padding:0 10px 0 0; border:0; background:transparent; font:inherit; font-size:13px; color:#07182f; outline:none; }
.category-tools input::placeholder { color:#526b91; opacity:1; }
.category-tools select { width:188px; min-width:150px; height:44px; padding:0 18px; border:1px solid #e0e6ef; border-radius:9px; font:inherit; font-size:14px; font-weight:700; color:#07182f; background:#fff; }
.category-grid { display:grid; grid-template-columns:repeat(42,minmax(0,1fr)); gap:20px; }
.category-card { --category-color:#1577cd; --category-tint:#f5faff; grid-column:span 7; position:relative; display:flex; flex-direction:column; padding:0; min-width:0; border:1px solid #e8ecf2; border-radius:14px; background:#fff; color:#07182f; overflow:hidden; box-shadow:0 2px 3px #15284606; font:inherit; cursor:pointer; text-align:center; transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.category-card:hover { transform:translateY(-3px); border-color:var(--category-color); box-shadow:0 7px 18px #15284610; }
.category-card.is-selected { border-color:var(--category-color); box-shadow:inset 0 0 0 1px var(--category-color); background:var(--category-tint); }
.category-compact-hint { display:none; }
.category-card:focus-visible, .category-tools select:focus-visible { outline:3px solid var(--category-color,#1577cd); outline-offset:3px; }
.category-number { position:absolute; top:10px; left:12px; display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:linear-gradient(150deg,#ffffff38,transparent 60%),var(--category-color); color:#fff; font-size:18px; font-weight:800; line-height:1; box-shadow:inset 0 -2px 3px #0000000c; }
.category-card-body { display:flex; flex-direction:column; align-items:center; flex:1; width:100%; padding:30px 10px 20px; }
.category-illustration { display:block; flex:none; width:96px; height:96px; border-radius:50%; background-image:url('/img/rgseaa-category-illustrations.png'); background-size:1536px 1024px; background-repeat:no-repeat; background-position:var(--illustration-x) var(--illustration-y); }
.category-illustration-fallback { background-image:none; background-color:var(--category-tint); display:grid; place-items:center; color:var(--category-color); }
.category-illustration-fallback svg { width:52px; height:52px; }
.category-name { margin:8px 0 14px; min-height:40px; font-size:15px; font-weight:700; line-height:1.3; letter-spacing:-.3px; overflow-wrap:break-word; }
.category-name-long { font-size:13.5px; line-height:1.4; }
.category-company-count { display:flex; align-items:center; justify-content:center; gap:6px; margin-top:auto; color:#526b91; font-size:13px; line-height:20px; }
.category-card-action { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; height:44px; padding:0 18px; background:linear-gradient(105deg,#fff,var(--category-tint)); border-top:1px solid var(--category-tint); color:var(--category-color); font-size:13px; font-weight:500; }
.category-card-arrow { display:grid; place-items:center; width:24px; height:24px; flex:none; background:linear-gradient(150deg,#ffffff35,transparent 70%),var(--category-color); color:#fff; border-radius:50%; }
.category-card-arrow svg { width:18px; height:18px; }
.category-grid-full .category-card:nth-child(n+13) { grid-column:span 6; }
.category-grid-full .category-card:nth-child(n+13) .category-card-body { padding:18px 9px 12px; }
.category-grid-full .category-card:nth-child(n+13) .category-illustration { width:82px; height:82px; background-size:1312px 874.6667px; background-position:calc(var(--illustration-x) * .8541667) calc(var(--illustration-y) * .8541667); }
.category-grid-full .category-card:nth-child(n+13) .category-name { font-size:14px; margin:6px 0 8px; }
.category-grid-full .category-card:nth-child(n+13) .category-name-long { font-size:12px; }
.category-grid-full .category-card:nth-child(n+13) .category-company-count { font-size:12px; }
.category-grid-full .category-card:nth-child(n+13) .category-card-action { height:40px; }
.category-bottom { display:flex; justify-content:flex-end; padding-top:22px; color:#526b91; font-size:14px; }
.category-bottom p { margin:0; }
.category-message { grid-column:1/-1; text-align:center; padding:24px; color:#526b91; }
.category-message[hidden] { display:none; }
.category-message p { margin:0 0 16px; }
@media(max-width:1199px) {
  .category-header { flex-direction:column; gap:14px; }
  .category-tools { flex:auto; width:100%; padding-top:0; }
  .category-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
  .category-grid .category-card { grid-column:auto; }
  .category-grid.category-grid-full .category-card:nth-child(n+13) { grid-column:auto; }
}
@media(max-width:767px) {
  .directory-categories { padding:16px 12px; }
  .category-surface { padding:20px 16px 16px; }
  .category-heading h2 { letter-spacing:-.6px; }
  .category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .category-tools { flex-wrap:wrap; gap:10px; }
  .category-tools form { flex-basis:100%; }
  .category-tools select { width:100%; }
  .category-card-body { padding:30px 9px 14px; }
  .category-name { font-size:14px; }
  .category-name-long { font-size:12px; }
  .category-company-count { font-size:11px; gap:3px; }
  .category-card-action { padding:0 10px; font-size:12px; }
  .category-heading .category-total { flex-wrap:wrap; }
  .category-bottom { justify-content:center; font-size:12px; }
}
/* Tras buscar, las mismas categorías pasan a una única fila, sin duplicar datos ni filtros. */
.directory-categories.is-compact { padding-top:16px; padding-bottom:0; }
.is-compact .category-surface { max-width:var(--max-width,1200px); padding:16px; }
.is-compact .category-header { flex-direction:row; align-items:center; flex-wrap:wrap; gap:8px 20px; margin-bottom:10px; }
.is-compact .category-heading h2 { font-size:18px; letter-spacing:-.4px; }
.is-compact .category-description, .is-compact .category-total, .is-compact .category-tools, .is-compact .category-bottom { display:none; }
.is-compact .category-compact-hint { display:block; margin:0; color:#526b91; font-size:12px; }
.is-compact .category-grid { display:flex; flex-wrap:nowrap; gap:10px; overflow-x:auto; padding:4px 3px 10px; overscroll-behavior-x:contain; scrollbar-width:thin; }
.is-compact .category-grid:focus-visible { outline:2px solid #1577cd; outline-offset:2px; border-radius:8px; }
.is-compact .category-card { flex:0 0 255px; border-radius:10px; }
.is-compact .category-card:hover { transform:none; }
.is-compact .category-card .category-number { top:9px; left:7px; width:18px; height:18px; font-size:11px; }
.is-compact .category-grid .category-card .category-card-body { display:grid; grid-template-columns:40px minmax(0,1fr); grid-template-rows:1fr auto; gap:2px 8px; padding:10px 9px 10px 30px; align-items:center; text-align:left; }
.is-compact .category-grid .category-card .category-illustration { grid-row:1/3; width:40px; height:40px; background-size:640px 426.6667px; background-position:calc(var(--illustration-x) * .4166667) calc(var(--illustration-y) * .4166667); }
.is-compact .category-illustration-fallback svg { width:26px; height:26px; }
.is-compact .category-grid .category-card .category-name { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; margin:0; min-height:32px; font-size:12px; line-height:1.3; letter-spacing:0; }
.is-compact .category-grid .category-card .category-company-count { justify-content:flex-start; margin:0; font-size:11px; gap:4px; }
.is-compact .category-card-action { display:none; }
.directory-categories.is-compact + #directory-results-section { padding-top:24px; scroll-margin-top:80px; }
@media(prefers-reduced-motion:reduce) { .category-card { transition:none; } .category-card:hover { transform:none; } }
