/* Página general del catálogo (catalogo.html): fotografía a sangre y titulares condensados */
html { scroll-behavior: smooth; }

.cg { --noche: #0b1521; --azul: #1a3d5d; --ambar: #f2a516; --hueso: #f1f0ec; background: var(--noche); color: #fff; }
.cg a { text-decoration: none; }
.cg h2, .cg h3, .cg-panel strong, .cg-gigante, .cg-columna strong { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; text-transform: uppercase; }
.cg h2, .cg h3 { margin: 0; color: inherit; font-weight: 800; line-height: .95; }
.cg p { margin: 0; color: inherit; }
.cg-fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cg-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Portada: tres paneles ---------- */
.cg-portada { display: flex; gap: 3px; height: calc(100vh - 90px); height: calc(100svh - 90px); min-height: 520px; max-height: 860px; }
.cg-panel { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; color: #fff; transition: flex-grow .55s cubic-bezier(.2,.7,.2,1); }
.cg-panel:hover, .cg-panel:focus-visible { flex-grow: 1.9; color: #fff; }
.cg-panel .cg-fondo { transition: transform .9s ease; }
.cg-panel:nth-of-type(1) .cg-fondo { object-position: 44% center; }
.cg-panel:nth-of-type(2) .cg-fondo { object-position: 54% center; }
.cg-panel:hover .cg-fondo { transform: scale(1.05); }
.cg-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,14,22,.94) 0%, rgba(7,14,22,.55) 30%, rgba(7,14,22,0) 62%); }
.cg-panel-texto { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 32px; }
.cg-panel strong { font-size: clamp(2.4rem, 4.4vw, 4.4rem); font-weight: 800; line-height: .95; }
.cg-panel-texto > span { margin: 6px 0 16px; font-size: 1.02rem; color: #e4e9ee; }
.cg-panel em, .cg-cinta em { font-style: normal; font-weight: 700; padding-bottom: 3px; border-bottom: 3px solid var(--ambar); }

.cg-panel-claro { background: var(--hueso); }
.cg-panel-claro::after { background: linear-gradient(to top, var(--noche) 0%, rgba(11,21,33,.92) 24%, rgba(11,21,33,0) 46%); }
.cg-piezas { position: absolute; left: 0; right: 0; top: 4%; height: 62%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; padding: 0 18px; }
.cg-piezas img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; transition: transform .6s ease; }
.cg-panel:hover .cg-piezas img { transform: rotate(-4deg) scale(1.04); }

/* ---------- Barra fija ---------- */
.cg-barra { position: sticky; top: 0; z-index: 40; display: flex; justify-content: center; background: var(--noche); border-bottom: 1px solid rgba(255,255,255,.12); }
.cg-barra a { padding: 14px 22px; color: #fff; font-weight: 600; border-bottom: 3px solid transparent; }
.cg-barra a:hover { color: var(--ambar); border-bottom-color: var(--ambar); }

.cg-bloque { scroll-margin-top: 52px; }
.cg-boton { display: inline-block; padding: 14px 30px; border-radius: 4px; background: var(--ambar); color: #16100a; font-weight: 800; transition: background .2s; }
.cg-boton:hover { background: #fff; color: #16100a; }

/* ---------- Maquinarias ---------- */
.cg-hero { position: relative; display: flex; align-items: flex-end; min-height: min(86vh, 760px); overflow: hidden; }
.cg-hero .cg-fondo { object-position: 68% center; }
.cg-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,14,22,.9) 0%, rgba(7,14,22,.55) 36%, rgba(7,14,22,0) 62%); }
.cg-hero-texto { position: relative; z-index: 2; max-width: 620px; padding: 0 0 8vh 6vw; }
.cg-categoria { margin-bottom: 10px !important; color: var(--ambar) !important; font-weight: 700; }
.cg-hero h2 { font-size: clamp(3.2rem, 7.5vw, 7rem); }
.cg-hero-texto > p:not(.cg-categoria) { max-width: 400px; margin: 14px 0 26px; font-size: 1.12rem; }

