/*
Theme Name: Codimax
Theme URI: https://codimax.com/
Author: Glob Digital
Author URI: https://globdigital.com.pe/
Description: Tema de bloques a medida para CODIMAX Servicios Generales SAC. Reemplaza al tema legacy Second Touch conservando los CPT my-product y timeline, sus taxonomías y meta keys. Incluye migrador del Metro Visual Builder a Gutenberg.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.1
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: codimax
Tags: block-theme, full-site-editing, custom-colors, wide-blocks, editor-style
*/

/* ==========================================================================
   Base
   ========================================================================== */
:root {
	--cdx-primary: var(--wp--preset--color--primary, #30609f);
	--cdx-primary-dark: var(--wp--preset--color--primary-dark, #244a7c);
	--cdx-text: var(--wp--preset--color--text, #4f5559);
	--cdx-muted: var(--wp--preset--color--muted, #8a9399);
	--cdx-light: var(--wp--preset--color--light, #f5f5f5);
	--cdx-border: var(--wp--preset--color--border, #e3e6e8);
	--cdx-container: 1200px;
	--cdx-gutter: 20px;
	--cdx-tile: 115px;
}

*,
*::before,
*::after { box-sizing: border-box; }

body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

img { max-width: 100%; height: auto; }

a { transition: color .15s ease-in-out; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}

:where(.wp-site-blocks) > * { margin-block-start: 0; }

.cdx-main { padding-bottom: 50px; font-size: 16px; }
.cdx-main--flush { padding-bottom: 0; }
.cdx-main > .wp-block-post-content:not(.cdx-builder-content) { padding-top: 40px; }
.cdx-main > .wp-block-post-content:not(.cdx-builder-content) > .cdx-section:first-child { margin-top: -40px !important; }
.cdx-main > .wp-block-post-content:empty { display: none; }
.cdx-main > .cdx-container { padding-top: 40px; }
.cdx-main > .wp-block-post-content:not(:empty) + .cdx-container { padding-top: 0; }

/* Título de sección (widget-title legacy) */
.is-style-widget-title,
h3.widget-title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 25px;
	color: var(--cdx-text);
}
.cdx-section .is-style-widget-title:not(:first-child) { margin-top: 35px; }

/* ==========================================================================
   Header: barra superior
   ========================================================================== */
.cdx-header { padding-top: 13px; position: relative; z-index: 50; }

.cdx-topbar {
	background: var(--cdx-light);
	min-height: 40px;
	padding: 4px 10px;
	font-size: 12px;
	gap: 10px;
}
.cdx-topbar p { margin: 0; }
.cdx-topbar__left { gap: 25px; }
.cdx-topbar__info { padding-left: 10px; }
.cdx-topbar__info a { color: inherit; }
.cdx-topbar__info a:hover { color: var(--cdx-primary); }
.cdx-delim {
	display: inline-block; width: 1px; height: 10px; margin: 0 12px;
	background: #c9cfd3; vertical-align: middle;
}
.cdx-topbar__search { width: 220px; margin: 0; }
.cdx-topbar__search .wp-block-search__inside-wrapper { border: 0; padding: 0; background: #fff; }
.cdx-topbar__search .wp-block-search__input {
	border: 0; height: 28px; padding: 0 10px; font-size: 12px; background: #fff; color: var(--cdx-text);
}
.cdx-topbar__search .wp-block-search__button {
	background: transparent; color: var(--cdx-muted); padding: 0 8px; margin: 0; min-height: 28px;
}
.cdx-topbar__search .wp-block-search__button svg { width: 18px; height: 18px; fill: currentColor; }
.cdx-topbar__social { gap: 10px; font-size: 11px; text-transform: uppercase; color: var(--cdx-muted); }
.cdx-topbar__social .wp-block-social-links { gap: 4px; margin: 0; }
.cdx-topbar__social .wp-social-link { border-radius: 0 !important; }
.cdx-topbar__social .wp-block-social-links.has-small-icon-size { font-size: 14px; }

/* ==========================================================================
   Header: logo + menú en mosaicos
   ========================================================================== */
.cdx-masthead { padding: 0 0 10px; gap: 30px; min-height: 172px; }
.cdx-logo { padding-top: 10px; flex-shrink: 1; }
.cdx-logo img { max-height: 100px; width: auto; }

.cdx-menu { position: relative; }
.cdx-menu__list { list-style: none; margin: 0; padding: 0; }
.cdx-menu--tiles .cdx-menu__list { display: flex; gap: 3px; padding-top: 20px; }
.cdx-menu--tiles .cdx-menu__item.depth-0 { position: relative; width: var(--cdx-tile); }
.cdx-menu--tiles .depth-0 > .cdx-menu__link {
	display: block; text-align: center; color: var(--cdx-text); font-size: 12px; font-weight: 400;
}
.cdx-menu__tile {
	display: flex; align-items: center; justify-content: center;
	width: var(--cdx-tile); height: var(--cdx-tile);
	background: var(--cdx-primary); color: #fff; font-size: 42px;
	transition: transform .2s ease-out, background-color .2s ease-out;
	position: relative; z-index: 1;
}
.cdx-menu--tiles .depth-0 > .cdx-menu__link:hover .cdx-menu__tile,
.cdx-menu--tiles .depth-0 > .cdx-menu__link:focus-visible .cdx-menu__tile { transform: scale(1.05); z-index: 10; }
.cdx-menu--tiles .depth-0.is-current > .cdx-menu__link .cdx-menu__tile { background: var(--cdx-primary-dark); }
.cdx-menu__label { display: block; padding-top: 8px; line-height: 1.3; }
.cdx-menu--tiles .depth-0.has-submenu > .cdx-menu__link .cdx-menu__label::after {
	content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; vertical-align: -1px;
}

.cdx-menu__sub {
	display: none; position: absolute; top: 100%; left: 0; z-index: 999;
	min-width: 200px; margin: 0; padding: 8px 0; list-style: none;
	background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); border-top: 3px solid var(--cdx-primary);
}
.cdx-menu__sub .cdx-menu__sub { top: -11px; left: 100%; }
.cdx-menu__sub .cdx-menu__item { position: relative; }
.cdx-menu__sub .cdx-menu__link { display: block; padding: 7px 18px; font-size: 13px; color: var(--cdx-text); white-space: nowrap; }
.cdx-menu__sub .cdx-menu__link:hover,
.cdx-menu__sub .is-current > .cdx-menu__link { color: var(--cdx-primary); background: var(--cdx-light); }
.cdx-menu__sub .has-submenu > .cdx-menu__link::after { content: "\203A"; float: right; margin-left: 10px; }
.cdx-menu--tiles .cdx-menu__item:hover > .cdx-menu__sub,
.cdx-menu--tiles .cdx-menu__item:focus-within > .cdx-menu__sub,
.cdx-menu--tiles .cdx-menu__item.is-expanded > .cdx-menu__sub { display: block; }

.cdx-menu__toggle {
	display: none; width: 46px; height: 46px; border: 0; background: var(--cdx-primary); cursor: pointer; padding: 0;
}
.cdx-menu__bars,
.cdx-menu__bars::before,
.cdx-menu__bars::after { display: block; width: 22px; height: 2px; background: #fff; margin: 0 auto; position: relative; transition: transform .2s; }
.cdx-menu__bars::before,
.cdx-menu__bars::after { content: ""; position: absolute; left: 0; }
.cdx-menu__bars::before { top: -7px; }
.cdx-menu__bars::after { top: 7px; }
.cdx-menu.is-open .cdx-menu__bars { background: transparent; }
.cdx-menu.is-open .cdx-menu__bars::before { transform: translateY(7px) rotate(45deg); }
.cdx-menu.is-open .cdx-menu__bars::after { transform: translateY(-7px) rotate(-45deg); }

/* Menú inline (pie) */
.cdx-menu--inline .cdx-menu__list { display: flex; flex-wrap: wrap; gap: 0 15px; }
.cdx-menu--inline .cdx-menu__link { color: inherit; font-size: 12px; }
.cdx-menu--inline .cdx-menu__link:hover,
.cdx-menu--inline .is-current > .cdx-menu__link { color: #fff; text-decoration: underline; }

/* ==========================================================================
   Cabecera de página (stunning header)
   ========================================================================== */
.cdx-page-header {
	background-color: var(--cdx-header-bg, #30609f);
	background-image: var(--cdx-header-img, none);
	background-position: center;
	background-size: cover;
	color: var(--cdx-header-color, #fff);
	margin: 0;
}
.cdx-page-header.is-fixed-bg { background-attachment: fixed; background-position: center -10%; }
.cdx-page-header__inner {
	max-width: calc(var(--cdx-container) + 2 * var(--cdx-gutter)); margin: 0 auto; padding: 0 var(--cdx-gutter);
	display: flex; align-items: center; min-height: 140px;
}
.cdx-page-header__title {
	font-size: 23px; font-weight: 300; line-height: 1.2; margin: 0; color: inherit;
	padding: 35px 35px 35px 0;
}
.cdx-page-header__subtitle {
	font-size: 23px; font-weight: 300; padding: 35px;
	box-shadow: -1px 0 0 rgba(255, 255, 255, .3);
}
@supports (-webkit-touch-callout: none) {
	.cdx-page-header.is-fixed-bg { background-attachment: scroll; }
}

/* ==========================================================================
   Secciones migradas del builder
   ========================================================================== */
.cdx-section { margin-block: 0 !important; }
.cdx-section.cdx-pad-medium { padding-top: 40px; padding-bottom: 40px; }
.cdx-section.cdx-pad-small { padding-top: 20px; padding-bottom: 20px; }
.cdx-section.cdx-pad-large,
.cdx-section.cdx-pad-big { padding-top: 70px; padding-bottom: 70px; }
.cdx-section.cdx-pad-no { padding-top: 0; padding-bottom: 0; }
.cdx-section:not([class*="cdx-pad-"]) { padding-top: 30px; padding-bottom: 30px; }
.cdx-section--flush { padding: 0 !important; }
.cdx-section--flush > .wp-block-shortcode,
.cdx-section--flush > p { margin: 0; }
.cdx-section:has(> .is-style-promo-row) { background: var(--cdx-light); }
.cdx-section.has-background > .is-style-promo-row { background: transparent; }
.cdx-section.wp-block-cover { min-height: 0; padding-left: var(--cdx-gutter); padding-right: var(--cdx-gutter); }
.cdx-section.wp-block-cover .wp-block-cover__inner-container { color: inherit; width: 100%; }

/* Fila promocional */
.is-style-promo-row { background: var(--cdx-light); padding: 30px var(--cdx-gutter); }
.cdx-section > .is-style-promo-row { padding-left: 0; padding-right: 0; }
.is-style-promo-row p { margin: 0; font-size: 14px; line-height: 1.8; }

/* Cajas de presentación */
.cdx-features { gap: 30px; }
.is-style-feature-box { text-align: center; }
.is-style-feature-box > * { margin-block: 0 !important; }
.cdx-tile-link { display: inline-block; }
.cdx-icon-tile { text-align: center; }
.cdx-features--icon .cdx-icon-tile,
.cdx-features--vertical .cdx-icon-tile { text-align: left; }
.cdx-tile {
	position: relative; display: flex; align-items: center; justify-content: center;
	width: 134px; height: 134px; margin: 0 auto 20px;
	background-color: var(--cdx-primary); background-position: center; background-repeat: no-repeat; background-size: cover;
	color: #fff; font-size: 48px; overflow: hidden;
}
.cdx-tile i { position: relative; z-index: 1; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .25s; }
.cdx-tile::after {
	content: ""; position: absolute; inset: 0; background: var(--cdx-primary); opacity: 0; transition: opacity .25s;
}
.cdx-tile-link:hover .cdx-tile::after,
.cdx-tile-link:focus-visible .cdx-tile::after { opacity: 1; }
.cdx-tile-link:hover .cdx-tile i,
.cdx-tile-link:focus-visible .cdx-tile i { opacity: 1; transform: scale(1); }
.cdx-tile:not([style*="background-image"]) i { opacity: 1; transform: none; }
.cdx-feature-title { font-size: 18px; font-weight: 600; margin-bottom: 6px !important; }
.cdx-feature-title a { color: var(--cdx-text); }
.cdx-feature-title a:hover { color: var(--cdx-primary); }
.cdx-subtitle { color: var(--cdx-muted); font-size: 15px; margin-bottom: 10px !important; }
.cdx-read-more { margin-top: 10px !important; font-size: 15px; }
.cdx-read-more a { font-weight: 600; }
.cdx-read-more a::after { content: " \203A"; }

.cdx-features--icon .is-style-feature-box,
.cdx-features--vertical .is-style-feature-box { text-align: left; }
.cdx-features--vertical .cdx-tile,
.cdx-features--icon .cdx-tile { width: auto; height: auto; background: none !important; color: var(--cdx-primary); font-size: 45px; margin: 0 0 12px; justify-content: flex-start; }
.cdx-features--icon .cdx-tile i,
.cdx-features--vertical .cdx-tile i { opacity: 1; transform: none; }
.cdx-features--icon .cdx-tile::after,
.cdx-features--vertical .cdx-tile::after { display: none; }

/* Presentación vertical: icono a la izquierda, contenido a la derecha, cajas apiladas. */
.cdx-features--vertical { display: flex; flex-direction: column; gap: 30px; }
.cdx-features--vertical > .is-style-feature-box {
	display: grid; grid-template-columns: 70px minmax(0, 1fr); column-gap: 20px; align-items: start;
}
.cdx-features--vertical > .is-style-feature-box > .cdx-icon-tile { grid-row: 1 / span 10; }
.cdx-features--vertical > .is-style-feature-box > :not(.cdx-icon-tile) { grid-column: 2; }
.cdx-features--vertical .cdx-tile { margin: 0; font-size: 50px; }
.cdx-features--vertical .cdx-feature-title { font-size: 20px; margin: 0 0 8px !important; }
.cdx-features--vertical p { margin: 0 0 8px; }

/* ==========================================================================
   Grilla de productos
   ========================================================================== */
.cdx-products { margin-top: 30px; }
.cdx-filter {
	display: flex; flex-wrap: wrap; gap: 6px 25px; list-style: none; margin: 0 0 30px; padding: 0;
}
.cdx-filter button {
	position: relative; border: 0; background: none; padding: 0 0 10px; cursor: pointer;
	font: inherit; font-size: 15px; color: var(--cdx-text);
}
.cdx-filter button::after {
	content: ""; position: absolute; left: 0; bottom: 0; width: 24px; height: 0; opacity: 0;
	background: var(--cdx-primary); transition: all .2s ease-in-out;
}
.cdx-filter button:hover::after,
.cdx-filter .is-active button::after { height: 3px; opacity: 1; }
.cdx-filter .is-active button { color: var(--cdx-primary); }

.cdx-products__grid {
	display: grid; grid-template-columns: repeat(var(--cdx-cols, 4), minmax(0, 1fr)); gap: 30px 20px;
}
.cdx-cols-1 { --cdx-cols: 1; }
.cdx-cols-2 { --cdx-cols: 2; }
.cdx-cols-3 { --cdx-cols: 3; }
.cdx-cols-4 { --cdx-cols: 4; }
.cdx-cols-5 { --cdx-cols: 5; }
.cdx-cols-6 { --cdx-cols: 6; }
.cdx-product[hidden] { display: none; }

.cdx-product__thumb { position: relative; overflow: hidden; background: #fff; }
.cdx-product__thumb img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; transition: transform .3s; }
.cdx-products--related .cdx-product__thumb img { aspect-ratio: 293 / 204; object-fit: cover; }
.cdx-product__noimg { display: block; aspect-ratio: 1 / 1; background: var(--cdx-light); }
.cdx-products.is-round .cdx-product__thumb { border-radius: 50%; }

.cdx-hover {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px;
	background: rgba(48, 96, 159, .75); opacity: 0; transition: opacity .25s;
}
.cdx-product__thumb:hover .cdx-hover,
.cdx-product__thumb:focus-within .cdx-hover { opacity: 1; }
.cdx-hover a {
	display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
	background: #fff; color: var(--cdx-primary); font-family: "moon"; font-size: 20px;
}
.cdx-hover a:hover { background: var(--cdx-primary-dark); color: #fff; }
.cdx-hover__more::before { content: "\e2cd"; display: inline-block; transform: rotate(90deg); }
.cdx-hover__zoom::before { content: "\e1ba"; }

.cdx-product__title { font-size: 16px; font-weight: 600; margin: 12px 0 2px; line-height: 1.35; }
.cdx-product__title a { color: var(--cdx-text); }
.cdx-product__title a:hover { color: var(--cdx-primary); }
.cdx-product__title a::first-letter { color: var(--cdx-primary); }
.cdx-product__meta { font-size: 13px; text-transform: uppercase; color: var(--cdx-muted); }
.cdx-product__meta a { color: inherit; }
.cdx-product__meta a:hover { color: var(--cdx-primary); }
.cdx-product__tags::before { content: ""; display: inline-block; width: 1px; height: 8px; background: currentColor; margin: 0 8px; opacity: .5; }

.cdx-pagination { margin-top: 40px; }
.cdx-pagination ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; }
.cdx-pagination a,
.cdx-pagination span {
	display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center;
	background: var(--cdx-light); color: var(--cdx-text); font-size: 15px; padding: 0 8px;
}
.cdx-pagination a:hover,
.cdx-pagination .current { background: var(--cdx-primary); color: #fff; }

/* ==========================================================================
   Ficha de producto
   ========================================================================== */
.cdx-product-title { font-size: 20px; font-weight: 600; margin-top: 0 !important; margin-bottom: 25px !important; }
.cdx-product-single { gap: 40px; }
.cdx-product-info { font-size: 15px; }
.cdx-product-info .wp-block-post-content > * { margin-block: 0 12px; }
.cdx-product-info ul { list-style: none; padding: 0; }
.cdx-product-info ul li { position: relative; padding-left: 26px; margin-bottom: 4px; text-transform: none; }
.cdx-product-info ul li::before {
	content: ""; position: absolute; left: 0; top: .75em; width: 14px; height: 2px; background: var(--wp--preset--color--accent, #cc0a0a);
}
.cdx-product-meta {
	gap: 10px; background: var(--cdx-light); padding: 0 15px 0 0; font-size: 13px; color: var(--cdx-muted);
}
.cdx-product-meta::before {
	content: "\e61d"; font-family: "fontello"; display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; background: var(--cdx-primary); color: #fff; font-size: 18px;
}
.cdx-product-meta .wp-block-post-date,
.cdx-product-meta .wp-block-post-terms { margin: 0; }
.cdx-product-tags { font-size: 13px; color: var(--cdx-muted); }

.cdx-gallery { margin: 0; }
.cdx-gallery__stage { position: relative; }
.cdx-gallery__slide { margin: 0; text-align: center; }
.cdx-gallery__slide img,
.cdx-gallery--single img { max-height: 600px; width: auto; margin: 0 auto; display: block; }
.cdx-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.cdx-gallery__thumbs button { padding: 0; border: 2px solid transparent; background: none; cursor: pointer; opacity: .6; transition: opacity .2s; }
.cdx-gallery__thumbs button[aria-pressed="true"],
.cdx-gallery__thumbs button:hover { opacity: 1; border-color: var(--cdx-primary); }
.cdx-gallery__thumbs img { display: block; width: 63px; height: 63px; object-fit: cover; }

.cdx-product-nav {
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px;
	margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--cdx-border); font-size: 15px;
}
.cdx-product-nav__label { display: block; font-size: 13px; text-transform: uppercase; color: var(--cdx-muted); }
.cdx-product-nav__next { text-align: right; }
.cdx-product-nav__all {
	display: block; width: 36px; height: 36px; background: var(--cdx-primary);
	-webkit-mask: radial-gradient(circle, #000 3px, transparent 3.5px) 0 0 / 12px 12px;
	mask: radial-gradient(circle, #000 3px, transparent 3.5px) 0 0 / 12px 12px;
}

.cdx-likes { margin-top: 20px; border-top: 1px solid var(--cdx-border); padding-top: 12px; }
.cdx-likes__btn {
	display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer;
	color: var(--cdx-muted); font: inherit; font-size: 15px; padding: 4px 0;
}
.cdx-likes__icon::before { content: "\2665"; font-size: 18px; line-height: 1; }
.cdx-likes__btn:hover,
.cdx-likes__btn.is-voted { color: var(--wp--preset--color--accent, #cc0a0a); }
.cdx-likes__btn:disabled { cursor: default; }

.cdx-products--related { margin-top: 60px; }

/* ==========================================================================
   Línea de tiempo
   ========================================================================== */
.cdx-timeline__list { list-style: none; margin: 0; padding: 0; position: relative; }
.cdx-timeline__list::before {
	content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--cdx-border); transform: translateX(-50%);
}
.cdx-timeline__item { position: relative; width: 50%; padding: 0 40px 40px 0; }
.cdx-timeline__item.is-even { margin-left: 50%; padding: 0 0 40px 40px; }
.cdx-timeline__item::before {
	content: ""; position: absolute; top: 6px; right: -7px; width: 12px; height: 12px; border-radius: 50%;
	background: var(--cdx-primary); box-shadow: 0 0 0 4px #fff;
}
.cdx-timeline__item.is-even::before { right: auto; left: -5px; }
.cdx-timeline__title { position: relative; display: inline-block; font-size: 18px; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; }
.cdx-timeline__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 24px; height: 3px; background: var(--cdx-primary); }
.cdx-timeline__img { display: block; margin-bottom: 10px; }

/* ==========================================================================
   Pie
   ========================================================================== */
.cdx-footer {
	background: var(--wp--preset--color--footer, #464d51);
	color: var(--wp--preset--color--footer-text, #a7b2b9);
	padding-top: 50px; padding-bottom: 30px; margin-top: 0;
}
.cdx-footer-part { margin-top: 0; }
.cdx-footer a { color: #fff; }
.cdx-footer .is-style-widget-title { color: #9facb3; font-size: 18px; margin-bottom: 20px; }
.cdx-footer .is-style-widget-title:not(:first-child) { margin-top: 25px; }
.cdx-footer__cols { gap: 40px; }
.cdx-footer__contact { font-size: 12px; line-height: 1.7; }
.cdx-footer p { margin: 0 0 10px; }
.cdx-footer .wp-block-image { margin: 0 0 20px; }
.cdx-partners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cdx-partners img { display: block; width: 100%; height: auto; background: #fff; }
.cdx-cards img { height: 24px; width: auto; margin-right: 6px; vertical-align: middle; }
.cdx-map { display: block; border: 0; }

.cdx-subfooter {
	background: var(--wp--preset--color--subfooter, #32373a); color: #fff; font-size: 12px;
	padding-top: 20px; padding-bottom: 20px; margin-top: 0 !important;
}
.cdx-subfooter p { margin: 0; }
.cdx-subfooter a { color: #fff; }
.cdx-copy__mark { vertical-align: middle; margin-right: 4px; max-height: 18px; width: auto; }

.cdx-backtotop {
	position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 40px; height: 40px;
	background: var(--cdx-primary); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.cdx-backtotop::before {
	content: ""; position: absolute; left: 50%; top: 55%; width: 12px; height: 12px;
	border-left: 2px solid #fff; border-top: 2px solid #fff; transform: translate(-50%, -50%) rotate(45deg);
}
.cdx-backtotop.is-visible { opacity: .85; pointer-events: auto; }
.cdx-backtotop:hover { opacity: 1; }

/* Lightbox */
.cdx-lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.cdx-lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.cdx-lightbox img { display: block; max-width: 92vw; max-height: 88vh; width: auto; height: auto; }
.cdx-lightbox__close {
	position: absolute; top: 0; right: 0; width: 40px; height: 40px; border: 0; cursor: pointer;
	background: var(--cdx-primary); color: #fff; font-size: 26px; line-height: 1;
}

/* Blog / entradas */
.cdx-entry-meta { font-size: 14px; color: var(--cdx-muted); }
.cdx-posts { margin-top: 40px; }

/* Plugins conservados */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%; border: 1px solid var(--cdx-border); padding: 8px 10px; font: inherit; background: #fff;
}
.wpcf7 input[type="submit"] {
	background: var(--cdx-primary); color: #fff; border: 0; padding: 10px 24px; font: inherit; font-weight: 600; cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--cdx-primary-dark); }
.ls-wp-fullwidth-container { margin: 0 !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	:root { --cdx-tile: 96px; }
	.cdx-menu__tile { font-size: 34px; }
}

@media (max-width: 900px) {
	.cdx-masthead { min-height: 0; padding: 15px 0; }
	.cdx-logo img { max-height: 70px; max-width: 60vw; object-fit: contain; }
	.cdx-logo { max-width: 60vw; }
	.cdx-masthead { position: relative; }
	.cdx-menu--tiles { position: static; }
	.cdx-menu__toggle { display: block; }
	.cdx-menu--tiles .cdx-menu__list {
		display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 999;
		width: auto; flex-direction: column; gap: 0; padding: 0;
		background: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .15);
	}
	.cdx-menu--tiles.is-open .cdx-menu__list { display: flex; }
	.cdx-menu--tiles .cdx-menu__item.depth-0 { width: auto; border-bottom: 1px solid var(--cdx-border); }
	.cdx-menu--tiles .depth-0 > .cdx-menu__link { display: flex; align-items: center; gap: 12px; text-align: left; font-size: 14px; padding: 6px; }
	.cdx-menu__tile { width: 40px; height: 40px; font-size: 18px; }
	.cdx-menu__label { padding-top: 0; }
	.cdx-menu__sub,
	.cdx-menu__sub .cdx-menu__sub { position: static; box-shadow: none; border-top: 0; padding: 0 0 6px 52px; min-width: 0; }
	.cdx-menu--tiles .cdx-menu__item:hover > .cdx-menu__sub { display: none; }
	.cdx-menu--tiles .cdx-menu__item.is-expanded > .cdx-menu__sub { display: block; }

	.cdx-topbar__search { width: 160px; }
	.cdx-products__grid { --cdx-cols: 2 !important; }
	.cdx-page-header.is-fixed-bg { background-attachment: scroll; }
	.cdx-page-header__inner { flex-wrap: wrap; min-height: 100px; }
	.cdx-page-header__title { padding: 25px 25px 25px 0; }
	.cdx-page-header__subtitle { padding: 25px; font-size: 18px; }
}

@media (max-width: 781px) {
	.cdx-features.wp-block-columns { flex-wrap: wrap !important; gap: 30px 20px; }
	.cdx-features.wp-block-columns > .wp-block-column { flex-basis: calc(50% - 10px) !important; flex-grow: 0; }
	.cdx-timeline__list::before { left: 6px; }
	.cdx-timeline__item,
	.cdx-timeline__item.is-even { width: 100%; margin-left: 0; padding: 0 0 30px 30px; }
	.cdx-timeline__item::before,
	.cdx-timeline__item.is-even::before { left: 1px; right: auto; }
	.cdx-subfooter .wp-block-group { justify-content: center; text-align: center; }
}

@media (max-width: 600px) {
	.cdx-topbar { justify-content: center; }
	.cdx-topbar__left { justify-content: center; gap: 8px; }
	.cdx-topbar__social { display: none !important; }
	.cdx-products__grid { --cdx-cols: 1 !important; }
	.cdx-products.cdx-cols-4 .cdx-products__grid,
	.cdx-products.cdx-cols-3 .cdx-products__grid { --cdx-cols: 2 !important; gap: 20px 12px; }
	.cdx-partners { grid-template-columns: repeat(3, 1fr); }
	.cdx-product-nav { grid-template-columns: 1fr 1fr; }
	.cdx-product-nav__all { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after { transition: none !important; animation: none !important; }
}

/* Mapa */
.cdx-map-block { margin: 0; }
.cdx-map-placeholder { display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); color: inherit; font-size: 13px; border: 1px dashed currentColor; }

/* ==========================================================================
   Entradas (plantillas tmp-posts-*) y barra lateral
   ========================================================================== */
.cdx-with-sidebar { gap: 40px; }
.cdx-post-grid__list { display: grid; grid-template-columns: repeat(var(--cdx-cols, 2), minmax(0, 1fr)); gap: 30px; }
.cdx-post-card { display: flex; flex-direction: column; }
.cdx-post-card__thumb { display: block; overflow: hidden; margin-bottom: 15px; }
.cdx-post-card__thumb img { display: block; width: 100%; aspect-ratio: 407 / 270; object-fit: cover; transition: transform .3s; }
.cdx-post-card__thumb:hover img { transform: scale(1.04); }
.cdx-post-card__head { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 10px; }
.cdx-post-card__date { flex: 0 0 58px; text-align: center; background: var(--cdx-light); padding: 6px 4px; line-height: 1.1; }
.cdx-post-card__day { display: block; font-size: 26px; font-weight: 300; color: var(--cdx-primary); }
.cdx-post-card__month { display: block; font-size: 12px; text-transform: uppercase; color: var(--cdx-muted); }
.cdx-post-card__title { font-size: 18px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.cdx-post-card__title a { color: var(--cdx-text); }
.cdx-post-card__title a:hover { color: var(--cdx-primary); }
.cdx-post-card__meta { font-size: 13px; color: var(--cdx-muted); }
.cdx-post-card__meta a { color: inherit; }
.cdx-post-card__meta a:hover { color: var(--cdx-primary); }
.cdx-post-card__excerpt { margin: 0; font-size: 15px; }

.cdx-sidebar .widget { margin-bottom: 30px; }
.cdx-sidebar .widget-title { font-size: 20px; font-weight: 600; margin: 0 0 15px; color: var(--cdx-text); }
.cdx-sidebar .searchform,
.cdx-sidebar .search-form,
.cdx-sidebar .wp-block-search__inside-wrapper { display: flex; }
.cdx-sidebar input[type="text"],
.cdx-sidebar input[type="search"],
.cdx-sidebar input[type="email"],
.cdx-sidebar textarea { width: 100%; border: 1px solid var(--cdx-border); padding: 8px 10px; font: inherit; font-size: 15px; background: #fff; }
.cdx-sidebar input[type="submit"],
.cdx-sidebar button { background: var(--cdx-primary); color: #fff; border: 0; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.cdx-sidebar input[type="submit"]:hover,
.cdx-sidebar button:hover { background: var(--cdx-primary-dark); }
.cdx-sidebar .searchform input[type="submit"] { flex-shrink: 0; }
.cdx-sidebar .wpcf7 p { margin: 0 0 12px; }

@media (max-width: 781px) {
	.cdx-post-grid__list { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Página de contacto
   ========================================================================== */
.cdx-main--contact > .cdx-contact-map { margin: 0; }
.cdx-main--contact > .cdx-contact-map .cdx-map { display: block; }
.cdx-contact-cols { gap: 40px; }
.cdx-contact-text .wp-block-post-content > .cdx-section { padding: 0 !important; margin: 0 !important; background: none !important; }
.cdx-contact-text .wp-block-post-content > .cdx-section > * { max-width: none; }
.cdx-contact-social { margin-top: 20px; }
.cdx-contact__form p { margin: 0 0 14px; }
.cdx-contact__form label { display: block; margin-bottom: 4px; font-size: 15px; }
.cdx-contact__form input[type="text"],
.cdx-contact__form input[type="email"],
.cdx-contact__form textarea { width: 100%; border: 1px solid var(--cdx-border); padding: 9px 12px; font: inherit; background: #fff; color: var(--cdx-text); }
.cdx-contact__form input:focus,
.cdx-contact__form textarea:focus { outline: 2px solid var(--cdx-primary); outline-offset: -1px; }
.cdx-contact__antispam input { max-width: 200px; }
.cdx-contact__submit { border: 0; cursor: pointer; }
.cdx-contact__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cdx-contact__notice { padding: 12px 15px; margin: 0 0 20px; border-left: 4px solid; }
.cdx-contact__notice.is-success { background: #edf7ee; border-color: #2e7d32; color: #1b5e20; }
.cdx-contact__notice.is-error { background: #fdecea; border-color: #c62828; color: #8e1c1c; }
