/*
 * Los Altillos — Pilar 4: Materiales del Steel Framing
 * Archivo: assets/pilar-materiales.css
 * Prefijo: p4-
 * Depende de: assets/main.css
 * ============================================================ */


/* ---- BREADCRUMB ------------------------------------------ */
.p4-breadcrumb { background: var(--color-bg-secondary); border-bottom: 1px solid var(--color-border); padding: 0.75rem 0; }
.p4-breadcrumb__inner { max-width: var(--container-max); margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--color-text-subtle); }
.p4-breadcrumb a { color: var(--color-text-subtle); transition: color var(--transition-fast); }
.p4-breadcrumb a:hover { color: var(--color-accent); }
.p4-breadcrumb__sep { color: var(--color-steel); }
.p4-breadcrumb__current { color: var(--color-text-muted); font-weight: 500; }


/* ---- HERO ------------------------------------------------ */
.p4-hero { position: relative; min-height: 420px; display: flex; align-items: flex-end; background: linear-gradient(135deg, #010c1e 0%, #011e45 50%, #02234f 100%); overflow: hidden; }
.p4-hero__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(1,12,30,0.96) 0%, rgba(1,12,30,0.55) 45%, rgba(1,12,30,0.18) 100%); }
.p4-hero__grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px); background-size: 48px 48px; pointer-events: none; }
.p4-hero__deco { position: absolute; right: 3.5rem; bottom: 2.5rem; z-index: 1; opacity: 0.05; pointer-events: none; }
.p4-hero__inner { position: relative; z-index: 2; max-width: var(--container-max); width: 100%; margin: 0 auto; padding: 2.5rem 2rem; }
.p4-hero__eyebrow { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.875rem; background: rgba(199,8,29,0.18); border: 1px solid rgba(199,8,29,0.38); border-radius: 100px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.82); margin-bottom: 1rem; }
.p4-hero__eyebrow svg { width: 11px; height: 11px; flex-shrink: 0; }
.p4-hero__h1 { font-family: var(--font-display); font-size: clamp(1.875rem, 4.5vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; color: #FFF; margin-bottom: 0.875rem; max-width: 720px; }
.p4-hero__subtitle { font-size: clamp(0.9375rem, 1.8vw, 1.0625rem); line-height: 1.65; color: rgba(255,255,255,0.58); max-width: 540px; margin-bottom: 1.75rem; }
.p4-hero__meta { display: flex; flex-wrap: wrap; gap: 1.25rem; padding-top: 1.125rem; border-top: 1px solid rgba(255,255,255,0.1); }
.p4-hero__meta-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; color: rgba(255,255,255,0.42); }
.p4-hero__meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }


/* ---- TOC MOBILE ------------------------------------------ */
.p4-toc-mobile { display: none; background: var(--color-bg-secondary); border-bottom: 1px solid var(--color-border); }
.p4-toc-mobile__toggle { width: 100%; padding: 0.875rem 1.5rem; display: flex; align-items: center; justify-content: space-between; background: none; border: none; font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; color: var(--color-text); cursor: pointer; }
.p4-toc-mobile__chevron { width: 16px; height: 16px; stroke: var(--color-text-subtle); fill: none; transition: transform var(--transition-fast); flex-shrink: 0; }
.p4-toc-mobile__toggle.is-open .p4-toc-mobile__chevron { transform: rotate(180deg); }
.p4-toc-mobile__list { display: none; padding: 0 1.5rem 1rem; list-style: none; }
.p4-toc-mobile__list.is-open { display: block; }
.p4-toc-mobile__list li { border-bottom: 1px solid var(--color-border); }
.p4-toc-mobile__list li:last-child { border-bottom: none; }
.p4-toc-mobile__list a { display: block; padding: 0.625rem 0; font-size: 0.8125rem; color: var(--color-text-muted); }


/* ---- LAYOUT ---------------------------------------------- */
.p4-layout { max-width: var(--container-max); margin: 0 auto; padding: 3.5rem 2rem 5rem; display: grid; grid-template-columns: 1fr 240px; gap: 4rem; align-items: start; }


