/*
Theme Name: Crea Docente
Theme URI: https://creadocente.com
Description: Tema de la tienda Crea Docente: material didáctico digital para docentes de educación básica. Tema hijo de Twenty Twenty-Five.
Author: Crea Docente
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: creadocente
*/

/* ---------- base: hoja de cuaderno ---------- */
body {
	background-color: var(--wp--preset--color--base);
	background-image: repeating-linear-gradient(180deg, transparent 0 35px, var(--wp--preset--color--accent-6) 35px 36px);
	-webkit-font-smoothing: antialiased;
}

/* ---------- encabezado ---------- */
.cd-header {
	position: relative;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}
.cd-logo {
	display: inline-flex;
	gap: 4px;
	text-decoration: none !important;
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 700;
	font-size: 19px;
	color: #fff !important;
}
.cd-logo span {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
}
.cd-logo span:nth-child(1) { background: var(--wp--preset--color--accent-2); transform: rotate(-6deg); }
.cd-logo span:nth-child(2) { background: var(--wp--preset--color--accent-3); transform: rotate(5deg); }
.cd-header .wp-block-site-title a { text-decoration: none; }
.cd-header .wp-block-navigation a { font-family: var(--wp--preset--font-family--fredoka); font-weight: 600; }
.cd-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent-3); }

/* franja de crayones */
.cd-crayons { height: 10px; display: flex; margin: 0 !important; }
.cd-crayons i { flex: 1; }
.cd-crayons i:nth-child(1) { background: var(--wp--preset--color--accent-2); }
.cd-crayons i:nth-child(2) { background: var(--wp--preset--color--orange); }
.cd-crayons i:nth-child(3) { background: var(--wp--preset--color--accent-1); }
.cd-crayons i:nth-child(4) { background: var(--wp--preset--color--green); }
.cd-crayons i:nth-child(5) { background: var(--wp--preset--color--accent-3); }
.cd-crayons i:nth-child(6) { background: var(--wp--preset--color--purple); }

/* ---------- botones tipo juguete ---------- */
.wp-element-button,
.wp-block-button__link,
.wc-block-components-button:not(.is-link),
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	border: 2px solid var(--wp--preset--color--contrast) !important;
	box-shadow: 0 4px 0 var(--wp--preset--color--contrast);
	transition: transform .12s ease, box-shadow .12s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover,
.wc-block-components-button:not(.is-link):hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 0 var(--wp--preset--color--contrast);
}
.wp-element-button:active,
.wp-block-button__link:active,
.wc-block-components-button:not(.is-link):active {
	transform: translateY(3px);
	box-shadow: 0 1px 0 var(--wp--preset--color--contrast);
}
.is-style-outline .wp-block-button__link { background: var(--wp--preset--color--accent-5) !important; color: var(--wp--preset--color--contrast) !important; }
:where(a, button, .wp-element-button):focus-visible { outline: 3px dashed var(--wp--preset--color--accent-3); outline-offset: 3px; }

/* ---------- tarjetas ---------- */
.cd-card {
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 20px;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
}
.cd-card .wp-block-heading { margin-top: 0; }
.cd-tilt-l { transform: rotate(-1.2deg); }
.cd-tilt-r { transform: rotate(1.2deg); }

.cd-badge {
	display: inline-block;
	border: 2px solid var(--wp--preset--color--contrast);
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 4px 14px;
	transform: rotate(-2deg);
}

/* palabra arcoíris */
.cd-rainbow { display: inline-block; white-space: nowrap; }
.cd-rainbow span { display: inline-block; }
.cd-rainbow span:nth-child(5n+1) { color: var(--wp--preset--color--accent-2); transform: rotate(-4deg); }
.cd-rainbow span:nth-child(5n+2) { color: var(--wp--preset--color--orange); transform: translateY(-3px); }
.cd-rainbow span:nth-child(5n+3) { color: var(--wp--preset--color--green); transform: rotate(3deg); }
.cd-rainbow span:nth-child(5n+4) { color: var(--wp--preset--color--accent-3); transform: translateY(2px); }
.cd-rainbow span:nth-child(5n+5) { color: var(--wp--preset--color--purple); transform: rotate(-3deg); }

