/*
Theme Name: Imprenta Total
Theme URI: https://imprentatotal.es
Description: Tema hijo de Twenty Twenty-Five con el diseño de Imprenta Total (personalización textil, merchandising e imprenta).
Author: Imprenta Total
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.0
Text Domain: imprenta-total
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
[id] { scroll-margin-top: 10rem; }

/* ---------- Cabecera ---------- */
.it-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(220, 216, 214, 0.85);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(188, 183, 179, 0.5);
}
body.admin-bar .it-header { top: var(--wp-admin--admin-bar--height, 0); }
.it-header .wp-block-site-logo img { height: 6rem; width: auto; object-fit: contain; }
.it-phone a { color: var(--wp--preset--color--contrast); }
.it-phone a:hover { color: var(--wp--preset--color--primary); }
.it-phone a::before {
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-right: 0.35em;
	background: var(--wp--preset--color--primary);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.it-search .wp-block-search__inside-wrapper {
	border: 1px solid rgba(188, 183, 179, 0.6);
	border-radius: 9999px;
	background: #fff;
	padding: 0.25rem 0.5rem 0.25rem 1rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.it-search .wp-block-search__input { border: 0; background: transparent; font-size: 0.875rem; min-width: 12rem; }
.it-search .wp-block-search__button { background: transparent; color: var(--wp--preset--color--muted-foreground); padding: 0.25rem; margin: 0; }
.it-header .wp-block-navigation-item__content:hover,
.it-header .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--primary); }
@media (max-width: 781px) {
	.it-search { display: none; }
	.it-header .wp-block-site-logo img { height: 4rem; }
}

/* ---------- Utilidades ---------- */
.it-eyebrow {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.3em;
	font-weight: 700;
	font-size: 0.875rem;
}
.it-kicker {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-size: 0.875rem;
	color: var(--wp--preset--color--primary);
}
.it-text-gradient {
	background-image: linear-gradient(to right, #79A31F, #B9E755, #EE2BAD);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-shadow: none;
	filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
}
.it-glow { box-shadow: 0 0 24px -4px rgba(137, 184, 35, 0.4); }
.it-industrial-line { height: 1px; background: linear-gradient(to right, transparent, var(--wp--preset--color--primary), transparent); border: 0; opacity: 0.5; }

/* ---------- Portada (hero) ---------- */
.it-hero { min-height: 85vh; }
.it-hero h1, .it-hero p { text-shadow: 0 1px 6px rgba(255, 255, 255, 0.6); }
.it-hero h1 .it-text-gradient { text-shadow: none; }
.it-hero .wp-block-cover__background {
	background: linear-gradient(to top, #DCD8D6 0%, rgba(220, 216, 214, 0.3) 50%, rgba(220, 216, 214, 0.1) 100%) !important;
	opacity: 1 !important;
}
.it-hero .wp-block-cover__inner-container { width: 100%; max-width: 1400px; margin-inline: auto; }
.it-hero .it-hero__content { padding-inline: clamp(0rem, 5vw, 4rem); }
.it-carousel-wrap > .it-carousel { max-width: none; }

/* ---------- Tarjetas de servicio ---------- */
.it-card {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.5rem;
	background: var(--wp--preset--color--base);
	transition: border-color 0.3s, box-shadow 0.3s;
	display: flex;
	flex-direction: column;
}
.it-card.is-featured { border-color: rgba(121, 163, 31, 0.4); }
.it-card:hover { border-color: var(--wp--preset--color--primary); box-shadow: 0 0 24px -4px rgba(137, 184, 35, 0.4); }
.it-card .it-card__media { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.it-card .it-card__media img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); transition: transform 0.5s; }
.it-card:hover .it-card__media img { transform: scale(1.05); }
.it-card .it-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, #DCD8D6, rgba(220, 216, 214, 0.4), transparent);
	pointer-events: none;
}
.it-card.is-featured .it-card__media::after { background: linear-gradient(to top, #DCD8D6, rgba(220, 216, 214, 0.6), rgba(121, 163, 31, 0.1)); }
.it-card__badge {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	margin: 0 !important;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	background: rgba(121, 163, 31, 0.2);
	border: 1px solid rgba(121, 163, 31, 0.4);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.it-card__body { position: relative; z-index: 1; margin-top: -4rem !important; padding: 1.5rem; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.it-card__body h3 { transition: color 0.3s; }
.it-card:hover .it-card__body h3 { color: var(--wp--preset--color--primary); }
.it-card__body h3 a { color: inherit; }
/* Toda la tarjeta clicable: el enlace del título se estira hacia arriba y la tarjeta (overflow:hidden) lo recorta */
.it-card__body h3 a::after { content: ""; position: absolute; inset: -100rem 0 0 0; z-index: 3; }
.it-card__more {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.875rem;
	color: var(--wp--preset--color--primary);
}
.it-card__more::after { content: " →"; transition: margin 0.3s; }
.it-card:hover .it-card__more::after { margin-left: 0.25rem; }

/* ---------- Carrusel de catálogo ---------- */
.it-carousel {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 1rem;
	scrollbar-width: none;
}
.it-carousel::-webkit-scrollbar { display: none; }
.it-carousel > * { flex: 0 0 14rem; scroll-snap-align: start; margin: 0 !important; }
@media (max-width: 781px) { .it-carousel > * { flex-basis: 12rem; } }
.it-tile { position: relative; aspect-ratio: 3 / 4; border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--wp--preset--color--border); }
.it-tile figure { margin: 0; height: 100%; }
.it-tile img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); transition: transform 0.5s; }
.it-tile:hover img { transform: scale(1.05); }
.it-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(220, 216, 214, 0.8), transparent 50%); pointer-events: none; }
.it-tile h3 { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0; padding: 0.75rem; font-size: 1rem; }
.it-tile h3 a { color: var(--wp--preset--color--contrast); }
.it-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.it-carousel-wrap { position: relative; }
.it-carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 2.5rem; height: 2.5rem; border-radius: 9999px; background: rgba(220, 216, 214, 0.8); border: 1px solid var(--wp--preset--color--border); cursor: pointer; display: grid; place-items: center; font-size: 1.25rem; color: var(--wp--preset--color--contrast); }
.it-carousel-nav.prev { left: -0.5rem; }
.it-carousel-nav.next { right: -0.5rem; }

