/* PCForge functional pages: presentation layer only, using the established theme tokens. */
:where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) {
    --tool-surface: var(--surface, #fdfdfd);
    --tool-page: var(--background, #f3f3f3);
    --tool-text: var(--foreground, #3b3b3b);
    --tool-muted: var(--muted, #737373);
    --tool-line: var(--line, #e1e1e1);
    --tool-accent: var(--blue, #858585);
    --tool-radius: 18px;
    color: var(--tool-text);
}

:where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) :where(button,a,select,input,textarea,[tabindex]):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus-ring, #9d9d9d) 72%, transparent);
    outline-offset: 3px;
}

/* Catalog: keep the controls compact and give every product the same reading order. */
.components-hub-page .components-hero { min-height: 340px; }
.components-hub-page .component-categories { padding-top: clamp(34px, 5vw, 68px); }
.components-hub-page .hub-category-grid { gap: 14px; }
.components-hub-page .hub-category-card {
    display: grid; grid-template-rows: minmax(150px, 1fr) auto; min-width: 0;
    overflow: hidden; border-color: var(--tool-line); border-radius: var(--tool-radius);
    background: var(--tool-surface); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.components-hub-page .hub-category-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tool-accent) 48%, var(--tool-line)); box-shadow: 0 12px 26px rgba(38, 38, 38, .08); }
.components-hub-page .hub-category-media { min-height: 150px; background: color-mix(in srgb, var(--tool-page) 58%, var(--tool-surface)); }
.components-hub-page .hub-category-media img { width: 100%; height: 100%; object-fit: contain; padding: 16px; mix-blend-mode: normal; filter: none; }
.components-hub-page .hub-category-copy { display: grid; align-content: start; gap: 8px; padding: 17px 18px 19px; }
.components-hub-page .hub-category-copy h3 { margin: 0; line-height: 1.2; }
.components-hub-page .hub-category-copy p { margin: 0; color: var(--tool-muted); line-height: 1.5; }
.components-hub-page .hub-category-copy strong { margin-top: 6px; }
.components-hub-page .component-choice-grid { gap: 12px; }

/* Category browse: filter rail and product grid behave like one compact catalog. */
.category-page .category-main { width: min(1460px, calc(100% - 48px)); }
.category-page .category-hero { border-radius: 20px; overflow: hidden; }
.category-page .category-catalog-layout { align-items: start; gap: 18px; }
.category-page .category-filters {
    position: sticky; top: 86px; display: grid; gap: 9px; padding: 15px;
    border: 1px solid var(--tool-line); border-radius: 14px; background: var(--tool-surface);
}
.category-page .category-filters label { margin-top: 4px; color: var(--tool-muted); font-size: .78rem; font-weight: 650; }
.category-page .category-filters select,
.prototype-v2 :where(select,input:not([type="checkbox"]),textarea),
.product-detail-page :where(select,input,textarea) {
    min-height: 42px; border: 1px solid var(--tool-line); border-radius: 10px;
    background: var(--tool-surface); color: var(--tool-text); box-shadow: none;
}
.category-page .category-product-grid { gap: 14px; }
.category-page .catalog-product-card {
    min-width: 0; overflow: hidden; border: 1px solid var(--tool-line); border-radius: 15px;
    background: var(--tool-surface); box-shadow: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.category-page .catalog-product-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tool-accent) 50%, var(--tool-line)); box-shadow: 0 10px 24px rgba(38, 38, 38, .08); }
.category-page .catalog-product-media { aspect-ratio: 1 / .82; background: color-mix(in srgb, var(--tool-page) 58%, var(--tool-surface)); }
.category-page .catalog-product-media img { object-fit: contain; filter: none !important; mix-blend-mode: normal !important; }
.category-page .catalog-product-card :where(h3,.catalog-product-name) { line-height: 1.32; }