/* ---- SIDEBAR TOC ----------------------------------------- */
.p4-sidebar { position: sticky; top: calc(var(--header-height) + 1.5rem); }
.p4-toc { background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.375rem; }
.p4-toc__label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-accent); margin-bottom: 0.875rem; display: flex; align-items: center; gap: 0.4rem; }
.p4-toc__label svg { width: 11px; height: 11px; flex-shrink: 0; }
.p4-toc__list { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; }
.p4-toc__list li a { display: block; padding: 0.4375rem 0.75rem; font-size: 0.8125rem; line-height: 1.4; color: var(--color-text-subtle); border-radius: var(--radius-sm); border-left: 2px solid transparent; transition: all var(--transition-fast); }
.p4-toc__list li a:hover,
.p4-toc__list li a.is-active { color: var(--color-accent); background: rgba(199,8,29,0.05); border-left-color: var(--color-accent); font-weight: 600; }
.p4-toc__divider { height: 1px; background: var(--color-border); margin: 0.5rem 0; }


/* ---- BASE TYPOGRAPHY ------------------------------------- */
.p4-section { padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--color-border); }
.p4-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.p4-h2 { font-family: var(--font-display); font-size: clamp(1.375rem, 2.5vw, 1.875rem); line-height: 1.15; letter-spacing: -0.02em; color: var(--color-text); margin-bottom: 1.25rem; scroll-margin-top: calc(var(--header-height) + 2rem); }
.p4-h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; color: var(--color-text); margin-top: 2rem; margin-bottom: 0.75rem; }
.p4-p { font-size: 1.0625rem; line-height: 1.8; color: var(--color-text-muted); margin-bottom: 1.25rem; }
.p4-p:last-child { margin-bottom: 0; }
.p4-note { padding: 1rem 1.25rem; background: rgba(2,55,120,0.05); border-left: 3px solid var(--color-accent); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 0.9375rem; color: var(--color-text-muted); line-height: 1.7; margin: 1.5rem 0; }
.p4-note strong { color: var(--color-text); }


/* ---- SNIPPET BLOCK --------------------------------------- */
.p4-snippet { background: rgba(2,55,120,0.05); border: 1px solid rgba(2,55,120,0.18); border-left: 4px solid var(--color-secondary); border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 1.125rem 1.375rem; margin-bottom: 1.75rem; }
.p4-snippet__label { font-size: 0.675rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-secondary); margin-bottom: 0.5rem; }
.p4-snippet__text { font-size: 1.0625rem; line-height: 1.75; color: var(--color-text-muted); }
.p4-snippet__text strong { color: var(--color-text); }


/* ---- SUMMARY TABLE --------------------------------------- */
.p4-summary-table-wrap { margin-top: 1.75rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }
.p4-summary-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.p4-summary-table thead { background: var(--color-bg-dark); }
.p4-summary-table thead th { padding: 0.875rem 1.125rem; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.55); }
.p4-summary-table tbody tr { border-bottom: 1px solid var(--color-border); transition: background var(--transition-fast); }
.p4-summary-table tbody tr:last-child { border-bottom: none; }
.p4-summary-table tbody tr:hover { background: var(--color-bg-secondary); }
.p4-summary-table td { padding: 0.875rem 1.125rem; vertical-align: middle; line-height: 1.5; }
.p4-summary-table td:first-child { font-weight: 600; color: var(--color-text); }
.p4-summary-table td:nth-child(2) { color: var(--color-text-muted); }
.p4-summary-table td:nth-child(3) { color: var(--color-text-subtle); font-size: 0.875rem; }
.p4-table-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 0.625rem; vertical-align: middle; flex-shrink: 0; }


