/*
Theme Name: Panyedra
Theme URI: https://polyedra.mx
Author: POLYEDRA
Author URI: https://polyedra.mx
Description: Tema de bloques para Panyedra, boulangerie y pâtisserie de demostración. Fachada verde con toldo festoneado, rótulo dorado y vitrinas en arco. Diseñado para WooCommerce y el asistente Poly.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: panyedra
Tags: block-theme, e-commerce, full-site-editing
*/

/* ---------- Fachada: encabezado con toldo festoneado ---------- */

.pny-facade {
	position: relative;
	z-index: 20;
	margin-bottom: 26px; /* espacio para el festón */
}

/* Hilo dorado y festón (medios círculos) que cuelgan del toldo. */
.pny-facade::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -22px;
	height: 22px;
	background:
		radial-gradient(circle at 22px 0, var(--wp--preset--color--facade) 21px, transparent 22px) 0 0 / 44px 22px repeat-x;
	border-top: 1px solid var(--wp--preset--color--dorure);
	pointer-events: none;
}

.pny-facade .wp-block-site-title a {
	text-decoration: none;
	color: var(--wp--preset--color--dorure-clair);
}

.pny-facade .wp-block-navigation a,
.pny-facade .wp-block-navigation .wp-block-navigation-item__content {
	text-decoration: none;
}

.pny-facade .wp-block-navigation a:hover,
.pny-facade .wp-block-navigation a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-color: var(--wp--preset--color--dorure);
}

.pny-sign-sub {
	font-style: italic;
}

/* Iconos de cuenta y carrito en blanco sobre la fachada. */
.pny-facade .wc-block-mini-cart__button,
.pny-facade .wc-block-customer-account a,
.pny-facade .wc-block-customer-account svg {
	color: var(--wp--preset--color--papier);
	fill: currentColor;
}

.pny-facade .wc-block-mini-cart__badge {
	background: var(--wp--preset--color--dorure);
	color: var(--wp--preset--color--facade-deep);
	border-color: var(--wp--preset--color--facade);
}

/* ---------- Arcos de vitrina: el motivo que se repite ---------- */

.pny-arch img,
.pny-arch .wc-block-components-product-image img,
.pny-arch.wp-block-image img {
	border-radius: 999px 999px 4px 4px;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	width: 100%;
	height: auto;
}

.pny-arch-frame {
	border-radius: 999px 999px 4px 4px;
	overflow: hidden;
}

/* Tarjetas de producto: imagen en arco, título en Bodoni, precio en corteza. */
.wc-block-product-template .wc-block-components-product-image img,
.wp-block-woocommerce-product-template .wc-block-components-product-image img {
	border-radius: 999px 999px 4px 4px;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	background: var(--wp--preset--color--beurre);
}

.wc-block-product-template .wp-block-post-title,
.wp-block-woocommerce-product-template .wp-block-post-title {
	font-family: var(--wp--preset--font-family--bodoni);
	font-size: 1.25rem;
	line-height: 1.25;
}

.wc-block-product-template .wp-block-post-title a,
.wp-block-woocommerce-product-template .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--facade);
}

.wc-block-product-template .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Botones secundarios (contorno). */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--facade);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--facade);
	color: var(--wp--preset--color--papier);
}

/* ---------- Conversación de muestra (sección de Margot) ---------- */

.pny-chat {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.pny-chat p {
	max-width: 30ch;
	margin: 0;
	padding: 0.7rem 0.95rem;
	border-radius: 14px;
	font-size: 0.95rem;
	line-height: 1.45;
}

.pny-chat .pny-chat-me {
	align-self: flex-end;
	background: var(--wp--preset--color--facade);
	color: var(--wp--preset--color--papier);
	border-bottom-right-radius: 4px;
}

.pny-chat .pny-chat-bot {
	align-self: flex-start;
	background: var(--wp--preset--color--papier);
	border: 1px solid var(--wp--preset--color--dorure-clair);
	border-bottom-left-radius: 4px;
}

/* ---------- Sucursales ---------- */

.pny-branch {
	border-top: 1px solid var(--wp--preset--color--dorure);
	padding-top: 1.25rem;
}

.pny-branch dl {
	margin: 0;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.35rem 1rem;
	font-size: 0.95rem;
}

.pny-branch dt {
	color: var(--wp--preset--color--pierre);
}

.pny-branch dd {
	margin: 0;
}

/* ---------- Porciones en la ficha de producto ---------- */

.pny-servings {
	display: inline-block;
	margin: 0.25rem 0 0.75rem;
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--wp--preset--color--dorure-clair);
	border-radius: 999px;
	font-size: 0.9rem;
	color: var(--wp--preset--color--croute);
	background: var(--wp--preset--color--papier);
}

/* ---------- Aviso de tienda de demostración (store notice de WooCommerce) ---------- */

.woocommerce-store-notice,
p.demo_store {
	background: var(--wp--preset--color--dorure) !important;
	color: var(--wp--preset--color--facade-deep) !important;
	font-family: var(--wp--preset--font-family--jost);
	font-size: 0.9rem;
}

.woocommerce-store-notice a {
	color: inherit !important;
}

/* ---------- Accesibilidad ---------- */

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--dorure);
	outline-offset: 3px;
}

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

/* ---------- Ajustes responsivos del encabezado ---------- */

.pny-facade-row {
	align-items: center;
}

@media (max-width: 781px) {
	.pny-nav-secondary {
		display: none !important;
	}
	.pny-facade-row {
		grid-template-columns: 48px 1fr auto !important;
	}
	.pny-facade .pny-sign-sub {
		display: none;
	}
}

/* Títulos de categoría sobre la banda verde: sin subrayado hasta pasar el cursor. */
.has-facade-background-color h3 a {
	color: var(--wp--preset--color--papier);
	text-decoration: none;
}

.has-facade-background-color h3 a:hover {
	text-decoration: underline;
	text-underline-offset: 5px;
	text-decoration-color: var(--wp--preset--color--dorure);
}

/* Filetes dorados de "El oficio". */
.wp-block-columns > .wp-block-column[style*="border-top-color"] {
	border-top-style: solid;
	border-top-color: var(--wp--preset--color--dorure) !important;
}

/* Botón de las tarjetas de producto: alineado con título y precio, en el estilo de la casa. */
.wp-block-woocommerce-product-button,
.wc-block-components-product-button {
	justify-content: flex-start !important;
	align-items: flex-start !important;
	text-align: left !important;
}

.wc-block-components-product-button .wp-block-button__link,
.wc-block-components-product-button .wc-block-components-product-button__button {
	background: transparent;
	color: var(--wp--preset--color--facade);
	border: 1px solid var(--wp--preset--color--facade);
	border-radius: 2px;
	padding: 0.55rem 1.1rem;
	font-size: 0.9rem;
}

.wc-block-components-product-button .wp-block-button__link:hover,
.wc-block-components-product-button .wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--facade);
	color: var(--wp--preset--color--papier);
}

/* Pestañas de la ficha de producto, discretas. */
.wp-block-woocommerce-product-details.is-style-minimal ul.tabs.wc-tabs li {
	background: transparent;
	border: 0;
	border-bottom: 1px solid transparent;
}

.wp-block-woocommerce-product-details.is-style-minimal ul.tabs.wc-tabs li.active {
	border-bottom-color: var(--wp--preset--color--dorure);
}

.wp-block-woocommerce-product-details h2 {
	font-size: var(--wp--preset--font-size--large);
}