/* Product detail: visual first, then identity, price and actions; specs stay as a table. */
.product-detail-page .product-detail-shell { max-width: 1380px; }
.product-detail-page .product-hero { gap: clamp(24px, 4vw, 56px); }
.product-detail-page .product-main-image,
.product-detail-page .product-thumbs button { border-color: var(--tool-line); background: var(--tool-surface); }
.product-detail-page .product-main-image img,
.product-detail-page .product-thumbs img,
.product-detail-page .product-gallery img { filter: none !important; mix-blend-mode: normal !important; }
.product-detail-page .product-info { align-content: start; }
.product-detail-page .product-summary-detail { max-width: 58ch; color: var(--tool-muted); line-height: 1.65; }
.product-detail-page .product-price-block { border-block: 1px solid var(--tool-line); background: transparent; }
.product-detail-page .product-actions { gap: 9px; }
.product-detail-page .product-accordion-item { border-color: var(--tool-line); background: transparent; }
.product-detail-page .product-quick-specs > * { border-color: var(--tool-line); }

/* Tool canvases share tokens but each has a distinct working rhythm. */
.prototype-v2 .container { max-width: 1480px; }
.prototype-v2 .proto-tools { margin-top: 24px; }
.prototype-v2 .proto-tool { border: 1px solid var(--tool-line); border-radius: var(--tool-radius); background: var(--tool-surface); box-shadow: 0 8px 24px rgba(33, 33, 33, .035); }
.prototype-v2 .proto-tool-header { padding: 22px clamp(18px, 3vw, 32px); border-bottom: 1px solid var(--tool-line); }
.prototype-v2 .proto-tool-body { padding: clamp(18px, 3vw, 32px); }
.prototype-v2 .proto-v2-hero { grid-template-columns: minmax(0, 1fr) minmax(290px, .75fr); gap: clamp(24px, 4vw, 60px); padding: clamp(24px, 4vw, 54px); border-color: var(--tool-line); border-radius: 20px; }
.prototype-v2 .proto-v2-copy { max-width: 62ch; }
.prototype-v2 .proto-v2-copy h1 { max-width: 14ch; letter-spacing: -.035em; }
.prototype-v2 .proto-v2-copy > p:not(.eyebrow):not(.proto-v2-status) { color: var(--tool-muted); line-height: 1.65; }
.prototype-v2 .proto-v2-visual { display: grid; overflow: hidden; min-height: 260px; place-items: center; border: 1px solid var(--tool-line); border-radius: 15px; background: color-mix(in srgb, var(--tool-page) 55%, var(--tool-surface)); }
.prototype-v2 .proto-v2-visual > img { width: 100%; height: 100%; object-fit: contain; filter: none !important; mix-blend-mode: normal !important; }
.functional-sheet-page .proto-v2-visual--photo { position: relative; display: block; width: 100%; min-height: 0; margin: 0; aspect-ratio: 3 / 2; border: 0; border-radius: 0 20px 20px 0; background: #272727; isolation: isolate; }
.functional-sheet-page .proto-v2-visual--photo::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(100deg, rgba(33, 33, 33, .3), rgba(33, 33, 33, .04) 55%, rgba(33, 33, 33, .2)), linear-gradient(0deg, rgba(33, 33, 33, .5), transparent 28%); content: ""; pointer-events: none; }
.functional-sheet-page .proto-v2-visual--photo > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: brightness(.76) saturate(.68) !important; }
.functional-compare-page .proto-v2-visual--photo { position: relative; display: block; width: 100%; min-height: 0; margin: 0; aspect-ratio: 3 / 2; border: 0; border-radius: 0 20px 20px 0; background: #272727; isolation: isolate; }
.functional-compare-page .proto-v2-visual--photo::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(100deg, rgba(33, 33, 33, .38), rgba(33, 33, 33, .08) 55%, rgba(33, 33, 33, .2)), linear-gradient(0deg, rgba(33, 33, 33, .45), transparent 28%); content: ""; pointer-events: none; }
.functional-compare-page .proto-v2-visual--photo > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: brightness(.68) saturate(.58) !important; }
.functional-saved-page .proto-v2-visual--saved-photo { position: relative; display: block; min-width: 0; min-height: 260px; margin: 0; align-self: stretch; overflow: hidden; border: 0; border-radius: 15px; background: #272727; isolation: isolate; }
.functional-saved-page .proto-v2-visual--saved-photo::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(100deg, rgba(33, 33, 33, .42), rgba(33, 33, 33, .08) 58%, rgba(33, 33, 33, .24)), linear-gradient(0deg, rgba(33, 33, 33, .36), transparent 34%); content: ""; pointer-events: none; }
.functional-saved-page .proto-v2-visual--saved-photo > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; padding: 0; filter: brightness(.78) saturate(.72) !important; }
.proto-v2-photo-credit { position: absolute; z-index: 2; right: 14px; bottom: 12px; padding: 6px 9px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(33, 33, 33, .5); color: rgba(255, 255, 255, .82); font-size: 11px; line-height: 1; text-decoration: none; backdrop-filter: blur(8px); }
.proto-v2-photo-credit:hover { background: rgba(33, 33, 33, .72); color: #fff; }
.functional-sheet-page {
    --ficha-details-accent: var(--accent, var(--tool-accent));
    --ficha-details-hover: var(--accent-hover, #707070);
    --ficha-details-ink: #fff;
}
.functional-sheet-page .tech-v2 { align-items: start; }
.functional-sheet-page .tech-v2 > * { min-width: 0; align-self: start; }
.functional-sheet-page .component-preview {
    height: 420px;
    min-height: 0;
    max-height: 420px;
    align-self: start;
    flex: none;
}
.functional-sheet-page .ficha-product-image {
    width: min(84%, 460px);
    height: 340px;
    max-width: 100%;
    max-height: calc(100% - 48px);
    object-fit: contain;
}
.functional-sheet-page .detail-v2 {
    display: flex;
    max-height: 620px;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
}
.functional-sheet-page .detail-v2.is-ficha-selected { box-sizing: border-box; height: 420px; min-height: 0; max-height: 420px; flex: none; }
.functional-sheet-page .detail-v2 :where(h3, .screen-muted, .spec-list) { flex-shrink: 0; overflow-wrap: anywhere; }
.functional-sheet-page .spec-list { border-color: var(--tool-line); }
.functional-sheet-page .spec-list > div { min-width: 0; }
.functional-sheet-page .spec-list > div { border-color: var(--tool-line); }
.functional-sheet-page .spec-list span { color: var(--tool-muted); }
.functional-sheet-page .spec-list b { min-width: 0; color: var(--tool-text); overflow-wrap: anywhere; }
.functional-sheet-page .ficha-expand-toggle {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    width: 100%;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 16px;
    border: 1px solid #858585;
    border-radius: 13px;
    background: #858585;
    color: var(--ficha-details-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.functional-sheet-page .ficha-expand-toggle::after { flex: 0 0 auto; content: "⌄"; font-size: 20px; line-height: 1; transition: transform .18s ease; }
.functional-sheet-page .ficha-expand-toggle:hover { border-color: #707070; background: #707070; box-shadow: 0 5px 14px rgb(118 85 181 / 24%); transform: translateY(-1px); }
.functional-sheet-page .ficha-expand-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--ficha-details-accent) 60%, transparent); outline-offset: 3px; }
.functional-sheet-page .ficha-expand-toggle.is-expanded::after { transform: rotate(180deg); }
.functional-sheet-page .ficha-expand-toggle[hidden], .ficha-details-panel[hidden] { display: none !important; }
.functional-sheet-page .ficha-details-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    margin-top: 10px;
    border-top: 1px solid var(--tool-line);
    animation: ficha-details-enter .18s ease-out;
}
.functional-sheet-page .ficha-details-scroll {
    box-sizing: border-box;
    min-height: 0;
    height: 100%;
    max-height: none;
    flex: 1 1 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: var(--ficha-details-accent) var(--tool-page);
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    color: var(--tool-text);
}
.functional-sheet-page .ficha-details-scroll::-webkit-scrollbar { width: 8px; }
.functional-sheet-page .ficha-details-scroll::-webkit-scrollbar-track { border-radius: 8px; background: var(--tool-page); }
.functional-sheet-page .ficha-details-scroll::-webkit-scrollbar-thumb { border: 2px solid var(--tool-page); border-radius: 8px; background: var(--ficha-details-accent); }
.functional-sheet-page .ficha-details-scroll .ficha-data-row { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 13px 0; }
.functional-sheet-page #ficha-acciones { flex: 0 0 auto; margin: 0; padding: 12px 0 4px; border-top: 1px solid var(--tool-line); }
.functional-sheet-page #ficha-acciones[hidden] { display: none !important; }
@keyframes ficha-details-enter { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
html[data-theme="dark"] .functional-sheet-page {
    --ficha-details-accent: #aaaaaa;
    --ficha-details-hover: #8f8f8f;
    --ficha-details-ink: #fff;
}
html[data-theme="dark"] .functional-sheet-page .ficha-expand-toggle { border-color: #aaaaaa; background: #aaaaaa; color: #fff; }
html[data-theme="dark"] .functional-sheet-page .ficha-expand-toggle:hover { border-color: #8f8f8f; background: #8f8f8f; }

/* Non-photographic previews communicate each tool's real task without fake product data. */
.functional-tool-visual { width: 100%; height: 100%; min-height: 260px; display: grid; align-content: center; gap: 12px; padding: clamp(18px, 3vw, 30px); }
.functional-preview-window { overflow: hidden; border: 1px solid var(--tool-line); border-radius: 12px; background: var(--tool-surface); box-shadow: 0 12px 28px rgba(33, 33, 33,.08); }
.functional-preview-top { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; border-bottom: 1px solid var(--tool-line); color: var(--tool-muted); font-size: 10px; }
.functional-preview-top i { width: 6px; height: 6px; border-radius: 50%; background: var(--tool-line); }
.functional-preview-content { display: grid; gap: 9px; padding: 14px; }
.functional-preview-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 36px; padding: 7px 9px; border-bottom: 1px solid var(--tool-line); color: var(--tool-muted); font-size: 11px; }
.functional-preview-row strong { color: var(--tool-text); font-size: 11px; font-weight: 650; }
.functional-preview-chip { display: inline-flex; width: fit-content; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--tool-line); border-radius: 7px; background: var(--tool-surface); color: var(--tool-text); font-size: 10px; }
.functional-preview-chip::before { width: 6px; height: 6px; border-radius: 50%; background: var(--tool-accent); content: ""; }
.functional-tool-visual--smart .functional-preview-content { grid-template-columns: 1fr 1fr; }
.functional-tool-visual--smart .functional-preview-row { grid-column: 1 / -1; }
.functional-tool-visual--smart .functional-preview-progress { height: 5px; overflow: hidden; border-radius: 9px; background: var(--tool-line); }
.functional-tool-visual--smart .functional-preview-progress::after { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--tool-accent); content: ""; }
.functional-tool-visual--compare .functional-preview-content { grid-template-columns: 1fr 1fr; }
.functional-tool-visual--compare .functional-preview-row { grid-template-columns: 1fr; text-align: center; }
.functional-tool-visual--sheet { grid-template-columns: .8fr 1.2fr; align-items: center; }
.functional-tool-visual--sheet .functional-preview-product { display: grid; min-height: 150px; place-items: center; border: 1px solid var(--tool-line); border-radius: 11px; background: var(--tool-surface); color: var(--tool-muted); font-size: 11px; }
.functional-tool-visual--sheet .functional-preview-product::before { width: 68px; height: 68px; border: 2px solid var(--tool-accent); border-radius: 12px; content: ""; opacity: .65; }
.functional-tool-visual--saved .functional-preview-content { grid-template-columns: 1fr 1fr; }
.functional-tool-visual--saved .functional-preview-row { grid-template-columns: 1fr; align-content: center; min-height: 58px; border: 1px solid var(--tool-line); border-radius: 8px; }

.prototype-v2 .builder-page-heading { align-items: end; gap: 24px; padding-block: clamp(24px, 4vw, 46px); }
.prototype-v2 .builder-page-heading h1 { letter-spacing: -.035em; }
.prototype-v2 .builder-v2 { gap: 18px; }
.prototype-v2 .builder-select-column,
.prototype-v2 .build-preview-panel { border-color: var(--tool-line); border-radius: 15px; background: var(--tool-surface); box-shadow: none; }
.prototype-v2 .builder-select-heading { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--tool-line); background: var(--tool-surface); }
.prototype-v2 .builder-option,
.prototype-v2 .build-metric { border-color: var(--tool-line); }
.prototype-v2 .build-preview-panel { position: sticky; top: 82px; align-self: start; }
.prototype-v2 .build-preview-top { border-bottom: 1px solid var(--tool-line); }
.prototype-v2 .build-preview-3d,
.prototype-v2 .build-preview-3d canvas { max-width: 100%; }