/* ---- WALL DIAGRAM ---------------------------------------- */
.p4-wall-diagram-wrap { margin-top: 1.75rem; background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-xl); overflow: hidden; }
.p4-wall-diagram-wrap__head { padding: 1.125rem 1.5rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--color-border); background: var(--color-bg); }
.p4-wall-diagram-wrap__head-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: rgba(2,55,120,0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p4-wall-diagram-wrap__head-icon svg { width: 15px; height: 15px; fill: none; stroke: var(--color-secondary); stroke-width: 1.75; }
.p4-wall-diagram-wrap__head-title { font-size: 0.875rem; font-weight: 600; color: var(--color-text); }
.p4-wall-diagram-wrap__head-sub { font-size: 0.775rem; color: var(--color-text-subtle); margin-top: 0.1rem; }
.p4-wall-diagram-svg { width: 100%; padding: 1.5rem; display: block; }
.p4-wall-diagram-note { padding: 0.875rem 1.5rem; background: rgba(245,158,11,0.05); border-top: 1px solid rgba(245,158,11,0.18); font-size: 0.8125rem; color: var(--color-text-subtle); line-height: 1.6; display: flex; gap: 0.625rem; align-items: flex-start; }
.p4-wall-diagram-note svg { width: 14px; height: 14px; fill: none; stroke: var(--color-warning); stroke-width: 1.75; flex-shrink: 0; margin-top: 0.1rem; }


/* ---- PROFILE TABLE --------------------------------------- */
.p4-profile-table-wrap { margin-top: 1.5rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }
.p4-profile-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.p4-profile-table thead { background: rgba(2,55,120,0.06); }
.p4-profile-table thead th { padding: 0.75rem 1rem; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-secondary); border-bottom: 1px solid var(--color-border); }
.p4-profile-table tbody tr { border-bottom: 1px solid var(--color-border); transition: background var(--transition-fast); }
.p4-profile-table tbody tr:last-child { border-bottom: none; }
.p4-profile-table tbody tr:hover { background: var(--color-bg-secondary); }
.p4-profile-table td { padding: 0.75rem 1rem; vertical-align: middle; color: var(--color-text-muted); line-height: 1.5; }
.p4-profile-table td:first-child { font-family: monospace; font-size: 0.9375rem; font-weight: 700; color: var(--color-secondary); white-space: nowrap; }
.p4-profile-table td:nth-child(2) { font-weight: 600; color: var(--color-text); }


/* ---- LAYERS MOBILE FALLBACK ------------------------------ */
.p4-layers-mobile { display: none; flex-direction: column; gap: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 1rem; }
.p4-layer-item { display: grid; grid-template-columns: 40px 1fr; border-bottom: 1px solid var(--color-border); }
.p4-layer-item:last-child { border-bottom: none; }
.p4-layer-item__num { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 0.75rem; color: white; }
.p4-layer-item__body { padding: 0.875rem 1rem; }
.p4-layer-item__name { font-size: 0.9rem; font-weight: 600; color: var(--color-text); margin-bottom: 0.2rem; }
.p4-layer-item__desc { font-size: 0.8rem; color: var(--color-text-subtle); line-height: 1.5; }


/* ---- MATERIAL BADGES ------------------------------------- */
.p4-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 100px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; margin-left: 0.5rem; vertical-align: middle; }
.p4-badge--interior { background: rgba(2,55,120,0.08);  color: var(--color-secondary); border: 1px solid rgba(2,55,120,0.18); }
.p4-badge--exterior { background: rgba(199,8,29,0.07); color: var(--color-accent);    border: 1px solid rgba(199,8,29,0.18); }
.p4-badge--ambos    { background: var(--color-steel-light); color: var(--color-steel-dark); border: 1px solid var(--color-steel); }


