/*
 * TMG Librería Online: estilos del tema hijo (Plan D, TMG-022).
 * Los colores de los componentes de Flatsome vienen de sus opciones (config/tienda/flatsome.settings.json);
 * aquí solo va lo que las opciones no cubren. Depende de tmg-tokens.css. Sin los valores PENDIENTES del CSS del kit (DP-01).
 */

/* Nunito alojada en el tema (SIL OFL 1.1, assets/fonts/nunito/OFL.txt). Fuente variable, eje wght 200-1000. */
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-weight: 200 1000;
	font-display: swap;
	src: url('../fonts/nunito/nunito-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-weight: 200 1000;
	font-display: swap;
	src: url('../fonts/nunito/nunito-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tipografía (manual p.8): cuerpo 16 px, navegación 600, énfasis 700, titulares 800 */
body.tmg-scope {
	font-family: var(--tmg-font);
	font-weight: var(--tmg-fw-regular);
	font-size: var(--tmg-fs-body);
	line-height: var(--tmg-lh-body);
	color: var(--tmg-text);
}
.tmg-scope h1, .tmg-scope h2, .tmg-scope h3, .tmg-scope h4, .tmg-scope h5, .tmg-scope h6,
.tmg-scope .heading-font, .tmg-scope .section-title {
	font-family: var(--tmg-font);
	font-weight: var(--tmg-fw-heading);
	color: var(--tmg-heading);
}
.tmg-scope h1 { font-size: var(--tmg-fs-h1); }
.tmg-scope strong, .tmg-scope b { font-weight: var(--tmg-fw-bold); }
.tmg-scope .nav > li > a, .tmg-scope .nav-dropdown a, .tmg-scope .button, .tmg-scope button,
.tmg-scope input, .tmg-scope select, .tmg-scope textarea, .tmg-scope .alt-font {
	font-family: var(--tmg-font);
}
.tmg-scope .nav > li > a { font-weight: var(--tmg-fw-nav); }
.tmg-scope .button { font-weight: var(--tmg-fw-bold); }
/* El manual pide evitar mayúsculas extensas (p.8) */
.tmg-scope .entry-title, .tmg-scope .page-title, .tmg-scope .uppercase { text-transform: none; }

/* Enlaces en texto corrido: subrayados (WCAG 1.4.1; #007780 frente a #1F2937 = 2,76:1) */
.tmg-scope .entry-content p a:not(.button),
.tmg-scope .entry-content li a:not(.button),
.tmg-scope .page-wrapper p a:not(.button),
.tmg-scope .woocommerce-Tabs-panel a:not(.button) {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Foco visible sobre fondos claros (#007780) y oscuros (#68CBEA, 7,77:1) */
.tmg-scope a:focus-visible, .tmg-scope button:focus-visible, .tmg-scope .button:focus-visible,
.tmg-scope input:focus-visible, .tmg-scope select:focus-visible, .tmg-scope textarea:focus-visible,
.tmg-scope [tabindex]:focus-visible {
	outline: var(--tmg-focus-width) solid var(--tmg-focus);
	outline-offset: var(--tmg-focus-offset);
}
.tmg-scope .dark a:focus-visible, .tmg-scope .dark button:focus-visible, .tmg-scope .dark .button:focus-visible,
.tmg-scope .nav-dark a:focus-visible, .tmg-scope .tmg-footer a:focus-visible {
	outline-color: var(--tmg-focus-on-dark);
}

/* Campos: borde #50647C (6,08:1); Flatsome usa #ddd (1,36:1), que no cumple WCAG 1.4.11 */
.tmg-scope input[type="text"], .tmg-scope input[type="email"], .tmg-scope input[type="tel"],
.tmg-scope input[type="search"], .tmg-scope input[type="number"], .tmg-scope input[type="password"],
.tmg-scope input[type="url"], .tmg-scope textarea, .tmg-scope select {
	border-color: var(--tmg-border-input);
	color: var(--tmg-text);
	font-size: var(--tmg-fs-body);
}

/* Precios (D5): el cobrado en azul 700; el de referencia en gris azulado */
.tmg-scope .price ins .amount, .tmg-scope .price > .amount { color: var(--tmg-price); font-weight: var(--tmg-fw-bold); }
.tmg-scope .price del, .tmg-scope .price del .amount { color: var(--tmg-price-regular); }

/* Oferta DP-05: porcentaje calculado por Flatsome sobre los precios de WooCommerce. */
.tmg-scope .product-small .badge-container { left: .75rem; top: .75rem; }
.tmg-scope .badge-container .badge { width: auto; height: auto; min-height: 0; }
.tmg-scope .badge-container .badge-inner.on-sale {
	width: auto;
	height: auto;
	min-height: 0;
	padding: .5rem .625rem;
	border-radius: 0;
	color: var(--tmg-badge-sale-text);
	font-size: .75rem;
	font-weight: var(--tmg-fw-bold);
	line-height: 1.1;
	white-space: nowrap;
}

/* Marca visible de contenido PENDIENTE (tests/wp/contenido-pendiente.php la bloquea en live) */
.tmg-scope .tmg-pendiente { border-left: 4px solid var(--tmg-navy); background: var(--tmg-light); padding: .75rem 1rem; }

/* Portada: fotografía ambiental original y texto vivo, sin superponer texto sobre objetos. */
.tmg-scope .tmg-hero { border-bottom: 1px solid var(--tmg-light); }
.tmg-scope .tmg-hero .tmg-hero__column { padding-bottom: 0; }
.tmg-scope .tmg-hero__panel { position: relative; min-height: 520px; overflow: hidden; background: var(--tmg-light); }
.tmg-scope .tmg-hero__panel .tmg-editorial-image { position: absolute; inset: 0; display: block; }
.tmg-scope .tmg-hero__panel .tmg-editorial-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.tmg-scope .tmg-hero__panel::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.94) 35%, rgba(255,255,255,.4) 59%, transparent 78%); pointer-events: none; }
.tmg-scope .tmg-hero__content { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; min-height: 520px; max-width: 650px; padding: 3.5rem clamp(2rem, 5vw, 5rem); }
.tmg-scope .tmg-hero__eyebrow { font-size: .875rem; font-weight: var(--tmg-fw-bold); letter-spacing: .08em; color: var(--tmg-teal-text); margin-bottom: 1rem; }
.tmg-scope .tmg-hero__titular { font-size: clamp(2.375rem, 1.6rem + 2.5vw, 3.75rem); font-weight: var(--tmg-fw-heading); color: var(--tmg-navy); line-height: 1.08; max-width: 12ch; margin-bottom: .75rem; }
.tmg-scope .tmg-acento { color: var(--tmg-teal-text); }
.tmg-scope .tmg-hero__descriptor { font-weight: var(--tmg-fw-bold); color: var(--tmg-navy); margin-bottom: .5rem; }
.tmg-scope .tmg-hero__copy { color: var(--tmg-ink); max-width: 36ch; margin-bottom: 1.25rem; }
.tmg-scope .tmg-hero__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.tmg-scope .tmg-hero__acciones .button { margin: 0; }
.tmg-scope .tmg-hero__enlace { color: var(--tmg-teal-text); font-weight: var(--tmg-fw-bold); text-decoration: underline; text-underline-offset: 3px; }
.tmg-scope .tmg-trust { border-bottom: 1px solid var(--tmg-light); }
.tmg-scope .tmg-trust__item { padding-top: .75rem; padding-bottom: .5rem; }
.tmg-scope .tmg-trust__item + .tmg-trust__item { border-left: 1px solid var(--tmg-light); }
.tmg-scope .tmg-trust__heading { display: flex; align-items: center; gap: .625rem; min-height: 40px; margin-bottom: .25rem; }
.tmg-scope .tmg-trust__heading .tmg-logo { display: block; flex: 0 0 auto; object-fit: contain; }
.tmg-scope .tmg-confianza__titulo { font-size: 1rem; margin-bottom: 0; }
.tmg-scope .tmg-trust__item p { margin-bottom: 0; font-size: .875rem; color: var(--tmg-text-muted); }

/* Secciones de catálogo de la portada: texto vivo, consultas acotadas y tarjetas parejas. */
.tmg-scope .tmg-section__eyebrow { margin-bottom: .25rem; color: var(--tmg-teal-text); font-size: .875rem; font-weight: var(--tmg-fw-bold); letter-spacing: .04em; }
.tmg-scope .tmg-section__title { margin-bottom: .25rem; font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem); line-height: 1.2; }
.tmg-scope .tmg-section__intro { margin-bottom: .75rem; color: var(--tmg-text-muted); }
.tmg-scope .tmg-product-section .tmg-section__action .button { margin-bottom: .75rem; }
.tmg-scope .product-small .col-inner { height: 100%; border: 1px solid var(--tmg-light); background: var(--tmg-white); }
.tmg-scope .product-small .box-text { padding: .75rem; }
.tmg-scope .product-small .box-text .price { font-size: 1rem; }
.tmg-scope .tmg-feature--arte { background: var(--tmg-light); }
.tmg-scope .tmg-feature__editorial .tmg-editorial-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tmg-light); margin-bottom: 1.25rem; }
.tmg-scope .tmg-feature__editorial img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tmg-scope .tmg-feature__editorial .button { margin-top: .5rem; }
.tmg-scope .tmg-feature__products .row { margin-bottom: 0; }
.tmg-scope .tmg-feature--lapices .tmg-feature__editorial { order: 2; }
.tmg-scope .tmg-feature--lapices .tmg-feature__products { order: 1; }
.tmg-scope .tmg-home-marcas .tmg-lista-enlaces { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.tmg-scope .tmg-home-marcas .tmg-lista-enlaces li { margin: 0; }
.tmg-scope .tmg-home-marcas .tmg-lista-enlaces a { display: inline-block; padding: .625rem 1rem; border: 1px solid var(--tmg-teal-text); background: var(--tmg-white); color: var(--tmg-navy); font-weight: var(--tmg-fw-bold); text-decoration: none; }
.tmg-scope .tmg-home-marcas .tmg-lista-enlaces a:hover { background: var(--tmg-navy); color: var(--tmg-white); }

/* Cabeceras de tienda y familias. El H1 nativo se conserva para lectura y SEO. */
.tmg-scope .tmg-category-banner { border-top: 4px solid var(--tmg-coral); }
.tmg-scope .tmg-category-banner p { color: var(--tmg-white); }
.tmg-scope .tmg-category-banner__eyebrow { margin-bottom: .3rem; color: var(--tmg-cyan) !important; font-size: .875rem; font-weight: var(--tmg-fw-bold); }
.tmg-scope .tmg-category-banner__title { margin-bottom: .4rem; font-size: clamp(1.75rem, 1.1rem + 2.4vw, 3rem); font-weight: var(--tmg-fw-heading); line-height: 1.15; }
.tmg-scope .tmg-category-banner__description { max-width: 55rem; margin-bottom: 0; font-size: 1rem; }
/* Banner de cobertura RM versionado en el manifiesto de la portada. */
.tmg-scope .tmg-shipping-banner { border-left: 4px solid var(--tmg-teal); }
.tmg-scope .tmg-shipping-banner__eyebrow { margin-bottom: .3rem; color: var(--tmg-teal-text); font-size: .875rem; font-weight: var(--tmg-fw-bold); }
.tmg-scope .tmg-shipping-banner__title { margin-bottom: .3rem; font-size: clamp(1.375rem, 1rem + 1vw, 1.75rem); font-weight: var(--tmg-fw-heading); }
.tmg-scope .tmg-shipping-banner__description { margin-bottom: 0; }
.tmg-scope.tmg-shop-has-banner h1.shop-page-title,
.tmg-scope.tmg-category-has-banner h1.shop-page-title {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.tmg-scope h1.shop-page-title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); }
.tmg-scope .shop-sidebar .widget-title { font-weight: var(--tmg-fw-heading); }
.tmg-scope.single-product h1.product-title { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.18; }

