/* =========================================================
   PSM – Ficha de producto (Fase 3C)
   ========================================================= */
.psm-product { overflow-x: clip; }
.psm-product *, .psm-product *::before, .psm-product *::after { min-width: 0; }

/* ---------- Hero ---------- */
.product-hero { position: relative; overflow: hidden; padding: 28px 0 30px; }
.product-hero-bg { position: absolute; inset: 0; background: #0E1B2D linear-gradient(135deg, #0E1B2D 0%, #13305a 60%, #0A4F9C 100%); background-size: cover; background-position: right center; z-index: 1; }
.product-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,27,45,.95) 0%, rgba(14,27,45,.82) 45%, rgba(14,27,45,.35) 100%); z-index: 2; }
.product-hero-content { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.product-breadcrumb ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .8125rem; color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .02em; }
.product-breadcrumb li { display: inline-flex; align-items: center; }
.product-breadcrumb li + li::before { content: "›"; margin: 0 10px; color: rgba(255,255,255,.55); }
.product-breadcrumb a { color: rgba(255,255,255,.8); }
.product-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.product-breadcrumb [aria-current] { color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.product-hero-title { font-family: var(--font-headings); font-weight: 700; color: #fff; font-size: 2.875rem; line-height: 1.05; margin: 0 0 6px; letter-spacing: -.01em; }
.product-hero-subtitle { color: rgba(255,255,255,.92); font-size: 1.1875rem; margin: 0; }
.product-hero-badge { flex-shrink: 0; align-self: center; color: #fff; font-size: .75rem; line-height: 1.45; letter-spacing: .08em; text-transform: uppercase; padding-left: 16px; border-left: 3px solid var(--psm-performance-amber); transform: skewX(-8deg); }

/* ---------- Tarjetas base ---------- */
.psm-card { background: #fff; border: 1px solid var(--psm-border-color); border-radius: 6px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(14,27,45,.03); }
.psm-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.psm-card-title { font-size: 1.125rem; margin: 0; color: var(--psm-deep-navy); }
.product-block-title { font-size: 1.0625rem; margin: 0 0 12px; }
.diagram-tag { flex-shrink: 0; max-width: 40%; font-size: .6875rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .03em; color: var(--psm-technical-gray); border: 1px solid var(--psm-border-color); border-radius: 3px; padding: 5px 9px; text-align: center; overflow-wrap: anywhere; }

.psm-pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.psm-pill { display: inline-block; background: #EAF3FC; color: var(--psm-deep-navy); font-weight: 600; font-size: .9375rem; padding: 8px 20px; border-radius: 4px; overflow-wrap: anywhere; }
.psm-pill--link { transition: background var(--transition-fast), color var(--transition-fast); }
.psm-pill--link:hover { background: var(--psm-industrial-blue); color: #fff; }

.btn-sm { padding: .5rem 1rem; font-size: .875rem; }

/* ---------- Zona superior: 3 columnas ---------- */
.product-top { padding: 32px 0 40px; background: linear-gradient(180deg, #F7FAFD 0%, #fff 100%); }
.product-top-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) minmax(0, .88fr); gap: 20px; align-items: start; }
.product-col { display: flex; flex-direction: column; gap: 22px; }

/* Diagrama principal */
.diagram-figure { margin: 0; }
.diagram-frame { position: relative; display: block; background: #fff; border-radius: 4px; overflow: hidden; cursor: zoom-in; }
.diagram-frame img { width: 100%; height: auto; max-height: 540px; object-fit: contain; margin: 0 auto; image-rendering: auto; }
.product-diagram { padding: 18px 18px 16px; }
.product-diagram .diagram-frame { background: #FBFCFE; border: 1px solid #EEF2F6; }
.diagram-position-badge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.94); border-radius: 30px; padding: 4px 4px 4px 12px; box-shadow: 0 2px 8px rgba(14,27,45,.12); }
.diagram-position-label { color: var(--psm-industrial-blue); font-weight: 600; font-size: .8125rem; }
.diagram-position-num { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px; background: #1E88E5; color: #fff; font-family: var(--font-headings); font-weight: 700; font-size: .9375rem; border: 3px solid #BFE0FA; }
.diagram-zoom { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(14,27,45,.72); color: #fff; display: inline-flex; align-items: center; justify-content: center; opacity: .75; transition: opacity var(--transition-fast); }
.diagram-frame:hover .diagram-zoom { opacity: 1; }
.diagram-caption { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--psm-border-color); border-radius: 4px; background: #F9FBFD; color: var(--psm-technical-gray); font-size: .8125rem; line-height: 1.5; }

.diagram-caption-title { color: var(--psm-deep-navy); font-weight: 500; }
.diagram-caption-remark { flex-basis: 100%; }
.diagram-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 20px; border: 1px dashed #C9D6E4; border-radius: 4px; background: repeating-linear-gradient(0deg, #F9FBFD, #F9FBFD 19px, #EFF4F9 20px), #F9FBFD; color: #8FA3B8; }
.diagram-empty--compact { padding: 60px 20px; }
.diagram-empty-title { margin: 6px 0 0; font-family: var(--font-headings); font-weight: 600; color: var(--psm-deep-navy); }
.diagram-empty-text { margin: 0 0 10px; font-size: .875rem; color: var(--psm-technical-gray); max-width: 34ch; }

/* Resumen */
.product-summary { display: flex; flex-direction: column; align-items: flex-start; }
.product-brand-chip { background: #E3F0FB; color: var(--psm-industrial-blue); font-size: .75rem; font-weight: 700; letter-spacing: .04em; padding: 3px 12px; border-radius: 3px; margin-bottom: 10px; }
.product-pn { font-family: var(--font-headings); font-weight: 700; font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.05; letter-spacing: -.015em; color: var(--psm-deep-navy); margin: 0 0 6px; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.product-name { font-family: var(--font-body); font-size: 1.1875rem; text-transform: uppercase; letter-spacing: .02em; color: var(--psm-deep-navy); margin: 0 0 12px; overflow-wrap: anywhere; }
.product-lead { color: var(--psm-technical-gray); font-size: .875rem; line-height: 1.55; margin: 0; }

/* Información técnica */
.techdata-list { margin: 12px 0 0; }
.techdata-row { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid #EDF1F5; font-size: .875rem; }
.techdata-row:last-child { border-bottom: 0; }
.techdata-row dt { color: var(--psm-technical-gray); }
.techdata-row dd { margin: 0; color: var(--psm-deep-navy); font-weight: 500; overflow-wrap: anywhere; }
.techdata-line { display: block; }

/* Panel de cotización */
.product-quote-panel { position: sticky; top: calc(var(--header-height-sticky) + 20px); background: #fff; border: 1px solid var(--psm-border-color); border-radius: 6px; padding: 14px; }
.btn-quote-lg { width: 100%; gap: 12px; padding: 1rem 1.25rem; font-size: 1.125rem; font-family: var(--font-headings); border-radius: 4px; box-shadow: 0 4px 14px rgba(255,180,0,.28); }
.product-benefits { list-style: none; margin: 12px 0 0; padding: 0 8px; }
.benefit { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid #EDF1F5; }
.benefit:last-child { border-bottom: 0; padding-bottom: 6px; }
.benefit-icon { color: #1E88E5; flex-shrink: 0; }
.benefit-text { display: flex; flex-direction: column; font-size: .8125rem; color: var(--psm-technical-gray); line-height: 1.4; }
.benefit-text strong { color: var(--psm-deep-navy); font-size: .9375rem; line-height: 1.3; margin-bottom: 3px; }

/* ---------- Navegación interna ---------- */
.product-nav { position: sticky; top: var(--header-height-sticky); z-index: 50; background: rgba(255,255,255,.97); backdrop-filter: blur(6px); border-bottom: 1px solid var(--psm-border-color); }
.product-nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.product-nav-list::-webkit-scrollbar { display: none; }
.product-nav-list > li { flex-shrink: 0; }
.product-nav-link { display: block; white-space: nowrap; padding: 14px 22px 12px; color: var(--psm-deep-navy); font-weight: 500; font-size: .9375rem; border-bottom: 3px solid transparent; }
.product-nav-link:hover { color: var(--psm-industrial-blue); }
.product-nav-link.is-active { color: #1E88E5; border-bottom-color: #1E88E5; font-weight: 600; }
.psm-product [id] { scroll-margin-top: calc(var(--header-height-sticky) + 70px); }

/* ---------- Detalles ---------- */
.product-details { padding: 20px 0 44px; }
.product-details-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 16px; align-items: stretch; }
.product-details-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.product-details-main { display: flex; flex-direction: column; gap: 16px; }
.product-details-grid.is-single .product-details-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
.product-description-body > *:first-child { margin-top: 12px; }
.product-description-body p { color: #4A5563; font-size: .9375rem; line-height: 1.6; margin: 12px 0 0; }
.product-description-min { color: var(--psm-deep-navy); font-size: 1rem; }

/* Diagrama de ubicación (secundarios) */
.product-location { display: flex; flex-direction: column; }
.location-slider { position: relative; flex: 1; }
.location-slide { margin: 0; }
.location-slide[hidden] { display: none; }
.location-subtitle { margin: 4px 0 0; color: var(--psm-technical-gray); font-size: 1rem; }
.diagram-frame--location img { max-height: 420px; }
.slider-btn { position: absolute; top: 55%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--psm-border-color); background: #fff; color: var(--psm-deep-navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(14,27,45,.12); z-index: 2; }
.slider-btn:hover { background: var(--psm-industrial-blue); color: #fff; }
.slider-btn--prev { left: 4px; } .slider-btn--next { right: 4px; }
.slider-count { text-align: center; margin: 10px 0 0; font-size: .8125rem; color: var(--psm-technical-gray); }

/* Diagramas sin imagen: lista compacta */
.location-others { margin-top: 16px; padding-top: 14px; border-top: 1px solid #EDF1F5; }
.product-location--compact .location-others { margin-top: 0; padding-top: 0; border-top: 0; }
.location-others-title { font-size: 1rem; margin: 0 0 10px; }
.location-others-list { list-style: none; margin: 0; padding: 0; }
.location-others-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #EDF1F5; font-size: .875rem; }
.location-others-list li:last-child { border-bottom: 0; }
.lo-name { color: var(--psm-deep-navy); overflow-wrap: anywhere; }
.lo-code { color: var(--psm-technical-gray); font-size: .8125rem; margin-left: 6px; }
.lo-pos { flex-shrink: 0; color: var(--psm-industrial-blue); font-weight: 600; }
.location-others-note { margin: 8px 0 0; font-size: .75rem; color: var(--psm-technical-gray); }

/* ---------- Kits que contienen el repuesto ---------- */
.product-kits { padding: 0 0 40px; }
.product-kits .related-title { margin-bottom: 14px; }
.kits-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.kit-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--psm-border-color); border-left: 4px solid var(--psm-performance-amber); border-radius: 6px; padding: 14px 16px; }
.kit-icon { color: var(--psm-industrial-blue); flex-shrink: 0; }
.kit-body { flex: 1; }
.kit-type { display: inline-block; font-size: .6875rem; font-weight: 700; color: var(--psm-industrial-blue); background: #E3F0FB; border-radius: 3px; padding: 2px 8px; margin-bottom: 4px; }
.kit-pn { font-size: 1.0625rem; margin: 0; overflow-wrap: anywhere; }
.kit-pn a { color: var(--psm-deep-navy); }
.kit-desc { margin: 2px 0 0; font-size: .8125rem; text-transform: uppercase; color: #4A5563; }
.kit-meta { margin: 4px 0 0; font-size: .75rem; color: var(--psm-technical-gray); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.kit-btn { flex-shrink: 0; gap: 6px; white-space: nowrap; }

/* ---------- Relacionados ---------- */
.product-related { padding: 0 0 48px; }
.related-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.related-title { font-size: 1.5rem; margin: 0; }
.related-more { font-size: .8125rem; font-weight: 600; color: #1E88E5; }
.related-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.related-card { display: flex; gap: 14px; background: #fff; border: 1px solid var(--psm-border-color); border-radius: 6px; padding: 14px; transition: box-shadow var(--transition-fast), border-color var(--transition-fast); }
.related-card:hover { border-color: #BFD4EA; box-shadow: 0 6px 18px rgba(14,27,45,.06); }
.related-media { flex: 0 0 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.related-media img { max-height: 80px; width: auto; object-fit: contain; }
.related-placeholder { width: 80px; height: 80px; border-radius: 4px; background: #F2F6FA; color: #A0ABC0; display: flex; align-items: center; justify-content: center; }
.related-body { display: flex; flex-direction: column; align-items: flex-start; }
.related-pn { font-size: 1rem; margin: 0 0 2px; overflow-wrap: anywhere; }
.related-pn a { color: var(--psm-deep-navy); }
.related-desc { font-size: .75rem; text-transform: uppercase; color: #4A5563; margin: 0 0 4px; line-height: 1.35; }
.related-brand { font-size: .75rem; color: var(--psm-technical-gray); margin: 0 0 10px; }
.related-btn { margin-top: auto; border-color: #1E88E5; color: #1E88E5; border-width: 1.5px; gap: 8px; white-space: nowrap; padding: .4rem .85rem; font-size: .8125rem; }

/* ---------- CTA de soporte ---------- */
.product-support-cta { position: relative; overflow: hidden; background: linear-gradient(90deg, #F1F4F8 0%, #E7ECF2 100%); padding: 26px 0; }
.support-cta-bg { position: absolute; top: 0; right: 0; bottom: 0; width: 42%; background-size: cover; background-position: center; filter: grayscale(1); opacity: .35; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.product-support-inner { position: relative; }
.product-support-inner { display: flex; align-items: center; gap: 24px; }
.support-cta-icon { color: var(--psm-performance-amber); flex-shrink: 0; }
.support-cta-text { flex: 0 1 auto; }
.support-cta-btn { margin-left: 16px; }
.support-cta-text h2 { font-size: 1.625rem; margin: 0 0 2px; }
.support-cta-text p { margin: 0; color: #4A5563; }
.support-cta-btn { flex-shrink: 0; gap: 8px; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
    .product-top-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
    .product-col--quote { grid-column: 1 / -1; }
    .product-quote-panel { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: center; }
    .product-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; }
    .benefit:nth-last-child(2) { border-bottom: 0; }
    .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .product-details-grid { grid-template-columns: minmax(0, 1fr); }
    .product-quote-panel { grid-template-columns: minmax(0, 1fr); }
    .product-hero-badge { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .product-hero { padding: 20px 0 22px; }
    .product-breadcrumb ol { font-size: .6875rem; margin-bottom: 10px; }
    .product-breadcrumb li + li::before { margin: 0 6px; }
    .product-hero-title { font-size: 2rem; }
    .product-hero-subtitle { font-size: .9375rem; }

    .product-top { padding: 20px 0 32px; }
    .product-top-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    /* Orden móvil: resumen (PN) → diagrama → datos → cotización */
    .product-top-grid { display: flex; flex-direction: column; align-items: stretch; }
    .product-col--summary { display: contents; }
    .product-summary { order: 1; }
    .product-col--diagram { order: 2; }
    .product-techdata { order: 3; }
    .product-col--quote { order: 4; }

    .psm-card { padding: 16px; }
    .psm-card-head { flex-direction: column; }
    .diagram-tag { max-width: 100%; }
    .product-pn { font-size: 2rem; }
    .product-name { font-size: 1rem; }
    .product-benefits { grid-template-columns: minmax(0, 1fr); }
    .benefit:nth-last-child(2) { border-bottom: 1px solid #EDF1F5; }

    .product-nav-link { padding: 12px 14px 10px; font-size: .875rem; }
    .product-details { padding: 16px 0 36px; }
    .slider-btn { top: 62%; width: 34px; height: 34px; }

    .related-grid { grid-template-columns: minmax(0, 1fr); }
    .related-media, .related-placeholder { flex-basis: 76px; width: 76px; height: 76px; }

    .product-support-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .support-cta-text h2 { font-size: 1.25rem; }
    .support-cta-btn { width: 100%; margin-left: 0; }
    .support-cta-bg { display: none; }
    .kit-card { flex-wrap: wrap; }
    .kit-btn { width: 100%; }
    /* Evita que el botón flotante de WhatsApp tape CTAs al final */
    .product-support-cta { padding-bottom: 96px; }

}
body.single-psm_product .psm-floating-whatsapp { z-index: 900; }
@media (max-width: 767px) { body.single-psm_product .psm-floating-whatsapp { width: 52px; height: 52px; right: 14px; bottom: 14px; } }
