:root {
  --navy: #12334a;
  --navy-deep: #092538;
  --blue: #1e6fb8;
  --blue-soft: #e9f4fb;
  --teal: #087c72;
  --teal-soft: #e6f5f2;
  --amber: #f5b942;
  --amber-soft: #fff5d2;
  --ink: #17212b;
  --muted: #5d6c77;
  --line: #d6e1e8;
  --canvas: #eef4f7;
  --white: #fff;
  --shadow: 0 18px 50px rgba(16, 50, 73, .12);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.skip-link { position: fixed; z-index: 30; top: 10px; left: 10px; padding: 10px 14px; color: white; background: var(--navy-deep); border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: relative; z-index: 5; color: var(--navy); background: white; border-bottom: 1px solid rgba(18, 51, 74, .12); }
.header-inner { width: min(1180px, calc(100% - 32px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 12px 12px 12px 4px; font-size: 14px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 12px; }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--navy); font-size: 14px; font-weight: 800; text-decoration: none; }
nav a:hover { color: var(--blue); text-decoration: underline; }
nav [data-show-saved] span { min-width: 21px; display: inline-grid; place-items: center; padding: 1px 6px; color: white; background: var(--teal); border-radius: 99px; font-size: 12px; }
nav .professional-link { padding: 9px 13px; color: white; background: var(--blue); border-radius: 9px; }
nav .professional-link:hover { color: white; background: #185d9b; text-decoration: none; }

.search-stage { overflow: hidden; color: white; background: var(--navy-deep); }
.stage-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: clamp(34px, 5vw, 66px) 0 34px; background: radial-gradient(circle at 78% 0%, rgba(30,111,184,.45), transparent 35%); }
.stage-copy { max-width: 800px; }
.eyebrow, .section-kicker, .dialog-kicker { margin: 0 0 7px; color: #74c9ff; font-size: 13px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
h1 { max-width: 840px; margin: 0; font-size: clamp(36px, 5vw, 62px); line-height: 1.05; letter-spacing: -.045em; }
.stage-copy > p:last-child { max-width: 700px; margin: 15px 0 0; color: #d4e4ed; font-size: 18px; }

.search-box { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 13px; color: var(--ink); background: white; border-radius: 16px; box-shadow: 0 18px 44px rgba(2, 20, 31, .28); }
.search-field { min-width: 0; padding: 0 10px; border-right: 1px solid var(--line); }
.search-field label { display: block; margin-bottom: 2px; color: var(--navy); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.search-field input, .search-field select { width: 100%; min-height: 42px; padding: 5px 0; color: var(--ink); background: white; border: 0; outline: 0; font-size: 16px; }
.search-field input:focus, .search-field select:focus { box-shadow: 0 2px 0 var(--blue); }
.search-button { min-height: 54px; padding: 10px 22px; color: white; background: var(--blue); border: 0; border-radius: 11px; font-weight: 850; cursor: pointer; }
.search-button:hover { background: #185d9b; }
.search-button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(66, 172, 241, .42); outline-offset: 3px; }
.direct-note { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #c8dce7; font-size: 14px; }
.direct-note > span:first-child { width: 22px; height: 22px; display: grid; place-items: center; color: var(--navy); background: var(--amber); border-radius: 50%; font-weight: 900; }
.direct-note strong { color: white; }

.demo-banner { width: min(1180px, calc(100% - 32px)); margin: 22px auto 0; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 13px 16px; color: #654800; background: var(--amber-soft); border: 1px solid #edd071; border-radius: 12px; }
.demo-banner strong, .demo-banner span { display: block; }
.demo-banner span { font-size: 14px; }
.demo-banner a { flex: 0 0 auto; color: var(--navy); font-size: 14px; font-weight: 850; }

.directory-shell { width: min(1180px, calc(100% - 32px)); margin: 24px auto 54px; }
.category-strip { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 12px; scrollbar-width: thin; }
.category-pill { flex: 0 0 auto; min-height: 38px; padding: 7px 13px; color: var(--navy); background: white; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 750; cursor: pointer; }
.category-pill:hover, .category-pill.active { color: white; background: var(--navy); border-color: var(--navy); }
.results-toolbar { margin: 20px 0 18px; display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.section-kicker { color: var(--teal); }
.results-toolbar h2, .how-intro h2 { margin: 0; color: var(--navy); font-size: clamp(27px, 3vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.result-actions { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; font-weight: 750; }
.result-actions button { padding: 3px 0; color: var(--blue); background: transparent; border: 0; border-bottom: 1px solid currentColor; font-weight: 800; cursor: pointer; }
.result-actions #show-saved { padding: 6px 9px; border: 1px solid #9db5c5; border-radius: 8px; }
.result-actions #show-saved span { min-width: 20px; display: inline-grid; place-items: center; margin-left: 3px; padding: 0 5px; color: white; background: var(--teal); border-radius: 99px; font-size: 12px; }
.result-actions #show-saved[aria-pressed="true"] { color: #185c54; background: var(--teal-soft); border-color: #76b8af; }
.active-filter { margin: -5px 0 18px; padding: 10px 13px; color: #18517b; background: var(--blue-soft); border-radius: 9px; font-size: 14px; }
.saved-note { margin: -6px 0 18px; padding: 10px 13px; color: #285b54; background: var(--teal-soft); border-radius: 9px; font-size: 14px; }
.catalog-status { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 30px; color: var(--navy); background: white; border: 1px solid var(--line); border-radius: 16px; }
.catalog-status p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.loading-mark { width: 32px; height: 32px; flex: 0 0 auto; border: 3px solid #c9dce8; border-top-color: var(--blue); border-radius: 50%; animation: loading .8s linear infinite; }
@keyframes loading { to { transform: rotate(360deg); } }

.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.professional-card { position: relative; overflow: hidden; padding: 22px; background: white; border: 1px solid rgba(18, 51, 74, .12); border-radius: 16px; box-shadow: 0 8px 26px rgba(16,50,73,.07); }
.professional-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--teal); }
.card-top { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.category-label { margin: 0 0 5px; color: var(--teal); font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.professional-card h3 { margin: 0; color: var(--navy); font-size: 22px; line-height: 1.2; }
.type-line { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.card-rating { margin: 7px 0 0; color: #735300; font-size: 14px; font-weight: 800; }
.fictional-chip { flex: 0 0 auto; padding: 5px 8px; color: #775400; background: var(--amber-soft); border-radius: 99px; font-size: 11px; font-weight: 800; }
.town-line { margin: 16px 0 0; display: flex; gap: 8px; align-items: flex-start; color: #355263; font-size: 14px; font-weight: 700; }
.pin { color: var(--blue); }
.card-description { min-height: 52px; margin: 13px 0 16px; color: #3f4d57; }
.service-tags { min-height: 27px; display: flex; flex-wrap: wrap; gap: 6px; }
.service-tags span { padding: 4px 8px; color: #286258; background: var(--teal-soft); border-radius: 7px; font-size: 12px; font-weight: 700; }
.card-actions { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.primary-button, .secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; border-radius: 9px; font-weight: 850; cursor: pointer; }
.primary-button { color: white; background: var(--blue); border: 1px solid var(--blue); }
.secondary-button { color: var(--navy); background: white; border: 1px solid #9db5c5; }
.primary-button:hover { background: #185d9b; }
.secondary-button:hover { background: #f1f6f9; }
.save-professional { width: 100%; min-height: 42px; margin-top: 9px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; color: var(--navy); background: #f6f9fa; border: 1px solid #b7c9d4; border-radius: 9px; font-size: 14px; font-weight: 800; cursor: pointer; }
.save-professional > span:first-child { color: #a06f00; font-size: 20px; line-height: 1; }
.save-professional:hover { background: var(--amber-soft); border-color: #dfbd59; }
.save-professional[aria-pressed="true"] { color: #185c54; background: var(--teal-soft); border-color: #76b8af; }
.dialog-save { margin-top: 20px; }
.reviews-panel { margin-top: 24px !important; padding-top: 22px; border-top: 1px solid var(--line); }
.reviews-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.reviews-heading .secondary-button { flex: 0 0 auto; }
.review-demo-note { margin-top: 12px !important; padding: 10px 12px; color: #654800; background: var(--amber-soft); border-radius: 9px; font-size: 13px; }
.reviews-list { margin-top: 14px; display: grid; gap: 10px; }
.reviews-empty { padding: 16px; color: var(--muted); background: #f5f8fa; border: 1px dashed #b3c5d0; border-radius: 10px; font-size: 14px; }
.review-card { overflow: hidden; background: white; border: 1px solid #cddbe3; border-radius: 11px; }
.review-card > summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px; cursor: pointer; list-style: none; }
.review-card > summary::-webkit-details-marker { display: none; }
.review-card > summary::after { content: "Ver detalle"; grid-column: 1 / -1; color: var(--blue); font-size: 13px; font-weight: 800; }
.review-card[open] > summary::after { content: "Ocultar detalle"; }
.review-card > summary strong, .review-card > summary span { display: block; }
.review-card > summary strong { color: var(--navy); font-size: 16px; }
.review-card > summary span { margin-top: 2px; color: var(--muted); font-size: 13px; }
.review-score { color: #765400 !important; font-size: 18px !important; font-weight: 900; white-space: nowrap; }
.review-content { padding: 0 14px 15px; border-top: 1px solid #e4ebef; }
.review-work { margin-top: 13px !important; color: var(--teal); font-size: 13px; font-weight: 800; }
.review-evidence-badge { margin-top: 10px !important; padding: 7px 9px; display: inline-flex; align-items: center; color: #185c54; background: var(--teal-soft); border: 1px solid #9bcfc7; border-radius: 7px; font-size: 12px; font-weight: 850; }
.review-comment { margin-top: 8px !important; color: #354752; }
.review-rating-grid { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.review-rating-grid div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #f2f7f9; border-radius: 7px; font-size: 13px; }
.review-rating-grid span { color: var(--muted); }
.review-rating-grid strong { color: var(--navy); }
.review-updated { margin-top: 12px !important; color: var(--muted); font-size: 13px; font-weight: 700; }
.review-history { margin-top: 10px; padding: 10px 11px; background: #f8fafb; border-radius: 8px; }
.review-history summary { color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 800; }
.review-history article { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.review-history article strong { display: block; color: var(--navy); font-size: 14px; }
.review-history article span { color: var(--muted); font-size: 12px; }
.review-history article p { margin-top: 6px; font-size: 13px; }
.professional-response { margin-top: 13px; padding: 12px 13px; background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 8px; }
.professional-response strong { display: block; color: var(--navy); font-size: 14px; }
.professional-response span { color: var(--muted); font-size: 12px; }
.professional-response p { margin-top: 6px; font-size: 14px; }
.no-response { margin-top: 12px !important; color: var(--muted); font-size: 13px; font-style: italic; }

.review-dialog { width: min(760px, calc(100% - 28px)); }
.review-form-notice { margin-bottom: 20px; padding: 13px 15px; color: #654800; background: var(--amber-soft); border: 1px solid #ecd176; border-radius: 10px; }
.review-form-notice p { margin-top: 3px; font-size: 14px; }
.review-evidence { margin: -7px 0 18px; padding: 12px 14px; color: #654800; background: var(--amber-soft); border-left: 4px solid #d3a01f; border-radius: 9px; }
.review-evidence[data-confirmed="true"] { color: #185c54; background: var(--teal-soft); border-left-color: var(--teal); }
.review-evidence strong { display: block; font-size: 14px; }
.review-evidence p { margin: 3px 0 0; font-size: 13px; }
#review-form { display: grid; gap: 9px; }
#review-form[hidden], .review-preview[hidden] { display: none; }
#review-form > label, .incident-fieldset > label { margin-top: 7px; color: var(--navy); font-size: 14px; font-weight: 800; }
#review-form > input, #review-form > textarea, #review-form > select, .incident-fieldset > select { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #aebfca; border-radius: 8px; }
#review-form > textarea { resize: vertical; }
#review-form input:focus, #review-form textarea:focus, #review-form select:focus { outline: 3px solid rgba(30,111,184,.22); border-color: var(--blue); }
.review-score-fieldset, .incident-fieldset { margin: 0 0 7px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.review-score-fieldset legend, .incident-fieldset legend { padding: 0 5px; color: var(--navy); font-size: 15px; font-weight: 850; }
.review-score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.rating-question > span { display: block; color: var(--navy); font-size: 13px; font-weight: 800; }
.rating-question > span small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.star-rating { width: max-content; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin-top: 3px; }
.star-rating input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.star-rating label { color: #aeb9bf; font-size: 31px; line-height: 1; cursor: pointer; transition: color .12s ease, transform .12s ease; }
.star-rating label:hover, .star-rating label:hover ~ label, .star-rating input:checked ~ label { color: #e7a400; }
.star-rating label:hover { transform: translateY(-1px); }
.star-rating input:focus-visible + label { outline: 3px solid rgba(30,111,184,.3); outline-offset: 2px; border-radius: 3px; }
.star-rating input:disabled + label { color: #cfd6da; cursor: not-allowed; transform: none; }
.inline-options { display: flex; gap: 10px; }
.inline-options label { min-width: 92px; padding: 8px 10px; background: #f3f7f9; border-radius: 8px; font-size: 14px; font-weight: 750; }
.incident-rating { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-field-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.review-form-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 9px; }
.review-preview > h3 { font-size: 23px; }
.review-preview > p:not(.dialog-kicker) { margin-top: 13px; color: var(--muted); font-size: 14px; }
#review-preview-card { margin-top: 14px; }

.empty-state { padding: 48px 20px; text-align: center; background: white; border: 1px dashed #9db5c5; border-radius: 16px; }
.empty-state > div { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 16px; font-size: 24px; font-weight: 900; }
.empty-state h3 { margin: 0; color: var(--navy); font-size: 23px; }
.empty-state p { max-width: 560px; margin: 8px auto 20px; color: var(--muted); }

.how-section { width: min(1180px, calc(100% - 32px)); margin: 0 auto 58px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 42px; align-items: start; padding: clamp(25px, 4vw, 40px); color: white; background: var(--navy); border-radius: 22px; box-shadow: var(--shadow); }
.how-intro .section-kicker { color: #74c9ff; }
.how-intro h2 { color: white; }
.how-intro > p:last-child { color: #cfe0e9; }
.how-steps { margin: 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.how-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 13px; padding: 15px; color: var(--ink); background: white; border-radius: 12px; }
.how-steps li > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--navy); background: var(--amber); border-radius: 10px; font-weight: 900; }
.how-steps strong { color: var(--navy); }
.how-steps p { margin: 1px 0 0; color: var(--muted); font-size: 14px; }

footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto 34px; display: flex; justify-content: space-between; gap: 22px; color: var(--muted); font-size: 13px; }
footer strong { color: var(--navy); }
footer p { margin: 3px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 20px; }
.footer-links a { color: var(--blue); }

dialog { width: min(760px, calc(100% - 28px)); max-height: min(820px, calc(100vh - 36px)); padding: 0; color: var(--ink); background: white; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(4, 24, 38, .38); }
dialog::backdrop { background: rgba(7,30,45,.72); backdrop-filter: blur(3px); }
.dialog-head { padding: 24px 26px 20px; display: flex; justify-content: space-between; gap: 20px; background: var(--navy); color: white; }
.dialog-kicker { color: #83d2ff; }
.dialog-head h2 { margin: 0; font-size: 29px; line-height: 1.2; }
.dialog-head p:last-child { margin: 5px 0 0; color: #cfe0e9; }
.icon-button { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); border-radius: 10px; font-size: 26px; cursor: pointer; }
.dialog-body { overflow-y: auto; padding: 24px 26px 28px; }
.dialog-body section + section { margin-top: 20px; }
.dialog-body h3 { margin: 0 0 5px; color: var(--navy); font-size: 17px; }
.dialog-body p { margin: 0; }
.muted { margin-top: 4px !important; color: var(--muted); font-size: 14px; }
.dialog-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-grid section { margin: 0 !important; padding: 15px; background: #f2f7f9; border-radius: 11px; }
.contact-panel { margin-top: 22px !important; display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; padding: 18px; background: var(--blue-soft); border-radius: 13px; }
.contact-panel .dialog-kicker { color: var(--blue); }
.contact-panel > div > p:last-child { color: var(--muted); font-size: 13px; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: center; }
.contact-actions button, .contact-actions a { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; color: var(--navy); background: white; border: 1px solid #9dbdd1; border-radius: 8px; font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; }
.contact-actions button:hover, .contact-actions a:hover { color: white; background: var(--blue); border-color: var(--blue); }
.correction-line { margin-top: 20px !important; padding-top: 17px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.correction-line a { color: var(--blue); font-weight: 750; }
.toast { position: fixed; z-index: 40; right: 20px; bottom: 20px; max-width: 380px; padding: 13px 16px; color: white; background: var(--navy-deep); border-left: 4px solid var(--amber); border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; font-weight: 700; }

@media (max-width: 820px) {
  nav { gap: 14px; }
  .search-box { grid-template-columns: 1fr 1fr; }
  .search-button { grid-column: 1 / -1; }
  .results-grid { grid-template-columns: 1fr; }
  .how-section { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .header-inner, .stage-inner, .demo-banner, .directory-shell, .how-section, footer { width: min(100% - 20px, 1180px); }
  .brand small, nav > a:first-child { display: none; }
  .site-header nav a[href="./presupuesto.html"] { display: none; }
  .site-header nav { gap: 8px; }
  nav .professional-link { padding: 8px 10px; font-size: 12px; }
  .stage-inner { padding-top: 30px; }
  h1 { font-size: 38px; }
  .stage-copy > p:last-child { font-size: 16px; }
  .search-box { grid-template-columns: 1fr; padding: 10px; }
  .search-field { border-right: 0; border-bottom: 1px solid var(--line); }
  .search-button { grid-column: auto; }
  .demo-banner { align-items: flex-start; flex-direction: column; gap: 8px; }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
  .result-actions { width: 100%; align-items: flex-start; flex-wrap: wrap; }
  .professional-card { padding: 19px; }
  .card-top { flex-direction: column-reverse; gap: 8px; }
  .card-description { min-height: 0; }
  .how-section { padding: 24px 18px; }
  footer, .footer-links { align-items: flex-start; flex-direction: column; justify-content: start; }
  .dialog-head, .dialog-body { padding-left: 18px; padding-right: 18px; }
  .dialog-grid, .contact-panel { grid-template-columns: 1fr; }
  .reviews-heading { align-items: stretch; flex-direction: column; }
  .reviews-heading .secondary-button { width: 100%; }
  .review-rating-grid, .review-score-grid { grid-template-columns: 1fr; }
  .review-field-meta { flex-direction: column; gap: 2px; }
  .review-form-actions { align-items: stretch; flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