/* Páginas de servicio: lectura clara y formulario sin scripts fuera de Contacto. */
.tmg-scope .tmg-page-intro { max-width: 54rem; margin-bottom: 2rem; font-size: 1.125rem; }
.tmg-scope .tmg-contact-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 1fr); gap: 2rem; align-items: start; }
.tmg-scope .tmg-contact-grid__form,
.tmg-scope .tmg-contact-grid__aside,
.tmg-scope .tmg-information-grid > section { padding: 1.5rem; border: 1px solid var(--tmg-light); background: var(--tmg-white); }
.tmg-scope .tmg-contact-grid__aside { border-top: 4px solid var(--tmg-teal); background: var(--tmg-light); }
.tmg-scope .tmg-contact-grid h2,
.tmg-scope .tmg-information-grid h2 { font-size: 1.375rem; }
.tmg-scope .tmg-contact-grid .wpcf7 input:not([type="submit"]),
.tmg-scope .tmg-contact-grid .wpcf7 textarea { width: 100%; }
.tmg-scope .tmg-verificacion { margin: 1rem 0 1.5rem; }
.tmg-scope .tmg-verificacion p { margin-bottom: .5rem; }
.tmg-scope .tmg-verificacion .wpcf7-quiz-label { display: block; margin-bottom: .5rem; font-weight: var(--tmg-fw-bold); }
.tmg-scope .tmg-contact-grid .wpcf7 .tmg-verificacion input.wpcf7-quiz { max-width: 8rem; }
.tmg-scope .tmg-information-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