.cg-estudio { position: relative; overflow: hidden; padding: 56px 6vw 64px; text-align: center; background: radial-gradient(ellipse 70% 55% at 50% 46%, #46688a 0%, #1a3350 48%, var(--noche) 100%); }
.cg-gigante { position: absolute; top: 40px; left: 0; right: 0; font-size: 15vw; font-weight: 800; line-height: 1; color: rgba(255,255,255,.08); white-space: nowrap; user-select: none; }
.cg-estudio img { position: relative; z-index: 1; display: block; width: min(880px, 100%); max-height: 560px; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 30px 28px rgba(0,0,0,.5)); }
.cg-estudio-texto { position: relative; z-index: 2; }
.cg-estudio h2 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
.cg-estudio p { margin: 8px 0 22px; color: #d3dde7; font-size: 1.1rem; }

.cg-cinta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 6vw; background: var(--azul); color: #fff; }
.cg-cinta:hover { background: #224e76; color: #fff; }

/* ---------- Títulos de sección ---------- */
.cg-titulo { padding: 84px 20px 40px; text-align: center; }
.cg .cg-titulo h2 { font-size: clamp(3.4rem, 8vw, 6.6rem); }
.cg-titulo h2::after { content: ""; display: block; width: 64px; height: 4px; margin: 16px auto 0; background: var(--ambar); }
.cg-titulo p { margin-top: 16px; font-size: 1.12rem; opacity: .75; }

/* ---------- Implementos: sala de exhibición ---------- */
.cg-sala { padding-bottom: 16px; background: var(--noche); }
.cg-exhibicion { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; max-width: 1560px; margin: 0 auto; padding: 0 12px; }
.cg-poster { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 680px; overflow: hidden; border-radius: 6px; background: var(--m); color: var(--t, #fff); cursor: pointer; }
.cg-tatu { grid-column: span 7; --m: #f6c200; --t: #14120a; }
.cg-baldan { grid-column: span 5; --m: #8e1114; }
.cg-minos { grid-column: 1 / -1; min-height: 560px; --m: #0c2210; }
.cg-mfw { grid-column: span 6; --m: #d35400; }
.cg-fullas { grid-column: span 6; --m: #c1121f; }

/* foto real que se funde con el color de la marca */
.cg-foto { position: absolute; z-index: -2; top: 0; left: 0; width: 100%; height: 68%; object-fit: cover; -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent); mask-image: linear-gradient(to bottom, #000 76%, transparent); transition: transform .9s ease; }
.cg-tatu .cg-foto { object-position: 30% 55%; }
.cg-mfw .cg-foto { object-position: 62% center; }
.cg-poster:hover .cg-foto { transform: scale(1.04); }
.cg-poster .cg-fondo { z-index: -2; object-position: 55% center; transition: transform .9s ease; }
.cg-poster:hover .cg-fondo { transform: scale(1.04); }
.cg-minos::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(5,16,7,.9) 0%, rgba(5,16,7,.5) 40%, rgba(5,16,7,0) 66%); }

/* toda la seccion es clicable; los accesos por tipo quedan por encima */
.cg-cubre { position: absolute; inset: 0; z-index: 3; }
.cg-poster .cg-cubre { z-index: 1; }

.cg-ficha { padding: 32px; }
.cg-minos .cg-ficha { max-width: 560px; margin: auto 0; padding: 40px 5vw; }
.cg .cg-ficha h3 { font-size: clamp(2.8rem, 4.8vw, 4.6rem); }
.cg .cg-minos h3 { font-size: clamp(4rem, 9vw, 8rem); }
.cg-ficha p { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }
.cg .cg-ficha p a { position: relative; z-index: 2; padding: 7px 14px; border: 1.5px solid currentColor; border-radius: 4px; color: var(--t, #fff); font-weight: 600; font-size: .92rem; }
.cg .cg-ficha p a:hover { background: var(--t, #fff); border-color: var(--t, #fff); color: var(--m); }
.cg .cg-ficha p span { font-weight: 600; font-size: 1.08rem; }
.cg .cg-ir { display: inline-flex; align-items: center; gap: 14px; color: var(--t, #fff); font-weight: 700; }
.cg-ir::after { content: "\2192"; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--t, #fff); color: var(--m); font-size: 1.3rem; transition: transform .25s; }
.cg-poster:hover .cg-ir::after { transform: translateX(8px); }

/* ---------- Repuestos: columnas de piezas ---------- */
.cg-repuestos { padding: 0 0 64px; background: #e9e7e1; color: var(--noche); }
.cg-columnas { display: flex; max-width: 1560px; margin: 0 auto; border-top: 1px solid rgba(11,21,33,.16); border-bottom: 1px solid rgba(11,21,33,.16); }
.cg-columna { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 28px 18px 40px; overflow: hidden; text-align: center; background: radial-gradient(ellipse 90% 34% at 50% 32%, #fff 0%, rgba(255,255,255,0) 100%); transition: flex-grow .45s cubic-bezier(.2,.7,.2,1), background-color .3s; }
.cg .cg-columna { color: var(--noche); }
.cg-columna + .cg-columna { border-left: 1px solid rgba(11,21,33,.16); }
.cg-columna::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: var(--m); transition: height .45s cubic-bezier(.2,.7,.2,1); }
.cg-columna:hover, .cg-columna:focus-visible { flex-grow: 1.45; background-color: #f6f5f1; }
.cg-columna:hover::after { height: 14px; }
.cg-pieza { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 280px; margin-bottom: 18px; }
.cg-pieza::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 2px; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(11,21,33,.34), rgba(11,21,33,0)); }
.cg-pieza img { position: relative; z-index: 1; width: 100%; height: 240px; object-fit: contain; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.cg-columna:hover .cg-pieza img { transform: translateY(-10px) scale(1.1) rotate(-6deg); }
.cg-columna strong { font-size: clamp(2.1rem, 3.2vw, 3.2rem); font-weight: 800; line-height: 1; }
.cg-detalle { max-width: 210px; margin: 8px 0 20px; color: #4d5a68; line-height: 1.4; }
.cg-columna em { margin-top: auto; padding-bottom: 3px; font-style: normal; font-weight: 700; border-bottom: 3px solid var(--m); }

.cg-pedido { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 16px; padding: 36px 20px 0; }
.cg .cg-pedido p { flex-basis: 100%; text-align: center; color: #4d5a68; }
.cg-pedido p strong { color: var(--noche); }
.cg .cg-pedido a { padding: 12px 22px; border: 2px solid var(--noche); border-radius: 4px; color: var(--noche); font-weight: 700; }
.cg .cg-pedido a:hover { background: var(--noche); color: #fff; }

/* ---------- Ayuda ---------- */
.cg-ayuda { position: relative; padding: 90px 6vw; text-align: center; }
.cg-ayuda::after { content: ""; position: absolute; inset: 0; background: rgba(7,14,22,.8); }
.cg-ayuda div { position: relative; z-index: 2; }
.cg-ayuda h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.cg-ayuda p { margin: 12px 0 24px; font-size: 1.1rem; }
.cg-wa { background: #25d366; color: #062b15; }

.cg a:focus-visible { outline: 3px solid var(--ambar); outline-offset: -3px; }

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
    /* Las tres categorías caben en la primera pantalla */
    .cg-portada { flex-direction: column; height: calc(100vh - 82px); height: calc(100svh - 82px); min-height: 480px; max-height: none; }
    .cg-panel, .cg-panel:hover { flex: 1 1 0; min-height: 0; }
    .cg-panel::after { background: linear-gradient(90deg, rgba(7,14,22,.9) 0%, rgba(7,14,22,.6) 48%, rgba(7,14,22,0) 82%); }
    .cg-panel-texto { top: 0; justify-content: center; padding: 14px 20px; }
    .cg-panel strong { font-size: 2.2rem; }
    .cg-panel-texto > span { max-width: 62%; margin: 4px 0 8px; font-size: .9rem; line-height: 1.35; }
    .cg-panel em { font-size: .9rem; }
    .cg-panel-claro::after { background: linear-gradient(90deg, var(--noche) 0%, var(--noche) 50%, rgba(11,21,33,0) 68%); }
    .cg-piezas { left: auto; width: 40%; top: 6%; height: 88%; padding: 0 8px 0 0; gap: 4px; }

    .cg-barra a { padding: 12px; font-size: .9rem; }

    .cg-hero { flex-direction: column; align-items: stretch; min-height: 0; }
    .cg-hero .cg-fondo { position: static; height: 62vw; }
    .cg-hero::after { display: none; }
    .cg-hero-texto { padding: 24px 20px 36px; }
    .cg-estudio { padding: 40px 16px 44px; }
    .cg-gigante { top: 24px; font-size: 17vw; }
    .cg-cinta { padding: 20px; }

    .cg-titulo { padding: 56px 20px 28px; }
    .cg-exhibicion { gap: 8px; padding: 0 8px; }
    .cg-poster { grid-column: 1 / -1; min-height: 540px; }
    .cg-foto { height: 56%; }
    .cg-ficha { padding: 22px 18px; }
    .cg-ficha p { margin-bottom: 18px; }
    .cg-minos { min-height: 0; }
    .cg-minos .cg-fondo { position: static; height: 68vw; }
    .cg-minos::after { display: none; }
    .cg-minos .cg-ficha { max-width: none; margin: 0; padding: 22px 18px 26px; }

    .cg-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(11,21,33,.16); }
    .cg-columna { padding: 16px 10px 30px; background-color: #e9e7e1; }
    .cg-columna + .cg-columna { border-left: 0; }
    .cg-columna:last-child { grid-column: 1 / -1; }
    .cg-pieza { height: 150px; margin-bottom: 12px; }
    .cg-pieza img { height: 130px; }
    .cg-detalle { margin-bottom: 14px; font-size: .86rem; }
    .cg-columna em { font-size: .9rem; }
    .cg-pedido a { flex: 1 1 100%; text-align: center; }
    .cg-ayuda { padding: 56px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cg *, .cg *::before, .cg *::after { transition: none !important; }
}