/* ---- SOURCES SECTION ------------------------------------- */
.p4-sources { margin-top: 1.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.p4-source-item { display: flex; align-items: flex-start; gap: 0.875rem; padding: 0.875rem 1rem; background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-md); transition: border-color var(--transition-fast); }
.p4-source-item:hover { border-color: var(--color-border-dark); }
.p4-source-item__icon { width: 28px; height: 28px; border-radius: var(--radius-sm); background: rgba(2,55,120,0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p4-source-item__icon svg { width: 13px; height: 13px; fill: none; stroke: var(--color-secondary); stroke-width: 1.75; }
.p4-source-item__name { font-size: 0.875rem; font-weight: 600; color: var(--color-text); margin-bottom: 0.15rem; }
.p4-source-item__desc { font-size: 0.8rem; color: var(--color-text-subtle); line-height: 1.5; }


/* ---- FAQ ------------------------------------------------- */
.p4-faq { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.p4-faq__item { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; transition: border-color var(--transition-fast); }
.p4-faq__item.is-open { border-color: var(--color-accent); }
.p4-faq__trigger { width: 100%; padding: 1.0625rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: none; border: none; text-align: left; cursor: pointer; font-family: var(--font-body); transition: background var(--transition-fast); }
.p4-faq__trigger:hover,
.p4-faq__item.is-open .p4-faq__trigger { background: var(--color-bg-secondary); }
.p4-faq__q-num { font-size: 0.7rem; font-weight: 700; color: var(--color-accent); font-family: monospace; flex-shrink: 0; min-width: 1.5rem; }
.p4-faq__q-text { flex: 1; font-size: 0.9375rem; font-weight: 600; color: var(--color-text); line-height: 1.4; }
.p4-faq__icon { width: 22px; height: 22px; border-radius: 50%; background: var(--color-bg-tertiary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition-fast); }
.p4-faq__icon svg { width: 10px; height: 10px; stroke: var(--color-text-subtle); fill: none; stroke-width: 2; transition: transform var(--transition-fast); }
.p4-faq__item.is-open .p4-faq__icon { background: var(--color-accent); }
.p4-faq__item.is-open .p4-faq__icon svg { stroke: white; transform: rotate(45deg); }
.p4-faq__body { display: none; padding: 0 1.25rem 1.25rem; }
.p4-faq__item.is-open .p4-faq__body { display: block; }
.p4-faq__answer { font-size: 0.9375rem; line-height: 1.8; color: var(--color-text-muted); border-top: 1px solid var(--color-border); padding-top: 1rem; }


/* ---- CTA ------------------------------------------------- */
.p4-cta { background: var(--color-bg-dark); border-radius: var(--radius-xl); padding: 2.5rem; margin-top: 3.5rem; position: relative; overflow: hidden; }
.p4-cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 50% 80% at 100% 50%, rgba(11,74,161,0.4) 0%, transparent 70%), radial-gradient(ellipse 35% 60% at 0% 80%, rgba(199,8,29,0.14) 0%, transparent 60%); pointer-events: none; }
.p4-cta__inner { position: relative; z-index: 1; }
.p4-cta__eyebrow { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-accent-light); margin-bottom: 0.625rem; }
.p4-cta__title { font-family: var(--font-display); font-size: clamp(1.375rem, 2.5vw, 1.875rem); color: white; line-height: 1.2; margin-bottom: 0.75rem; }
.p4-cta__text { font-size: 1rem; color: rgba(255,255,255,0.55); line-height: 1.7; max-width: 520px; margin-bottom: 1.75rem; }
.p4-cta__links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.625rem; }
.p4-cta__link { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.125rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-md); transition: all var(--transition-base); }
.p4-cta__link:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.22); transform: translateX(4px); }
.p4-cta__link-icon { width: 34px; height: 34px; background: rgba(199,8,29,0.22); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p4-cta__link-icon svg { width: 15px; height: 15px; stroke: rgba(255,255,255,0.75); fill: none; stroke-width: 1.5; }
.p4-cta__link-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.32); display: block; margin-bottom: 0.15rem; }
.p4-cta__link-title { font-size: 0.8125rem; font-weight: 600; color: rgba(255,255,255,0.85); line-height: 1.3; }
.p4-cta__link-arrow { color: rgba(255,255,255,0.25); flex-shrink: 0; display: flex; }
.p4-cta__link-arrow svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }


/* ---- RESPONSIVE ------------------------------------------ */
@media (max-width: 960px) {
  .p4-layout { grid-template-columns: 1fr; gap: 0; padding-top: 2rem; }
  .p4-sidebar { display: none; }
  .p4-toc-mobile { display: block; }
  .p4-wall-diagram-svg { padding: 1rem; }
  .p4-layers-mobile { display: flex; }
}
@media (max-width: 640px) {
  .p4-hero { min-height: 360px; }
  .p4-hero__deco { display: none; }
  .p4-hero__inner, .p4-breadcrumb__inner, .p4-layout { padding-left: 1.5rem; padding-right: 1.5rem; }
  .p4-summary-table td:nth-child(3) { display: none; }
  .p4-profile-table td { font-size: 0.8125rem; padding: 0.625rem 0.75rem; }
  .p4-cta { padding: 1.75rem 1.5rem; }
  .p4-cta__links { grid-template-columns: 1fr; }
}