.prototype-v2 .compare-v2-table-wrap { border: 1px solid var(--tool-line); border-radius: 12px; }
.prototype-v2 .comparison-table { border-color: var(--tool-line); }
.prototype-v2 .comparison-table :where(th,td) { border-color: var(--tool-line); }
.prototype-v2 .compare-v2-products { position: sticky; top: 70px; z-index: 3; background: var(--tool-surface); }
.prototype-v2 .compare-differences-toggle { min-height: 40px; padding: 8px 11px; border: 1px solid var(--tool-line); border-radius: 9px; background: var(--tool-surface); }
.functional-compare-page .compare-v2-product-image {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    height: clamp(230px, 24vw, 300px);
    padding: clamp(18px, 3vw, 30px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tool-line) 78%, transparent);
    border-radius: 14px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--tool-page) 70%, white), var(--tool-surface));
}
.functional-compare-page .compare-v2-product-image img {
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0;
    object-fit: contain !important;
    object-position: center !important;
}
@media (max-width: 720px) {
    .functional-compare-page .compare-v2-product-image { height: 220px; padding: 18px; }
}
@media (max-width: 430px) {
    .functional-compare-page .compare-v2-product-image { height: 190px; padding: 14px; }
}

.prototype-v2 .smart-v2-top { border-bottom: 1px solid var(--tool-line); }
.prototype-v2 .smart-v2-workspace { align-items: start; }
.prototype-v2 .smart-config { border-color: var(--tool-line); border-radius: 13px; background: var(--tool-surface); }
.prototype-v2 .smart-step { padding-block: 20px; }
.prototype-v2 .smart-step + .smart-step { border-top: 1px solid var(--tool-line); }
.prototype-v2 .smart-choice-grid :where(button,label) { transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.prototype-v2 .smart-result { border-color: var(--tool-line); border-radius: 13px; }

.prototype-v2 .saved-build-compare-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--tool-line); border-radius: 11px; background: var(--tool-page); }
.prototype-v2 .saved-build-card { border-color: var(--tool-line); border-radius: 13px; background: var(--tool-surface); box-shadow: none; }
.prototype-v2 .saved-build-card :where(img, .build-main-image, .build-part-thumb img) { filter: none !important; mix-blend-mode: normal !important; }

