:root {
    --d2-ink: #111820;
    --d2-muted: #626b76;
    --d2-line: #dfe3e0;
    --d2-surface: #f4f5f2;
    --d2-white: #fff;
    --d2-orange: #ff7a2d;
    --d2-orange-dark: #d9510b;
    --d2-blue: #17375e;
    --d2-radius: 18px;
}

html { max-width: 100%; scroll-behavior: smooth; }
body.directorio2-body { max-width: 100%; margin: 0; overflow-x: clip; color: var(--d2-ink); background: var(--d2-surface); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 16px; }
.directorio2-body *, .directorio2-body *::before, .directorio2-body *::after { box-sizing: border-box; }
.directorio2-body a { color: inherit; }
.directorio2-body button, .directorio2-body input, .directorio2-body select, .directorio2-body textarea { font: inherit; }

#global-loader { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: var(--d2-white); }
.d2-loader { width: 28px; height: 28px; border: 3px solid rgba(255, 122, 45, .22); border-top-color: var(--d2-orange); border-radius: 50%; animation: d2-spin .75s linear infinite; }
@keyframes d2-spin { to { transform: rotate(360deg); } }

.d2-header { position: relative; z-index: 30; color: #f8fafc; background: var(--d2-ink); border-bottom: 1px solid rgba(255,255,255,.1); }
.d2-header__inner { width: min(1320px, calc(100% - 48px)); min-height: 88px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.d2-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none !important; }
.d2-brand__mark { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--d2-orange); color: var(--d2-ink); font-weight: 800; }
.d2-brand__mark--image { width: 60px; height: 64px; flex-basis: 60px; padding: 3px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: #fff; }
.d2-brand__mark--wide { width: 190px; flex-basis: 190px; padding: 3px 6px; }
.d2-brand__mark--fallback { padding: 0; border: 0; background: transparent; }
.d2-brand__mark img { width: auto; max-width: 100%; height: auto; max-height: 100%; margin: auto; display: block; object-fit: contain; object-position: center; background: #fff; }
.d2-brand__mark--fallback img { background: transparent; }
.d2-brand--wide-logo > span:last-child { display: none; }
.d2-brand strong, .d2-brand small { display: block; }
.d2-brand strong { font-size: 17px; letter-spacing: -.01em; }
.d2-brand small { margin-top: 2px; color: #aeb6c0; font-size: 12px; }
.d2-nav { display: flex; align-items: center; gap: 24px; }
.d2-nav a { color: #dce1e7; font-size: 14px; font-weight: 600; text-decoration: none !important; }
.d2-nav a:hover { color: #fff; }
.d2-nav a.is-active { color: #fff; }
.d2-nav__access, .d2-nav__cta { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #3a4654; border-radius: 999px; }
.d2-nav .d2-nav__cta { color: var(--d2-ink); background: var(--d2-orange); border-color: var(--d2-orange); }
.d2-nav .d2-nav__cta:hover { color: var(--d2-ink); background: #ff914f; }
.d2-menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid #3a4654; border-radius: 10px; color: #fff; background: transparent; }

.d2-hero { color: #f8fafc; background: var(--d2-ink); }
.d2-hero__inner { width: min(1320px, calc(100% - 48px)); min-width: 0; margin: 0 auto; padding: 72px 0 56px; }
.d2-eyebrow { margin: 0 0 10px; color: var(--d2-orange-dark); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.d2-hero .d2-eyebrow, .d2-search-hero .d2-eyebrow { color: #ff9a5f; }
.d2-hero h1 { max-width: 850px; margin: 0; color: #f8fafc; font-size: clamp(42px, 5.2vw, 72px); font-weight: 800; line-height: .98; letter-spacing: -.055em; }
.d2-hero__lead { max-width: 720px; margin: 24px 0 32px; color: #c1c8d0; font-size: 19px; line-height: 1.55; }

.d2-hero__search-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: stretch; }
.d2-search-form { min-width: 0; }
.d2-main-search { min-width: 0; min-height: 76px; margin: 0; padding: 0 20px; display: flex; align-items: center; gap: 14px; position: relative; border-radius: 14px; color: #68717c; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.d2-main-search i { flex: none; color: var(--d2-ink); font-size: 18px; }
.d2-main-search input { width: 100%; min-width: 0; height: 74px; padding: 0; border: 0; outline: 0; color: var(--d2-ink); background: transparent; font-size: 16px; }
.d2-main-search input::placeholder { color: #7e8792; }
.d2-main-search:focus-within { box-shadow: 0 0 0 3px rgba(255,122,45,.3), 0 18px 50px rgba(0,0,0,.22); }
.d2-main-search button { width: 1px; height: 1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }
.d2-stats { min-width: 0; margin: 0; display: flex; gap: 12px; }
.d2-stats > div { min-width: 112px; padding: 14px 16px; display: flex; justify-content: center; flex-direction: column; border: 1px solid #333e4b; border-radius: 12px; }
.d2-stats strong, .d2-stats span { display: block; }
.d2-stats strong { font-size: 24px; }
.d2-stats span { margin-top: 2px; color: #aeb7c1; font-size: 12px; }

.d2-search-hero { color: #f8fafc; background: var(--d2-ink); }
.d2-search-hero__inner { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 48px; }
.d2-back-link { margin-bottom: 26px; display: inline-flex; align-items: center; gap: 8px; color: #adb6c0 !important; font-size: 13px; text-decoration: none !important; }
.d2-search-hero h1 { margin: 0 0 26px; color: #f8fafc; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.04em; }

.d2-catalog { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 58px 0 90px; }
.d2-catalog__heading { min-width: 0; margin: 0 0 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.d2-catalog__heading h2 { margin: 0; color: var(--d2-ink); font-size: 36px; letter-spacing: -.035em; }
.d2-catalog__heading p:last-child { margin: 7px 0 0; color: var(--d2-muted); }
.d2-total { flex: none; color: var(--d2-muted); }
.d2-total strong { color: var(--d2-ink); }
.d2-catalog__layout { min-width: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.d2-areas { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; padding-right: 5px; }
.d2-areas__title { margin-bottom: 12px; color: #707985; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.d2-area { width: 100%; min-height: 48px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 10px; color: #343b44; background: transparent; cursor: pointer; text-align: left; }
.d2-area span { display: flex; align-items: flex-start; gap: 9px; line-height: 1.3; }
.d2-area small { min-width: 20px; color: #8a929a; font-size: 10px; }
.d2-area i { color: #8d959d; }
.d2-area:hover { background: #e9ebe7; }
.d2-area.is-active { color: #fff; background: var(--d2-ink); font-weight: 700; }
.d2-area.is-active small, .d2-area.is-active i { color: #d6dbe0; }
.d2-catalog-filters { margin-bottom: 20px; padding: 18px 16px 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(142px, .9fr); gap: 12px; align-items: end; border: 1px solid var(--d2-line); border-radius: 16px; background: #fff; }
.d2-catalog-filters label { min-width: 0; margin: 0; }
.d2-catalog-filters label > span { margin-bottom: 7px; display: block; color: #434b54; font-size: 12px; font-weight: 800; }
.d2-catalog-filters select { width: 100%; height: 46px; padding: 0 34px 0 12px; overflow: hidden; border: 1px solid #cfd4d0; border-radius: 10px; outline: 0; color: #252c33; background: #fff; text-overflow: ellipsis; }
.d2-catalog-filters select:focus { border-color: var(--d2-orange); box-shadow: 0 0 0 3px rgba(255,122,45,.13); }
.d2-catalog-filters .select2-container { width: 100% !important; min-width: 0; display: block; }
.d2-catalog-filters .select2-container .select2-selection--single { height: 46px; border: 1px solid #cfd4d0; border-radius: 10px; outline: 0; background: #fff; }
.d2-catalog-filters .select2-container--focus .select2-selection--single, .d2-catalog-filters .select2-container--open .select2-selection--single { border-color: var(--d2-orange); box-shadow: 0 0 0 3px rgba(255,122,45,.13); }
.d2-catalog-filters .select2-container .select2-selection--single .select2-selection__rendered { height: 44px; padding: 0 60px 0 12px; color: #252c33; font-size: 13px; line-height: 44px; }
.d2-catalog-filters .select2-container .select2-selection--single .select2-selection__arrow { width: 30px; height: 44px; right: 4px; }
.d2-catalog-filters .select2-container .select2-selection--single .select2-selection__clear { width: 24px; height: 28px; margin: 0; display: grid; position: absolute; top: 50%; right: 32px; z-index: 2; place-items: center; transform: translateY(-50%); border-radius: 7px; color: #737c85; font-size: 20px; font-weight: 500; line-height: 1; cursor: pointer; }
.d2-catalog-filters .select2-container .select2-selection--single .select2-selection__clear:hover { color: #8c3300; background: #fff0e6; }
.d2-catalog-filters .select2-container .select2-selection--single .select2-selection__clear:focus { outline: 2px solid var(--d2-orange); outline-offset: 1px; }
.select2-container--open { z-index: 130; }
.select2-dropdown { overflow: hidden; border: 1px solid #cfd4d0; border-radius: 10px; background: #fff; box-shadow: 0 14px 34px rgba(17,24,32,.16); }
.select2-container--open .select2-dropdown--below { margin-top: 5px; border-top: 1px solid #cfd4d0; border-radius: 10px; }
.select2-container--open .select2-dropdown--above { margin-top: -5px; border-bottom: 1px solid #cfd4d0; border-radius: 10px; }
.select2-search--dropdown { padding: 9px; border-bottom: 1px solid #e7e9e6; }
.select2-container--default .select2-search--dropdown .select2-search__field { height: 40px; padding: 0 12px; border: 1px solid #cbd1cc; border-radius: 8px; outline: 0; color: var(--d2-ink); background: #fff; font-size: 13px; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--d2-orange); box-shadow: 0 0 0 3px rgba(255,122,45,.12); }
.select2-results__options { padding: 5px; }
.select2-container--default .select2-results__option { padding: 9px 10px; border-radius: 7px; color: #343b44; font-size: 13px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { color: #fff; background: var(--d2-ink); }
.select2-container--default .select2-results__option[aria-selected=true] { color: #793000; background: #fff0e6; }
.d2-clear-catalog-filters { min-height: 46px; padding: 0 16px; border: 1px solid #cfd4d0; border-radius: 10px; color: #242a30; background: #f7f8f6; font-size: 13px; font-weight: 800; cursor: pointer; }
.d2-clear-catalog-filters:hover { border-color: #abb2ad; background: #eef0ed; }
.d2-apply-catalog-filters, .d2-drawer__header, .d2-mobile-tools, .d2-drawer-backdrop { display: none; }
.d2-results { min-width: 0; }
.d2-results-meta { margin-bottom: 20px; padding: 0 2px 14px; display: flex; justify-content: flex-end; border-bottom: 1px solid var(--d2-line); color: var(--d2-muted); font-size: 13px; }
.d2-results-meta strong { color: var(--d2-ink); }
.d2-company-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.d2-company-card { min-height: 410px; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--d2-line); border-radius: var(--d2-radius); background: var(--d2-white); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.d2-company-card:hover { transform: translateY(-3px); border-color: #c8ceca; box-shadow: 0 15px 34px rgba(23, 32, 42, .08); }
.d2-company-card.is-featured { border: 2px solid var(--d2-orange); }
.d2-company-card__top { min-height: 52px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.d2-company-logo { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: #1d252c; background: #edf0ec; font-weight: 800; }
.d2-company-logo.has-image { border: 1px solid #e3e6e2; background: #fff; }
.d2-company-logo img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.d2-badge { padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.d2-badge--featured { color: #572000; background: #ff9a5f; }
.d2-company-card__content { padding-top: 16px; flex: 1; }
.d2-company-card h3 { margin: 0 0 8px; color: var(--d2-ink); font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
.d2-company-card h3 a { text-decoration: none !important; }
.d2-company-card__content > p { min-height: 66px; margin: 0; color: #4f5761; font-size: 14px; line-height: 1.55; }
.d2-search-match { margin-top: 12px; padding: 10px 11px; border-left: 3px solid var(--d2-orange); border-radius: 0 8px 8px 0; color: #4f5761; background: #fff6ef; font-size: 12px; line-height: 1.4; }
.d2-search-match strong, .d2-search-match span { display: block; }
.d2-search-match strong { margin-bottom: 3px; color: #9a3c08; font-size: 11px; text-transform: uppercase; letter-spacing: .025em; }
.d2-search-match strong i { margin-right: 4px; }
.d2-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.d2-tags span { padding: 5px 9px; border: 1px solid #dfe3df; border-radius: 999px; color: #4d555d; background: #f1f3f0; font-size: 11px; line-height: 1.2; }
.d2-company-card__footer { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e8eae7; }
.d2-company-location { margin-bottom: 13px; color: #606975; font-size: 13px; }
.d2-company-location i { margin-right: 5px; }
.d2-profile-button { min-height: 44px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-radius: 10px; color: #fff !important; background: var(--d2-ink); font-size: 13px; font-weight: 800; text-decoration: none !important; }
.d2-profile-button:hover { background: var(--d2-blue); }
.d2-loading { min-height: 90px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--d2-muted); }
#d2-scroll-sentinel { height: 2px; }
.d2-end-results, .d2-load-error { margin-top: 22px; padding: 16px; border: 1px solid var(--d2-line); border-radius: 12px; color: var(--d2-muted); background: #fff; text-align: center; }
.d2-load-error button { margin-left: 8px; border: 0; color: var(--d2-orange-dark); background: transparent; font-weight: 700; cursor: pointer; }
.d2-empty-state { grid-column: 1 / -1; padding: 64px 24px; border: 1px dashed #cdd2ce; border-radius: var(--d2-radius); color: var(--d2-muted); background: #fff; text-align: center; }
.d2-empty-state i { color: var(--d2-orange-dark); font-size: 28px; }
.d2-empty-state h3 { margin: 14px 0 6px; color: var(--d2-ink); font-size: 21px; }
.d2-empty-state p { margin: 0; }
.d2-mobile-area-wrap { display: none; }

.d2-footer { color: #d8dde3; background: var(--d2-ink); }
.d2-footer__inner { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 28px; display: grid; grid-template-columns: 1fr auto; gap: 30px; }
.d2-footer strong { color: #fff; font-size: 18px; }
.d2-footer p { margin: 8px 0 0; color: #98a2ad; font-size: 13px; }
.d2-footer__links { display: flex; gap: 24px; }
.d2-footer__links a { color: #d8dde3; font-size: 13px; text-decoration: none; }
.d2-footer__copyright { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid #303a45; }
.d2-footer__copyright a { color: #fff; }

@media (max-width: 1120px) {
    .d2-nav { gap: 14px; }
    .d2-menu-toggle { display: block; }
    .d2-nav { position: absolute; top: 74px; left: 16px; right: 16px; padding: 16px; display: none; align-items: stretch; flex-direction: column; border: 1px solid #3a4654; border-radius: 14px; background: #18212a; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
    .d2-nav.is-open { display: flex; }
    .d2-nav > a:not(.d2-nav__access):not(.d2-nav__cta) { display: block; padding: 9px 3px; }
    .d2-nav__access, .d2-nav__cta { justify-content: center; }
    .d2-company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .d2-hero__search-row { grid-template-columns: 1fr; }
    .d2-stats > div { flex: 1; }
    .d2-catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .d2-clear-catalog-filters { grid-column: span 2; }
}

@media (max-width: 820px) {
    .d2-header__inner, .d2-hero__inner, .d2-search-hero__inner, .d2-catalog, .d2-footer__inner { width: min(1320px, calc(100% - 32px)); }
    .d2-search-hero h1, .d2-company-card h3, .d2-company-card__content, .d2-search-match { min-width: 0; overflow-wrap: anywhere; }
    .d2-hero__inner { padding: 50px 0 42px; }
    .d2-main-search { min-height: 62px; }
    .d2-main-search input { height: 60px; }
    .d2-stats { width: 100%; overflow-x: auto; padding-bottom: 5px; }
    .d2-catalog__layout { grid-template-columns: 1fr; }
    .d2-catalog__heading { margin-bottom: 18px; }
    .d2-catalog__heading h2 { font-size: 31px; }
    .d2-catalog__heading p:last-child { max-width: 520px; font-size: 13px; line-height: 1.5; }
    .d2-mobile-tools { width: 100%; min-width: 0; margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .d2-mobile-tools button { min-width: 0; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #cfd4d0; border-radius: 11px; color: var(--d2-ink); background: #fff; font-size: 14px; font-weight: 800; cursor: pointer; }
    .d2-mobile-tools button[aria-expanded="true"] { border-color: var(--d2-orange); color: #8c3300; background: #fff3eb; }
    body.d2-drawer-open { overflow: hidden; }
    .d2-drawer-backdrop { width: auto; height: auto; padding: 0; display: block; position: fixed; inset: 0; z-index: 80; visibility: hidden; border: 0; opacity: 0; background: rgba(8, 14, 20, .58); transition: opacity .24s ease, visibility .24s ease; }
    .d2-drawer-backdrop.is-open { visibility: visible; opacity: 1; }
    .d2-drawer { width: min(88vw, 390px); max-height: none; margin: 0; display: block; position: fixed; top: 0; bottom: 0; z-index: 90; overflow-y: auto; border: 0; border-radius: 0; background: #fff; box-shadow: 0 0 45px rgba(0,0,0,.22); visibility: hidden; transition: transform .28s ease, visibility .28s ease; }
    .d2-drawer.is-open { visibility: visible; transform: translateX(0); }
    .d2-drawer--areas { left: 0; padding: 0 16px 28px; transform: translateX(-105%); }
    .d2-drawer--filters { right: 0; padding: 0 18px 28px; transform: translateX(105%); }
    .d2-drawer__header { min-height: 68px; margin: 0 -2px 16px; display: flex; position: sticky; top: 0; z-index: 2; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--d2-line); background: #fff; }
    .d2-drawer__header strong { color: var(--d2-ink); font-size: 18px; }
    .d2-drawer__close { width: 42px; height: 42px; border: 1px solid var(--d2-line); border-radius: 10px; color: var(--d2-ink); background: #f5f6f4; cursor: pointer; }
    .d2-areas__title { display: none; }
    .d2-catalog-filters label { margin-bottom: 16px; display: block; }
    .d2-catalog-filters select { height: 50px; }
    .d2-catalog-filters .select2-container .select2-selection--single { height: 50px; }
    .d2-catalog-filters .select2-container .select2-selection--single .select2-selection__rendered { height: 48px; line-height: 48px; }
    .d2-catalog-filters .select2-container .select2-selection--single .select2-selection__arrow { height: 48px; }
    .d2-clear-catalog-filters, .d2-apply-catalog-filters { width: 100%; min-height: 50px; }
    .d2-apply-catalog-filters { margin-top: 10px; display: block; border: 1px solid var(--d2-ink); border-radius: 10px; color: #fff; background: var(--d2-ink); font-size: 14px; font-weight: 800; cursor: pointer; }
    .d2-results-meta { margin-bottom: 14px; padding-bottom: 10px; }
}

@media (max-width: 580px) {
    .d2-brand__mark--wide { width: 150px; height: 54px; flex-basis: 150px; padding: 2px 4px; }
    .d2-brand__mark--fallback { padding: 0; }
    .d2-brand--with-logo > span:last-child { display: none; }
    .d2-brand small { display: none; }
    .d2-hero h1 { font-size: 42px; overflow-wrap: anywhere; }
    .d2-hero__lead { font-size: 16px; }
    .d2-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .d2-stats > div { min-width: 0; padding: 12px; }
    .d2-catalog { padding-top: 42px; }
    .d2-catalog__heading { align-items: flex-start; flex-direction: column; }
    .d2-company-grid { grid-template-columns: 1fr; }
    .d2-company-card { min-height: 370px; }
    .d2-footer__inner { grid-template-columns: 1fr; }
    .d2-footer__links { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .d2-company-card { transition: none; }
    .d2-loader { animation-duration: 1.5s; }
    .d2-drawer, .d2-drawer-backdrop { transition: none; }
}