/* Escenas editoriales decorativas: las etiquetas y enlaces siguen siendo texto HTML. */
.tmg-scope .tmg-familias { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
@media (min-width: 850px) { .tmg-scope .tmg-familias { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tmg-scope .tmg-familias li { margin: 0; min-width: 0; }
.tmg-scope .tmg-familias a { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--tmg-light); background: var(--tmg-white); color: var(--tmg-navy); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.tmg-scope .tmg-familias a:hover { border-color: var(--tmg-teal-text); transform: translateY(-2px); }
.tmg-scope .tmg-familias__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tmg-light); }
.tmg-scope .tmg-familias__media .tmg-editorial-image,
.tmg-scope .tmg-familias__media img { display: block; width: 100%; height: 100%; }
.tmg-scope .tmg-familias__media img { object-fit: cover; }
.tmg-scope .tmg-familias__content { display: flex; flex-direction: column; gap: .35rem; flex: 1; padding: 1rem; }
.tmg-scope .tmg-familias__label { font-size: 1.125rem; font-weight: var(--tmg-fw-heading); line-height: 1.2; }
.tmg-scope .tmg-familias__action { margin-top: auto; color: var(--tmg-teal-text); font-size: .875rem; font-weight: var(--tmg-fw-bold); text-decoration: underline; text-underline-offset: 2px; }
.tmg-scope .tmg-lista-enlaces { list-style: none; margin: 0 0 1rem; padding: 0; }
.tmg-scope .tmg-lista-enlaces li { margin: 0 0 .4rem; }
.tmg-scope .tmg-lista-titulo { font-size: 1rem; margin-bottom: .5rem; }

/* Pie (bloque tmg-footer) sobre azul: texto blanco o celeste fondo; enlaces subrayados (05 B.5) */
.tmg-scope .tmg-footer, .tmg-scope .tmg-footer p, .tmg-scope .tmg-footer li { color: var(--tmg-white); }
.tmg-scope .tmg-footer h2, .tmg-scope .tmg-footer .tmg-lista-titulo { color: var(--tmg-white); font-size: 1rem; }
.tmg-scope .tmg-footer a { color: var(--tmg-white); text-decoration: underline; }
.tmg-scope .tmg-footer a:hover { color: var(--tmg-cyan); }
.tmg-scope .tmg-footer .tmg-footer__eslogan { color: var(--tmg-light); }
.tmg-scope .tmg-payment-logos { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.tmg-scope .tmg-payment-logos li { display: flex; align-items: center; justify-content: center; width: 120px; min-height: 56px; margin: 0; padding: .25rem; background: var(--tmg-white); }
.tmg-scope .tmg-payment-logos img { display: block; max-width: 110px; max-height: 50px; width: auto; height: auto; object-fit: contain; }
.tmg-scope .absolute-footer .tmg-credito { display: inline-flex; align-items: center; gap: .3rem; color: var(--tmg-white); text-decoration: none; }
.tmg-scope .absolute-footer .tmg-credito:hover { color: var(--tmg-cyan); }
.tmg-scope .absolute-footer .tmg-credito img { display: inline-block; width: 27px; height: 18px; margin-left: .2rem; }

@media (max-width: 849px) {
	.tmg-scope .tmg-hero__panel,
	.tmg-scope .tmg-hero__content { min-height: 560px; }
	.tmg-scope .tmg-hero__panel .tmg-editorial-image img { object-position: center 70%; }
	.tmg-scope .tmg-hero__panel::before { background: linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(255,255,255,.98) 42%, rgba(255,255,255,.4) 68%, transparent 82%); }
	.tmg-scope .tmg-hero__content { justify-content: flex-start; padding: 2rem 1.25rem; }
	.tmg-scope .tmg-hero__titular { font-size: clamp(2.125rem, 1.3rem + 3vw, 2.75rem); }
	.tmg-scope .tmg-hero__copy { max-width: 31ch; }
	.tmg-scope .tmg-trust__item + .tmg-trust__item { border-left: 0; border-top: 1px solid var(--tmg-light); }
	.tmg-scope .tmg-feature--lapices .tmg-feature__editorial,
	.tmg-scope .tmg-feature--lapices .tmg-feature__products { order: initial; }
	.tmg-scope .tmg-product-section .tmg-section__action { text-align: left; }
	.tmg-scope .tmg-category-banner__description { font-size: .9375rem; }
	.tmg-scope .product-small .badge-container { left: .5rem; top: .5rem; }
	.tmg-scope .tmg-contact-grid,
	.tmg-scope .tmg-information-grid { grid-template-columns: 1fr; }
	.tmg-scope.tmg-contacto .joinchat { display: none !important; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
	.tmg-scope *, .tmg-scope *::before, .tmg-scope *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
