/* Directorio "Empresas certificadas", perfil público y editor de perfil */

/* Buscador */
.hbd-search { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.hbd-search label { display: block; }
.hbd-search__q { flex: 1 1 320px; }
.hbd-search input, .hbd-search select { width: 100%; min-height: 50px; padding: 12px 16px; border: 1.5px solid var(--line, rgba(14,42,34,.16)); border-radius: 999px; background: var(--white, #fff); font: inherit; color: var(--ink, #0e2a22); }
.hbd-search select { padding-right: 36px; min-width: 210px; }
.hbd-search input:focus, .hbd-search select:focus { outline: 3px solid var(--green, #7bcf3f); outline-offset: 1px; border-color: var(--ink, #0e2a22); }
.hbd-count { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; opacity: .7; margin: 0 0 22px; }
.hbd-empty, .hbd-none { padding: 28px; border: 1.5px dashed var(--line, rgba(14,42,34,.16)); border-radius: var(--r, 14px); text-align: center; }

/* Tarjetas */
.hbd-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.hbd-card[hidden] { display: none; }
.hbd-card a { display: flex; flex-direction: column; height: 100%; background: var(--white, #fff); border: 1px solid var(--line, rgba(14,42,34,.16)); border-radius: var(--r, 14px); overflow: hidden; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.hbd-card a:hover, .hbd-card a:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(14,42,34,.45); }
.hbd-card__banner { display: block; aspect-ratio: 16 / 6; background: var(--ink, #0e2a22) center / cover no-repeat; background-image: linear-gradient(135deg, var(--ink, #0e2a22), #1d4a3b); }
.hbd-card__logo { display: grid; place-items: center; width: 68px; height: 68px; margin: -34px 0 0 18px; border-radius: 16px; background: var(--white, #fff); border: 3px solid var(--white, #fff); box-shadow: 0 4px 14px -6px rgba(14,42,34,.35); overflow: hidden; position: relative; }
.hbd-card__logo img { width: 100%; height: 100%; object-fit: contain; }
.hbd-card__logo span { font-weight: 800; font-size: 1.6rem; color: var(--ink, #0e2a22); }
.hbd-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px 20px; flex: 1; }
.hbd-card__body strong { font-size: 1.12rem; line-height: 1.25; }
.hbd-card__meta { font-size: .92rem; opacity: .7; }
.hbd-card__kg { margin-top: auto; padding-top: 12px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .85rem; font-weight: 600; color: var(--ink, #0e2a22); }
.hbd-card__kg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green, #7bcf3f); margin-right: 8px; vertical-align: 1px; }

/* Perfil público */
.hbpp-banner { height: clamp(160px, 26vw, 320px); background: var(--ink, #0e2a22) center / cover no-repeat; background-image: linear-gradient(135deg, var(--ink, #0e2a22), #1d4a3b); }
.hbpp-head { display: flex; align-items: flex-end; gap: clamp(16px, 3vw, 28px); padding-top: 16px; margin-bottom: clamp(24px, 4vw, 40px); }
.hbpp-logo { flex: 0 0 auto; display: grid; place-items: center; width: clamp(112px, 14vw, 160px); aspect-ratio: 1; border-radius: 22px; background: var(--white, #fff); border: 4px solid var(--white, #fff); box-shadow: 0 10px 30px -14px rgba(14,42,34,.5); overflow: hidden; position: relative; margin-top: calc(clamp(72px, 10vw, 100px) * -1); }
.hbpp-logo img { width: 100%; height: 100%; object-fit: contain; }
.hbpp-logo span { font-weight: 800; font-size: 3rem; }
.hbpp-id { padding-bottom: 4px; min-width: 0; }
.hbpp-id h1 { margin: 0 0 4px; font-size: clamp(1.8rem, 4.2vw, 3rem); line-height: 1.05; overflow-wrap: anywhere; }
.hbpp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(20px, 3vw, 40px); align-items: start; padding-bottom: clamp(48px, 7vw, 96px); }
.hbpp-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hbpp-desc { font-size: 1.15rem; line-height: 1.6; margin: 0; white-space: pre-line; }
.hbpp-impact { display: flex; flex-direction: column; gap: 16px; }
.hbpp-impact h2 { margin: 12px 0 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.hbpp-impact h3 { margin: 0 0 12px; font-size: 1.05rem; }
.hbpp-contact { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }
.hbpp-contact h2 { margin: 0 0 14px; font-size: 1.25rem; }
.hbpp-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbpp-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line, rgba(14,42,34,.16)); color: var(--ink, #0e2a22); font-weight: 600; text-decoration: none; }
.hbpp-link::after { content: "→"; opacity: .5; }
.hbpp-link:hover, .hbpp-link:focus-visible { border-color: var(--ink, #0e2a22); background: var(--paper, #eef2ea); }
.hbpp-link--wa { background: #25d366; border-color: #25d366; color: #0b2a17; }
.hbpp-link--wa:hover, .hbpp-link--wa:focus-visible { background: #1fbe5b; border-color: #1fbe5b; }
.hbpp-addr { margin: 14px 0 0; font-size: .95rem; opacity: .8; }
.hbpp-back { font-weight: 600; color: var(--ink, #0e2a22); }

@media (max-width: 900px) {
	.hbpp-grid { grid-template-columns: 1fr; }
	.hbpp-contact { position: static; order: -1; }
}
@media (max-width: 560px) {
	.hbpp-head { flex-direction: column; align-items: flex-start; gap: 12px; }
	.hbd-search select { min-width: 0; }
	.hbd-search > label, .hbd-search > button { flex: 1 1 100%; }
}

/* Editor de perfil en el panel privado */
.hbp-edit { margin-top: 28px; }
.hbp-edit__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.hbp-edit__head h2 { margin: 0 0 6px; }
.hbp-edit__images { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
.hbp-upload { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1.5px dashed var(--line, rgba(14,42,34,.16)); border-radius: 12px; font-weight: 600; }
.hbp-upload input[type=file] { font: inherit; font-weight: 400; font-size: .9rem; max-width: 100%; }
.hbp-upload small { font-weight: 400; opacity: .7; }
.hbp-upload__logo { width: 96px; height: 96px; object-fit: contain; border-radius: 12px; background: var(--paper, #eef2ea); }
.hbp-upload__banner { width: 100%; aspect-ratio: 16 / 5; object-fit: cover; border-radius: 10px; }
.hbp-edit__note { margin: 16px 0; font-size: .92rem; }
.hbp-ok { padding: 12px 16px; border-radius: 10px; background: var(--green, #7bcf3f); color: var(--ink, #0e2a22); font-weight: 600; }
.hbp-alert { padding: 12px 16px; border-radius: 10px; background: #fde2df; color: #7a1d12; font-weight: 600; }
@media (max-width: 640px) { .hbp-edit__images { grid-template-columns: 1fr; } }