/* ilustración */
.cd-art svg { width: 100%; height: auto; display: block; }
.cd-float { animation: cd-float 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cd-float.d2 { animation-delay: -1.3s; }
.cd-float.d3 { animation-delay: -2.6s; }
.cd-spin { animation: cd-wobble 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cd-float { 50% { transform: translateY(-10px); } }
@keyframes cd-wobble { 50% { transform: rotate(14deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .cd-float, .cd-spin { animation: none; } }

/* ---------- productos (listas, tienda, relacionados) ---------- */
.wc-block-product-template > li,
.wp-block-woocommerce-product-template > li,
ul.products li.product {
	background: var(--wp--preset--color--accent-5);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 18px;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
	padding: 12px 12px 18px !important;
	transition: transform .15s ease;
}
.wc-block-product-template > li:hover,
.wp-block-woocommerce-product-template > li:hover { transform: translateY(-4px) rotate(-.5deg); }
.wc-block-components-product-image img,
.wp-block-woocommerce-product-image img { border-radius: 12px; }
.wc-block-components-product-price,
.wp-block-woocommerce-product-price {
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 700;
	color: var(--wp--preset--color--accent-3);
}
.wc-block-components-product-sale-badge,
.wp-block-woocommerce-product-sale-badge {
	background: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--contrast) !important;
	border: 2px solid var(--wp--preset--color--contrast) !important;
	border-radius: 999px !important;
	font-family: var(--wp--preset--font-family--fredoka);
}
.wc-block-product-template .wp-block-post-title a,
.wp-block-woocommerce-product-template .wp-block-post-title a { text-decoration: none; }

/* producto individual */
.single-product .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery .flex-viewport { border-radius: 18px; }
.single-product .woocommerce-product-gallery img {
	border-radius: 18px;
	border: 2px solid var(--wp--preset--color--contrast);
	box-sizing: border-box;
	max-width: 100%;
}
.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--contrast) !important;
	border: 2px solid var(--wp--preset--color--contrast);
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	transform: rotate(-8deg);
}
/* la navegación ya muestra nivel y tipo; ocultamos "Categoría / Etiquetas" */
.single-product .product_meta,
.single-product .wp-block-woocommerce-product-meta { display: none; }
.single-product .wp-block-woocommerce-product-price { font-size: var(--wp--preset--font-size--x-large); }

/* tienda: filtros y contadores */
.wc-block-mini-cart__badge { background: var(--wp--preset--color--accent-2) !important; color: #fff !important; }

/* carrito y pago */
.wc-block-cart, .wc-block-checkout { font-family: var(--wp--preset--font-family--nunito); }
.wc-block-components-sidebar .wc-block-components-totals-wrapper,
.wp-block-woocommerce-checkout-order-summary-block {
	background: var(--wp--preset--color--accent-5);
}
.wc-block-components-text-input input,
.wc-block-components-combobox input,
.wc-block-components-form .wc-block-components-text-input input { border-radius: 10px !important; }

/* aviso de licencia en producto */
.cd-license {
	border: 2px dashed var(--wp--preset--color--accent-4);
	border-radius: 14px;
	padding: 12px 16px;
	font-size: .95em;
}

/* ---------- pie ---------- */
.cd-footer a { text-decoration: none; }
.cd-footer a:hover { text-decoration: underline; }

/* aviso de cuenta en Finalizar compra */
.cd-checkout-note {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	max-width: 1180px;
	margin: 0 auto 24px;
	padding: 14px 18px;
	background: var(--wp--preset--color--sun);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 16px;
	box-shadow: 0 4px 0 var(--wp--preset--color--contrast);
	font-size: .98rem;
	line-height: 1.5;
}
.cd-checkout-note > span { font-size: 1.4rem; line-height: 1.2; }
.cd-checkout-note p { margin: 0; }
.cd-checkout-note a { font-family: var(--wp--preset--font-family--fredoka); font-weight: 600; }
