/* Catálogo B2B: diseño responsive y fotografía sin recortes. */
:root{color-scheme:light;--ink:#182333;--muted:#637082;--border:#e6ebf1;--brand:#1a629a;--bg:#f4f6f9}
*{box-sizing:border-box}
html{min-width:0}
body{margin:0;min-width:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
header{background:#152f4c;color:#fff;padding:18px max(24px,calc((100vw - 1100px)/2));display:flex;align-items:center;justify-content:space-between;gap:16px}
header strong{font-size:18px}
nav{display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px}
nav a{color:#fff}
nav form{margin:0}
main{max-width:1140px;margin:32px auto;padding:0 20px;min-width:0}
h1{font-size:clamp(24px,3vw,30px);line-height:1.2;margin:0 0 22px}
.panel{max-width:590px;background:#fff;padding:28px;border-radius:14px;box-shadow:0 4px 18px #0001}
.panel form{display:grid;gap:16px}
label{display:grid;gap:7px}
input{width:100%;min-width:0;padding:12px;border:1px solid #bdc9d5;border-radius:7px;font:inherit}
button{border:0;border-radius:7px;padding:12px 20px;background:var(--brand);color:#fff;cursor:pointer;font:inherit}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #8cbde7;outline-offset:3px}
.search{display:flex;gap:10px;max-width:680px}
.search input{flex:1}
.notice{padding:14px;background:#fff3cf;border-radius:8px;overflow-wrap:anywhere}
small{color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:20px;margin-top:24px;align-items:stretch}
.product-card{display:flex;flex-direction:column;min-width:0;overflow:hidden;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 3px 14px #102c4810;transition:box-shadow .2s ease,transform .2s ease}
.product-card:hover{box-shadow:0 8px 26px #102c4820;transform:translateY(-2px)}
.product-photo{position:relative;display:flex;align-items:center;justify-content:center;isolation:isolate;width:100%;aspect-ratio:4/3;min-width:0;overflow:hidden;background:#fff;border-bottom:1px solid var(--border);padding:16px}
.product-image{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;position:relative;z-index:1;background:#fff}
.product-image[hidden]{display:none!important}
.photo-fallback{display:none;position:absolute;inset:0;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:#6a7788;font-size:13px;background:#f8fafc}
.photo-fallback img{width:84px;height:84px;max-width:45%;object-fit:contain;opacity:.9}
.product-photo.is-unavailable .photo-fallback{display:flex}
.product-photo.is-unavailable .product-image,.product-photo.is-unavailable .photo-expand{display:none!important}
.photo-expand{position:absolute;z-index:2;right:10px;bottom:10px;width:38px;height:38px;display:grid;place-items:center;border:1px solid #d9e2eb;border-radius:50%;background:#fff;color:#25364b;box-shadow:0 2px 8px #0002;padding:0;font-size:25px;line-height:1}
.photo-expand[hidden]{display:none!important}
.photo-expand:hover{background:#f1f7fc}
.product-body{padding:18px 20px 20px;display:flex;flex-direction:column;flex:1;min-width:0}
.product-meta{font-size:12px;letter-spacing:.01em;overflow-wrap:anywhere}
.product-body h2{font-size:clamp(17px,1.5vw,19px);line-height:1.3;margin:10px 0;overflow-wrap:anywhere}
.product-body p{font-size:14px;line-height:1.55;color:#4b5a6b;flex:1;margin:0 0 18px;overflow-wrap:anywhere}
.product-price{margin-top:auto;padding-top:12px;border-top:1px solid #eef1f5}
.price{font-weight:800;font-size:clamp(23px,2vw,27px);color:#176346;line-height:1.2;margin-bottom:4px;font-variant-numeric:tabular-nums}
.image-dialog{border:0;border-radius:16px;padding:0;max-width:min(96vw,1040px);width:min(96vw,1040px);max-height:95dvh;overflow:auto;box-shadow:0 20px 70px #0006;background:#fff}
.image-dialog::backdrop{background:rgba(10,20,35,.78)}
.image-dialog-inner{position:relative;display:flex;flex-direction:column;align-items:center;padding:48px 24px 22px;min-height:220px}
.image-dialog-image{display:block;width:100%;max-width:920px;height:auto;max-height:calc(90dvh - 150px);object-fit:contain;object-position:center}
.image-dialog-image[hidden]{display:none!important}
.image-dialog-caption{margin:14px 0 0;text-align:center;font-weight:600;overflow-wrap:anywhere}
.image-dialog-close{position:absolute;top:8px;right:10px;width:36px;height:36px;padding:0;border-radius:50%;font-size:27px;line-height:1;background:#f0f3f7;color:#1a2938}
.image-dialog-close:hover{background:#e2e8f0}
@media(max-width:720px){header{padding:16px 20px;flex-direction:column;align-items:flex-start}nav{width:100%}main{margin:24px auto;padding:0 16px}.grid{gap:16px}.panel{padding:22px}}
@media(max-width:540px){.search{flex-direction:column}.search button{width:100%}.grid{grid-template-columns:1fr;gap:16px}.product-photo{aspect-ratio:4/3;padding:18px}.product-body{padding:18px}.image-dialog-inner{padding:48px 12px 14px}.image-dialog-image{max-height:calc(90dvh - 125px)}}
@media(max-width:360px){main{padding:0 12px}.product-photo{padding:12px}.product-body{padding:15px}header{padding:14px}}
@media(prefers-reduced-motion:reduce){.product-card{transition:none}.product-card:hover{transform:none}}

/* V3: navegación por categorías con imágenes y filtro responsive */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.category-section{margin:30px 0 36px}
.products-section{margin-top:28px}
.section-heading{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:0 0 16px;flex-wrap:wrap}
.section-heading h2{font-size:clamp(20px,2.5vw,24px);line-height:1.25;margin:0}
.section-heading span{font-size:13px;color:var(--muted)}
.category-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),1fr));gap:16px}
.category-card{display:flex;flex-direction:column;min-width:0;text-decoration:none;color:var(--ink);background:#fff;border:1px solid var(--border);border-radius:14px;overflow:hidden;box-shadow:0 3px 12px #102c4810;transition:box-shadow .2s,transform .2s,border-color .2s}
.category-card:hover{border-color:#afcfe4;box-shadow:0 8px 24px #102c481d;transform:translateY(-2px)}
.category-card:focus-visible{outline:3px solid #8cbde7;outline-offset:3px}
.category-visual{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;overflow:hidden;background:#fff;padding:15px;border-bottom:1px solid var(--border)}
.category-image{display:block;width:100%;height:100%;object-fit:contain;object-position:center;min-width:0;min-height:0}
.category-image[hidden]{display:none!important}
.category-fallback{display:none;position:absolute;inset:0;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:15px;text-align:center;background:#f8fafc;color:var(--muted);font-size:12px}
.category-fallback img{width:70px;height:70px;max-width:45%;object-fit:contain}
.category-visual.is-unavailable .category-fallback{display:flex}
.category-visual.is-unavailable .category-image{display:none!important}
.category-info{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:3px 10px;align-items:center;padding:15px 16px;min-height:83px}
.category-info strong{grid-column:1;grid-row:1;font-size:15px;line-height:1.35;overflow-wrap:anywhere}
.category-info small{grid-column:1;grid-row:2;font-size:12px}
.category-arrow{grid-column:2;grid-row:1/3;font-size:26px;color:var(--brand)}
.breadcrumbs{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin:22px 0 10px;color:var(--muted);font-size:14px}
.breadcrumbs a{color:var(--brand);text-decoration:none}
.breadcrumbs a[aria-current="page"]{color:var(--ink);font-weight:700}
.breadcrumbs a:hover{text-decoration:underline}
.pagination{display:flex;justify-content:center;align-items:center;gap:18px;margin:28px 0 40px;flex-wrap:wrap}
.pagination a{display:inline-block;padding:9px 15px;border:1px solid var(--border);border-radius:8px;text-decoration:none;color:var(--brand);background:#fff}
.pagination span{color:var(--muted);font-size:14px}
.empty-results{padding:24px;background:#fff;border:1px solid var(--border);border-radius:10px}
.notice-success{background:#e4f6eb;color:#1b5b38}
.template-links{display:flex;flex-wrap:wrap;gap:10px 18px;margin:18px 0}
.template-links a{display:inline-flex;padding:9px 13px;border:1px solid #cbdceb;border-radius:8px;background:#f3f8fc;color:#165789;text-decoration:none;font-weight:600}
.import-panel{max-width:720px}
.import-panel p{line-height:1.65}
.import-panel code{font-size:.9em;background:#eef2f6;padding:2px 5px;border-radius:4px;overflow-wrap:anywhere}
.products-section .grid{margin-top:12px}
.product-body h3{font-size:clamp(17px,1.5vw,19px);line-height:1.3;margin:10px 0;overflow-wrap:anywhere}
@media(max-width:720px){.category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.category-info{padding:12px;min-height:80px}.category-visual{padding:12px}}
@media(max-width:420px){.category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.category-visual{aspect-ratio:1/1;padding:8px}.category-info{padding:10px;min-height:82px}.category-info strong{font-size:13px}.category-info small{font-size:11px}.category-arrow{font-size:20px}.section-heading{align-items:flex-start}}
@media(prefers-reduced-motion:reduce){.category-card{transition:none}.category-card:hover{transform:none}}

/* V4: precio de oferta separado del PVP, sin IVA */
.price-original{font-size:13px;color:#637082;margin-bottom:5px}.price-original s{text-decoration-color:#a9b1bc;text-decoration-thickness:1px}.product-price .price{color:#116644}.product-price small{display:block;font-weight:600}

/* V5: dos importadores independientes, instrucciones y versión visible */
.import-version{display:inline-block;vertical-align:middle;margin-left:8px;padding:3px 9px;border-radius:20px;background:#e9f4fc;color:#175987;font-size:12px;font-weight:700}
.import-panel{max-width:940px}
.import-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:22px 0}
.import-option{display:flex;flex-direction:column;min-width:0;padding:20px;border:1px solid #dce7f1;border-radius:12px;background:#f8fbfe}
.import-option h2{font-size:18px;line-height:1.3;margin:0 0 8px}
.import-option p{font-size:14px;margin:6px 0 14px;overflow-wrap:anywhere}
.import-option form{margin-top:auto}
.import-option button{width:100%}
.import-option a{color:#165789;font-weight:700}
.import-help{border-top:1px solid #e1e7ee;padding-top:14px}
@media(max-width:690px){.import-options{grid-template-columns:1fr}.import-option{padding:16px}.import-version{margin:7px 0 0}}

/* V7: portada de categorías, subcategorías y listado exclusivo en categoría final. */
.catalog-intro{padding:clamp(18px,3.5vw,32px);background:linear-gradient(115deg,#ffffff,#edf5fa);border:1px solid #e2eaf2;border-radius:16px;margin-bottom:20px}
.catalog-intro h1{margin:4px 0 10px}
.catalog-eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;color:#206492;margin:0 0 6px}
.catalog-intro .public-info{margin:0;max-width:720px;color:#57697b}
.catalog-intro+.breadcrumbs{margin:17px 0 4px}
.category-section{margin-top:24px}
.category-card{border-radius:16px}
.category-card:hover{border-color:#83b6d6}
.direct-products-card .direct-products-visual{min-height:160px;aspect-ratio:4/3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center;background:#f0f6fb;color:#275978;border-bottom:1px solid var(--border);padding:16px;font-size:13px;font-weight:700}
.direct-products-symbol{font-size:60px;font-weight:300;line-height:1}
.products-section{margin-top:22px}
.products-section .search{margin:18px 0 22px}
.search-clear{font-size:13px;margin:0 0 10px}
.search-clear a{color:var(--brand)}
@media(max-width:540px){.catalog-intro{padding:19px}.category-section{margin-top:20px}.direct-products-card .direct-products-visual{min-height:110px}}