/* ---------- Logos de clientes ---------- */
.it-logos img { height: 5rem; width: auto; max-width: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.5; transition: all 0.5s; }
.it-logos img:hover { filter: none; opacity: 1; transform: scale(1.1); }
@media (max-width: 781px) { .it-logos img { height: 3.5rem; } }

/* ---------- Pie ---------- */
.it-footer a { color: var(--wp--preset--color--muted-foreground); }
.it-footer a:hover { color: var(--wp--preset--color--primary); }
.it-footer ul { list-style: none; padding: 0; margin: 0; }
.it-footer li + li { margin-top: 0.75rem; }

/* ---------- WhatsApp flotante ---------- */
.it-whatsapp {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	z-index: 60;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 9999px;
	background: #25D366;
	color: #fff;
	display: grid;
	place-items: center;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s;
}
.it-whatsapp:hover { transform: scale(1.1); color: #fff; }
.it-whatsapp svg { width: 1.75rem; height: 1.75rem; fill: currentColor; }
.it-whatsapp::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #25D366; opacity: 0.4; animation: it-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; z-index: -1; }
@keyframes it-ping { 75%, 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .it-whatsapp::before { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Cabeceras de página ---------- */
.it-page-head { margin-bottom: 2.5rem; }
.it-page-head h1 { line-height: 1.1; }
.it-industrial-line--short { max-width: 20rem !important; margin-inline: auto !important; }
.it-section-label {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.it-section-label::before, .it-section-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--wp--preset--color--primary), transparent); opacity: 0.5; }

/* ---------- Menú lateral de catálogo ---------- */
.it-catalog-col { position: relative; }
.it-catalog {
	position: sticky;
	top: 11rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.75rem;
	background: rgba(207, 203, 201, 0.8);
	overflow: hidden;
	max-height: calc(100vh - 13rem);
	overflow-y: auto;
}
.it-catalog > * { margin: 0 !important; }
.it-catalog__title {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.it-catalog__group summary {
	padding: 0.6rem 1rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	list-style-position: outside;
}
.it-catalog__group summary:hover { background: rgba(201, 198, 196, 0.5); }
.it-catalog__group summary a { color: var(--wp--preset--color--contrast); }
.it-catalog__group summary a:hover, .it-catalog__group.is-current summary a { color: var(--wp--preset--color--primary); }
.it-catalog__list { list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.875rem; }
.it-catalog__list li { margin: 0; }
.it-catalog__list a { display: block; padding: 0.35rem 1rem 0.35rem 2.25rem; color: var(--wp--preset--color--muted-foreground); }
.it-catalog__list a:hover { color: var(--wp--preset--color--contrast); background: rgba(201, 198, 196, 0.3); }
.it-catalog__list a[aria-current="page"] { color: var(--wp--preset--color--primary); font-weight: 600; border-left: 2px solid var(--wp--preset--color--primary); }
@media (max-width: 1023px) {
	.it-catalog-layout .wp-block-columns { flex-wrap: wrap !important; }
	.it-catalog-col { flex-basis: 100% !important; }
	.it-catalog { position: static; max-height: none; }
}

/* ---------- Cuadrícula de secciones ---------- */
.it-tile.is-square { aspect-ratio: 1 / 1; border-radius: 0.75rem; transition: border-color 0.3s, box-shadow 0.3s; }
.it-tile.is-square:hover { border-color: rgba(121, 163, 31, 0.5); box-shadow: 0 0 24px -4px rgba(137, 184, 35, 0.4); }
.it-tile.is-square h3 { padding: 1rem; font-size: 1.25rem; }
@media (max-width: 600px) { .it-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .it-tile.is-square h3 { font-size: 1rem; } }

/* ---------- Ficha de producto ---------- */
.it-product-grid { align-items: start; margin-bottom: 4rem; }
.it-product-main { aspect-ratio: 4 / 3; border-radius: 0.75rem; overflow: hidden; border: 1px solid var(--wp--preset--color--border); margin: 0; }
.it-product-main img { width: 100%; height: 100%; object-fit: cover; }
.it-thumbs { gap: 0.75rem !important; margin-top: 1rem !important; }
.it-thumbs figure { margin: 0; width: 5rem; height: 5rem; border-radius: 0.5rem; overflow: hidden; border: 2px solid var(--wp--preset--color--border); cursor: pointer; transition: border-color 0.3s; }
.it-thumbs figure.is-active, .it-thumbs figure:hover { border-color: var(--wp--preset--color--primary); }
.it-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.it-quote-card {
	position: sticky;
	top: 11rem;
	padding: clamp(1.5rem, 3vw, 2rem);
	border-radius: 0.75rem;
	border: 1px solid rgba(121, 163, 31, 0.3);
	background: var(--wp--preset--color--card);
	box-shadow: 0 0 24px -4px rgba(137, 184, 35, 0.4);
}
.it-quote-card > * + * { margin-top: 0.5rem; }
.it-form-slot { padding: 1rem; border: 1px dashed var(--wp--preset--color--border); border-radius: 0.5rem; }
.it-tech { padding: 1.25rem; border-radius: 0.75rem; border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--card); transition: border-color 0.3s; }
.it-tech:hover { border-color: rgba(121, 163, 31, 0.5); }
.it-tech h3 { text-transform: none; margin-bottom: 0.25rem; }
.it-tech > * { margin: 0; }
.it-techniques { margin-bottom: 4rem; }
@media (max-width: 781px) { .it-quote-card { position: static; } }

/* ---------- Sobre nosotros ---------- */
.it-stats { margin-block: 2.5rem 3.5rem !important; }
.it-stat { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem; border-radius: 0.75rem; border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--base); }
.it-stat > * { margin: 0; }
.it-stat__value { font-family: var(--wp--preset--font-family--display); font-size: 1.25rem; font-weight: 700; }
.it-prose { color: var(--wp--preset--color--muted-foreground); font-size: 1.0625rem; line-height: 1.75; }
.it-prose strong { color: var(--wp--preset--color--contrast); }
.it-prose h2 { margin-top: 3.5rem; font-size: 1.875rem; }
.it-prose h3 { margin-top: 1.5rem; font-size: 1.25rem; font-weight: 600; text-transform: none; }
.it-callout { color: var(--wp--preset--color--contrast); font-style: italic; font-weight: 500; border-left: 2px solid var(--wp--preset--color--primary); padding-left: 1.25rem; }
.it-cta { text-align: center; padding-block: 3rem; margin-block: 3rem 4rem !important; border-top: 1px solid var(--wp--preset--color--border); }

/* ---------- Páginas legales ---------- */
.page-template-page-legal main h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.page-template-page-legal main { color: var(--wp--preset--color--muted-foreground); }
.page-template-page-legal main strong, .page-template-page-legal main h1, .page-template-page-legal main h2 { color: var(--wp--preset--color--contrast); }
.wp-block-table table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.wp-block-table td, .wp-block-table th { border: 1px solid var(--wp--preset--color--border); padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
.wp-block-table tr:first-child td { font-weight: 600; color: var(--wp--preset--color--contrast); background: var(--wp--preset--color--card); }

/* ---------- Pedir presupuesto ---------- */
.it-quote-layout { align-items: start; margin-block: 1rem 5rem !important; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 781px) { .it-quote-layout { grid-template-columns: 1fr !important; } }
.it-contact-card { padding: 2rem; border-radius: 0.75rem; border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--card); }
.it-contact__item { margin-top: 1.25rem !important; }
.it-contact__item > * { margin: 0; }
.it-contact__label { font-family: var(--wp--preset--font-family--display); font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wp--preset--color--primary); }
.it-contact__item a { color: var(--wp--preset--color--contrast); }
.it-quote-layout .it-quote-card { position: static; }