/* Builds guardadas: jerarquía clara para identificar, comparar y abrir cada build. */
.functional-saved-page .saved-builds { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); max-width: 1200px; gap: 20px; }
.functional-saved-page .saved-build-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; gap: 20px 24px; overflow: visible; padding: 26px 28px; border: 1px solid color-mix(in srgb, #858585 22%, var(--tool-line)); border-radius: 18px; background: linear-gradient(145deg, color-mix(in srgb, #858585 5%, var(--tool-surface)), var(--tool-surface) 60%); color: var(--tool-text); box-shadow: 0 10px 26px rgb(48 35 69 / 7%); }
.functional-saved-page .saved-build-card::before { content: none; }
.functional-saved-page .saved-build-header { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; }
.functional-saved-page .saved-build-identification { min-width: 0; }
.functional-saved-page .saved-build-kicker { display: block; margin: 0 0 6px; color: #858585; font-size: 13px; font-weight: 800; letter-spacing: .1em; }
.functional-saved-page .saved-build-header h3 { margin: 0; color: var(--tool-text); font-size: clamp(30px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.08; }
.functional-saved-page .saved-build-name { margin: 6px 0 0; color: var(--tool-muted); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.functional-saved-page .saved-build-date { grid-column: 1 / -1; padding-top: 13px; border-top: 1px solid var(--tool-line); color: var(--tool-muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.functional-saved-page .saved-build-compare-toggle { position: relative; display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 9px 14px; border: 1px solid color-mix(in srgb, #858585 38%, var(--tool-line)); border-radius: 11px; background: color-mix(in srgb, #858585 8%, var(--tool-surface)); color: #727272; font-size: 14px; font-weight: 750; cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.functional-saved-page .saved-build-compare-toggle::before { width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; content: ""; }
.functional-saved-page .saved-build-compare-toggle > span { color: inherit; font-size: 14px; }
.functional-saved-page .saved-build-compare-check { position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.functional-saved-page .saved-build-compare-toggle:hover { border-color: #858585; background: color-mix(in srgb, #858585 14%, var(--tool-surface)); transform: translateY(-1px); }
.functional-saved-page .saved-build-compare-toggle:focus-within { outline: 3px solid color-mix(in srgb, #9d9d9d 62%, transparent); outline-offset: 3px; }
.functional-saved-page .saved-build-compare-toggle.is-selected { border-color: #858585; background: #858585; color: #fff; }
.functional-saved-page .saved-build-compare-toggle.is-selected::before { border-color: currentColor; background: currentColor; box-shadow: inset 0 0 0 2px #858585; }
.functional-saved-page .saved-build-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; color: var(--tool-text); font-size: 18px; line-height: 1.4; }
.functional-saved-page .saved-build-stat { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 14px; border: 1px solid var(--tool-line); border-radius: 11px; background: var(--tool-surface); color: var(--tool-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.functional-saved-page .saved-build-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 0; }
.functional-saved-page .saved-build-open { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border: 0; border-radius: 11px; background: #858585; color: #fff; font-size: 17px; font-weight: 800; text-decoration: none; box-shadow: none; }
.functional-saved-page .saved-build-open span { font-size: 20px; line-height: 1; transition: transform .2s ease; }
.functional-saved-page .saved-build-open:hover span { transform: translate(2px, -2px); }
.functional-saved-page .saved-build-more { position: relative; }
.functional-saved-page .saved-build-more summary { padding: 10px 2px; color: #727272; font-size: 15px; font-weight: 750; cursor: pointer; list-style: none; white-space: nowrap; }
.functional-saved-page .saved-build-more summary::-webkit-details-marker { display: none; }
.functional-saved-page .saved-build-more summary::after { margin-left: 6px; content: "⌄"; color: #858585; }
.functional-saved-page .saved-build-secondary-actions { position: absolute; z-index: 3; right: 0; bottom: calc(100% + 5px); display: grid; min-width: 170px; gap: 4px; padding: 8px; border: 1px solid var(--tool-line); border-radius: 12px; background: var(--tool-surface); box-shadow: 0 12px 28px rgb(32 24 47 / 16%); }
.functional-saved-page .saved-build-secondary-actions > * { width: 100%; justify-content: flex-start; text-align: left; }
html[data-theme="dark"] .functional-saved-page .saved-build-card { border-color: #666666; background: linear-gradient(145deg, #2a2a2a, #242424 65%); color: #f8f8f8; }
html[data-theme="dark"] .functional-saved-page .saved-build-header h3,
html[data-theme="dark"] .functional-saved-page .saved-build-meta,
html[data-theme="dark"] .functional-saved-page .saved-build-stat { color: #f8f8f8; }
html[data-theme="dark"] .functional-saved-page .saved-build-stat { border-color: #545454; background: #2f2f2f; }
html[data-theme="dark"] .functional-saved-page .saved-build-kicker,
html[data-theme="dark"] .functional-saved-page .saved-build-more summary { color: #c9c9c9; }
html[data-theme="dark"] .functional-saved-page .saved-build-compare-toggle { border-color: #7a7a7a; background: #383838; color: #e8e8e8; }
html[data-theme="dark"] .functional-saved-page .saved-build-compare-toggle.is-selected { background: #858585; color: #fff; }
html[data-theme="dark"] .functional-saved-page .saved-build-open { background: #989898; color: #fff; }
@media (max-width: 720px) {
    .functional-saved-page .saved-builds { grid-template-columns: minmax(0, 1fr); }
    .functional-saved-page .saved-build-card { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; }
    .functional-saved-page .saved-build-header h3 { font-size: 30px; }
    .functional-saved-page .saved-build-meta { font-size: 17px; }
    .functional-saved-page .saved-build-header { grid-template-columns: minmax(0, 1fr); }
    .functional-saved-page .saved-build-compare-toggle { justify-self: start; }
    .functional-saved-page .saved-build-actions { grid-template-columns: minmax(0, 1fr); }
    .functional-saved-page .saved-build-more summary { padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .functional-saved-page .saved-build-open span { transition: none; }
}

/* Theme-correct imagery: hardware photographs and renders keep their source colors. */
:where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) :where(.hub-category-media,.catalog-product-media,.comparison-image,.product-photo,.product-gallery,.proto-v2-visual,.saved-build-card) img:not(.logo-symbol) { filter: none; mix-blend-mode: normal; opacity: 1; }
html[data-theme="dark"] :where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) :where(.hub-category-media,.catalog-product-media,.product-main-image,.product-thumbs button,.component-preview,.proto-v2-visual,.smart-v2-showcase) {
    background: #272727;
}
html[data-theme="dark"] :where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) :where(.catalog-product-card,.hub-category-card,.proto-tool,.builder-select-column,.build-preview-panel,.smart-config,.saved-build-card,.functional-preview-window) {
    border-color: var(--tool-line);
    box-shadow: none;
}
html[data-theme="dark"] :where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) :where(input:not([type="checkbox"]),select,textarea) {
    color-scheme: dark;
    background: #242424;
    border-color: var(--tool-line);
}
html[data-theme="dark"] .prototype-v2 .saved-build-compare-controls { background: #1f1f1f; }
html[data-theme="dark"] .prototype-v2 .compare-v2-products { background: var(--tool-surface); }

/* Smart Builder: fotografía visible desde la primera carga y resultados con desplazamiento propio. */
.functional-smart-page .smart-hero-visual { position: relative; display: block; min-height: 360px; overflow: hidden; margin: 0; padding: 0; border: 0; border-radius: 15px; background: #191919; }
.functional-smart-page .smart-hero-visual::after { position: absolute; inset: 35% 0 0; background: linear-gradient(180deg, transparent, rgba(19, 19, 19,.8)); content: ""; pointer-events: none; }
.functional-smart-page .smart-hero-visual .smart-hero-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover !important; object-position: center; filter: none !important; mix-blend-mode: normal !important; }
.functional-smart-page .smart-hero-caption { position: absolute; z-index: 1; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); left: clamp(16px, 3vw, 28px); display: grid; gap: 7px; }
.functional-smart-page .smart-hero-caption span { color: #e5e5e5; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.functional-smart-page .smart-hero-caption strong { color: #fff; font-size: clamp(19px, 2.2vw, 28px); letter-spacing: -.035em; line-height: 1.12; }
.functional-smart-page .smart-v2-top { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); min-height: 0; }
.functional-smart-page .smart-v2-copy { min-width: 0; padding: clamp(28px, 3.2vw, 48px); }
.functional-smart-page .smart-v2-showcase { box-sizing: border-box; height: clamp(280px, 27vw, 360px) !important; min-height: 0 !important; max-height: 360px; align-self: stretch; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(148, 148, 148,.34), transparent 42%), linear-gradient(145deg, #323232, #1c1c1c); isolation: isolate; }
.functional-smart-page .smart-v2-showcase #smart-showcase-image { width: min(82%, 520px); height: min(360px, 82%); max-width: 100%; object-fit: contain; object-position: center; filter: drop-shadow(12px 20px 24px rgba(0,0,0,.32)); }
.functional-smart-page .smart-v2-showcase [hidden] { display: none; }
.functional-smart-page .smart-showcase-placeholder { position: absolute; inset: 0; display: grid; width: 100%; height: 100%; place-items: center; overflow: hidden; background: radial-gradient(ellipse at 68% 34%, rgba(167, 167, 167, .22), transparent 46%), linear-gradient(135deg, #3a3a3a, #292929 74%); }
.functional-smart-page .smart-showcase-placeholder::before { position: absolute; inset: 16px; border: 1px solid rgba(240, 240, 240, .16); border-radius: 13px; content: ""; }
.functional-smart-page .smart-showcase-glow { position: absolute; top: 50%; left: 50%; width: min(38%, 210px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(167, 167, 167, .38), transparent 70%); filter: blur(12px); transform: translate(-50%, -50%); }
.functional-smart-page .smart-showcase-empty-copy { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; max-width: 390px; padding: 28px; text-align: center; }
.functional-smart-page .smart-showcase-empty-copy > span { color: #dadada; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.functional-smart-page .smart-showcase-empty-copy > strong { color: #fff; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.035em; line-height: 1.12; text-wrap: balance; }
.functional-smart-page .smart-showcase-empty-copy > p { max-width: 32ch; margin: 0; color: #d7d7d7; font-size: 15px; line-height: 1.5; }
.functional-smart-page .smart-result { height: min(780px, max(430px, 74vh)); height: min(780px, max(430px, 74dvh)); min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--tool-accent) 55%, transparent) transparent; }
.functional-smart-page .smart-result:focus-visible { outline: 3px solid var(--focus-ring, #9d9d9d); outline-offset: -3px; }
.functional-smart-page .smart-result-empty { box-sizing: border-box; min-height: 100%; }
.functional-smart-page .smart-result-head { position: sticky; top: 0; z-index: 3; background: var(--tool-surface); }
html[data-theme="dark"] .functional-smart-page .smart-result-head { background: var(--tool-surface); }
@media (max-width: 1000px) {
    .functional-smart-page .smart-hero-visual { min-height: 310px; }
    .functional-smart-page .smart-v2-top { grid-template-columns: minmax(0, 1fr); }
    .functional-smart-page .smart-v2-showcase { height: 320px !important; max-height: 320px; }
    .functional-smart-page .smart-result { height: min(720px, max(430px, 70vh)); height: min(720px, max(430px, 70dvh)); }
}
@media (max-width: 700px) {
    .functional-smart-page .smart-hero-visual { min-height: 270px; }
    .functional-smart-page .smart-v2-copy { padding: 26px 22px; }
    .functional-smart-page .smart-v2-showcase { height: 280px !important; max-height: 280px; }
    .functional-smart-page .smart-result { height: min(680px, max(400px, 68vh)); height: min(680px, max(400px, 68dvh)); }
    .functional-smart-page .smart-result-head { padding: 17px 16px 13px; }
}

@media (max-width: 900px) {
    .category-page .category-main { width: min(100% - 32px, 1460px); }
    .category-page .category-filters { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: end; }
    .category-page .category-filters label { grid-column: auto; }
    .prototype-v2 .build-preview-panel { position: static; }
}
@media (max-width: 700px) {
    .components-hub-page .hub-category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .components-hub-page .hub-category-media { min-height: 120px; }
    .category-page .category-main { width: min(100% - 24px, 1460px); }
    .category-page .category-filters { position: static; grid-template-columns: 1fr 1fr; }
    .prototype-v2 .proto-v2-hero { grid-template-columns: 1fr; }
    .prototype-v2 .proto-v2-visual { min-height: 210px; }
    .functional-sheet-page .component-preview { height: 360px; max-height: 360px; }
    .functional-sheet-page .ficha-product-image { height: 290px; }
    .functional-sheet-page .detail-v2.is-ficha-selected { height: 360px; max-height: 360px; }
    .functional-sheet-page .proto-v2-visual--photo { min-height: 0; aspect-ratio: 3 / 2; border-radius: 0 0 20px 20px; }
    .functional-compare-page .proto-v2-visual--photo { min-height: 0; aspect-ratio: 3 / 2; border-radius: 0 0 20px 20px; }
    .prototype-v2 .builder-page-heading { align-items: stretch; flex-direction: column; }
    .prototype-v2 .builder-page-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .prototype-v2 .saved-build-compare-controls { align-items: stretch; flex-direction: column; }
    .prototype-v2 .compare-v2-products { top: 60px; }
    .functional-tool-visual { min-height: 210px; }
}
@media (max-width: 480px) {
    .functional-sheet-page .component-preview { height: 290px; max-height: 290px; }
    .functional-sheet-page .ficha-product-image { height: 230px; }
    .functional-sheet-page .detail-v2.is-ficha-selected { height: 340px; max-height: 340px; }
    .functional-sheet-page .spec-list > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (max-width: 430px) {
    .components-hub-page .hub-category-grid { gap: 9px; }
    .components-hub-page .hub-category-copy { padding: 13px; }
    .components-hub-page .hub-category-media { min-height: 105px; }
    .category-page .category-filters { gap: 7px; padding: 11px; }
    .category-page .category-product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
    .prototype-v2 .proto-tool-header { padding: 17px 15px; }
    .prototype-v2 .proto-tool-body { padding: 15px; }
    .prototype-v2 .builder-page-actions { grid-template-columns: 1fr; }
    .functional-tool-visual--sheet { grid-template-columns: 1fr; }
    .functional-tool-visual--sheet .functional-preview-product { min-height: 90px; }
}
@media (prefers-reduced-motion: reduce) {
    :where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) *,
    :where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) *::before,
    :where(.components-hub-page,.category-page,.product-detail-page,.prototype-v2) *::after {
        scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
    }
}
