/*
Theme Name:   Shumagrumi's (Astra Child)
Theme URI:    https://shumagrumis.com/
Description:  Tema hijo de Astra para Shumagrumi's: temas Cuarzo y Obsidiana, catálogo con pedidos por WhatsApp, sin carrito.
Author:       Niccolly
Template:     astra
Version:      1.0.1
Requires PHP: 7.4
Text Domain:  shumagrumis
License:      GPL-2.0-or-later
*/

/* ------------------------------------------------------------------
   1. Fuentes locales (sin Google Fonts)
------------------------------------------------------------------- */
@font-face {
	font-family: "Instrument Sans";
	src: url("assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Bricolage Grotesque";
	src: url("assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Cormorant Garamond";
	src: url("assets/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

/* ------------------------------------------------------------------
   2. Temas: Cuarzo (claro) y Obsidiana (negro y dorado)
------------------------------------------------------------------- */
html,
html[data-tema="cuarzo"] {
	--shg-bg: #F4F2EE;
	--shg-surface: #FFFFFF;
	--shg-band: #ECE9E3;
	--shg-ink: #1B1D1C;
	--shg-muted: #4A4D4B;
	--shg-faint: #5C5F5D;
	--shg-line: #DDD9D0;
	--shg-accent: #1E4A3D;
	--shg-on-accent: #FFFFFF;
	--shg-label: #1E4A3D;
	--shg-head: "Bricolage Grotesque", system-ui, sans-serif;
	--shg-head-w: 700;
	--shg-body: "Instrument Sans", system-ui, sans-serif;
	--shg-radius: 18px;
	color-scheme: light;
}
html[data-tema="obsidiana"] {
	--shg-bg: #0F0E0D;
	--shg-surface: #1A1816;
	--shg-band: #161412;
	--shg-ink: #F1ECE3;
	--shg-muted: #C2BBAF;
	--shg-faint: #A39C90;
	--shg-line: #2E2A26;
	--shg-accent: #C9A86A;
	--shg-on-accent: #141210;
	--shg-label: #C9A86A;
	--shg-head: "Cormorant Garamond", Georgia, serif;
	--shg-head-w: 600;
	color-scheme: dark;
}

/* Paleta global de Astra apuntando a los tokens (gana a la de Astra por especificidad) */
html[data-tema] {
	--ast-global-color-0: var(--shg-accent);
	--ast-global-color-1: var(--shg-accent);
	--ast-global-color-2: var(--shg-ink);
	--ast-global-color-3: var(--shg-muted);
	--ast-global-color-4: var(--shg-band);
	--ast-global-color-5: var(--shg-surface);
	--ast-global-color-6: var(--shg-line);
	--ast-global-color-7: var(--shg-bg);
	--ast-global-color-8: var(--shg-faint);
}

/* ------------------------------------------------------------------
   3. Base
------------------------------------------------------------------- */
body,
.ast-separate-container,
.ast-plain-container,
.ast-page-builder-template {
	background: var(--shg-bg);
	color: var(--shg-ink);
	font-family: var(--shg-body);
}
body, button, input, select, textarea { font-family: var(--shg-body); }
h1, h2, h3, h4, .entry-title, .site-title, .woocommerce-products-header__title, .product_title {
	font-family: var(--shg-head);
	font-weight: var(--shg-head-w);
	color: var(--shg-ink);
	letter-spacing: -0.01em;
}
a { color: var(--shg-label); }
a:hover, a:focus { color: var(--shg-ink); }
:focus-visible { outline: 2px solid var(--shg-accent); outline-offset: 2px; }
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container .comments-area,
.ast-separate-container .ast-woocommerce-container {
	background: transparent;
}
hr, .woocommerce .woocommerce-ordering select { border-color: var(--shg-line); }

/* Botones generales (Astra + bloques) */
.ast-button, .button, button.button, .wp-block-button__link,
.woocommerce a.button, .woocommerce button.button {
	background: var(--shg-accent);
	color: var(--shg-on-accent);
	border: 0;
	border-radius: 999px;
	font-weight: 600;
	padding: 14px 26px;
	min-height: 44px;
	line-height: 1.2;
}
.ast-button:hover, .button:hover, .wp-block-button__link:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover {
	background: var(--shg-accent);
	color: var(--shg-on-accent);
	filter: brightness(0.92);
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--shg-ink);
	border: 1.5px solid var(--shg-ink);
}

/* ------------------------------------------------------------------
   4. Barra superior + selector de tema
------------------------------------------------------------------- */
.shg-topbar {
	background: var(--shg-accent);
	color: var(--shg-on-accent);
	font-size: 14px;
	font-weight: 500;
}
.shg-topbar__in {
	max-width: 1240px;
	margin: 0 auto;
	padding: 6px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.shg-tema { display: flex; gap: 4px; }
.shg-tema button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--shg-on-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.shg-tema button[aria-pressed="true"] {
	border-color: var(--shg-on-accent);
	background: rgba(255, 255, 255, 0.18);
}
.shg-tema__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid currentColor;
	display: inline-block;
}
.shg-tema__dot--cuarzo { background: #F4F2EE; }
.shg-tema__dot--obsidiana { background: #0F0E0D; }

/* Cabecera y pie de Astra */
.site-header, .main-header-bar, .ast-primary-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar,
.ast-builder-menu-mobile .main-navigation .menu-item > .menu-link {
	background: var(--shg-bg);
	color: var(--shg-ink);
}
.ast-primary-header-bar { border-bottom: 1px solid var(--shg-line); }
.main-header-menu .menu-link, .ast-header-break-point .main-navigation .menu-link {
	color: var(--shg-ink);
	font-weight: 500;
}
.main-header-menu .menu-link:hover,
.main-header-menu .current-menu-item > .menu-link { color: var(--shg-label); }
.site-footer, .site-primary-footer-wrap, .site-below-footer-wrap {
	background: var(--shg-band);
	color: var(--shg-muted);
	border-top: 1px solid var(--shg-line);
}
.site-footer a { color: var(--shg-muted); }

/* ------------------------------------------------------------------
   5. Tienda: tarjetas de producto
------------------------------------------------------------------- */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	background: var(--shg-surface);
	border: 1px solid var(--shg-line);
	border-radius: var(--shg-radius);
	overflow: hidden;
	padding: 0 0 16px;
	display: flex;
	flex-direction: column;
	text-align: left;
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img,
.woocommerce ul.products li.product a img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}
.woocommerce ul.products li.product .astra-shop-summary-wrap { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.woocommerce ul.products li.product .ast-woo-product-category {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--shg-faint);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--shg-body);
	font-size: 17px;
	font-weight: 600;
	color: var(--shg-ink);
	line-height: 1.3;
}
.shg-medida { font-size: 14px; color: var(--shg-faint); }
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price {
	color: var(--shg-ink);
	font-weight: 700;
	font-size: 20px;
}

/* Botón de WhatsApp */
.shg-wa {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: auto;
	background: var(--shg-accent);
	color: var(--shg-on-accent) !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	padding: 12px 14px;
	border-radius: 12px;
	min-height: 44px;
	box-sizing: border-box;
	text-align: center;
}
.shg-wa:hover { filter: brightness(0.92); color: var(--shg-on-accent); }
.shg-wa[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
.shg-wa svg { flex: none; }
ul.products .shg-wa { margin: 10px 16px 0; }
.single-product .shg-wa { font-size: 17px; padding: 16px 24px; border-radius: 14px; min-height: 52px; margin: 8px 0 6px; }
.shg-wa-nota { font-size: 14px; color: var(--shg-faint); text-align: center; margin: 0 0 20px; }

/* Ficha: tabla de datos y caja de envío */
.shg-ficha { margin: 0 0 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--shg-line); }
.shg-ficha dt, .shg-ficha dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--shg-line); font-size: 15px; }
.shg-ficha dt { color: var(--shg-faint); }
.shg-ficha dd { font-weight: 500; }
.shg-caja {
	background: var(--shg-band);
	border-radius: 16px;
	padding: 18px 20px;
	font-size: 15px;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 18px;
}

/* Barra fija en celular (ficha de producto) */
.shg-barra { display: none; }

/* Texto SEO al pie de categoría */
.shg-texto-cat {
	background: var(--shg-band);
	border-top: 1px solid var(--shg-line);
	margin-top: 48px;
	padding: 48px 20px;
}
.shg-texto-cat__in { max-width: 860px; margin: 0 auto; color: var(--shg-muted); font-size: 17px; line-height: 1.65; }

/* ------------------------------------------------------------------
   6. Secciones de Inicio (patrones de bloques)
------------------------------------------------------------------- */
.shg-eyebrow {
	font-size: 14px !important;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--shg-label) !important;
	margin-bottom: 12px !important;
}
.shg-lead { font-size: 18px; line-height: 1.55; color: var(--shg-muted); }
.shg-banda { background: var(--shg-band); border-top: 1px solid var(--shg-line); border-bottom: 1px solid var(--shg-line); }
.shg-card {
	background: var(--shg-surface);
	border: 1px solid var(--shg-line);
	border-radius: var(--shg-radius);
	padding: 24px;
	height: 100%;
	box-sizing: border-box;
}
.shg-card--plana { background: var(--shg-band); border: 0; }
.shg-card p { color: var(--shg-muted); margin: 0; }
.shg-paso {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--shg-accent);
	color: var(--shg-on-accent);
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	margin-bottom: 14px !important;
}
.shg-precio-grande { font-family: var(--shg-head); font-weight: var(--shg-head-w); font-size: 30px; color: var(--shg-ink); }
.wp-block-details.shg-faq {
	background: var(--shg-surface);
	border: 1px solid var(--shg-line);
	border-radius: 14px;
	padding: 18px 20px;
	margin-bottom: 10px;
}
.wp-block-details.shg-faq summary { font-weight: 600; font-size: 17px; cursor: pointer; }
.wp-block-details.shg-faq p { color: var(--shg-muted); margin-top: 10px; }

/* Grilla de categorías [shg_categorias] */
.shg-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.shg-cats a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
	background: var(--shg-surface);
	border: 1px solid var(--shg-line);
	border-radius: 16px;
	text-decoration: none;
	color: var(--shg-ink);
	transition: transform .15s ease;
}
.shg-cats a:hover { transform: translateY(-2px); color: var(--shg-ink); }
.shg-cats img, .shg-cats .shg-cats__ph { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: var(--shg-band); }
.shg-cats strong { display: block; font-size: 17px; }
.shg-cats small { font-size: 14px; color: var(--shg-faint); }

/* ------------------------------------------------------------------
   7. Celular
------------------------------------------------------------------- */
@media (max-width: 760px) {
	.shg-topbar { font-size: 12px; }
	.shg-topbar__in { padding: 6px 14px; }
	h1, .product_title, .woocommerce-products-header__title { font-size: 36px; }
	h2 { font-size: 28px; }
	.woocommerce ul.products, .woocommerce-page ul.products {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
	.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { width: auto !important; margin: 0 !important; }
	.woocommerce ul.products li.product .astra-shop-summary-wrap { padding: 10px 12px 0; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 15px; }
	ul.products .shg-wa { margin: 8px 12px 0; font-size: 13px; padding: 10px 8px; }
	ul.products .shg-wa svg { display: none; }
	.single-product .summary .shg-wa, .single-product .summary .shg-wa-nota { display: none; }
	.shg-barra {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 50;
		align-items: center;
		gap: 12px;
		padding: 10px 16px;
		background: var(--shg-bg);
		border-top: 1px solid var(--shg-line);
	}
	body.single-product { padding-bottom: 76px; }
	.shg-barra__info { display: flex; flex-direction: column; font-size: 13px; color: var(--shg-faint); }
	.shg-barra__info strong { font-size: 19px; color: var(--shg-ink); }
	.shg-barra .shg-wa { flex: 1; margin: 0; }
}

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


/* ------------------------------------------------------------------
   8. Prioridad sobre la configuración guardada de Astra
------------------------------------------------------------------- */
html[data-tema] .wp-block-button .wp-block-button__link,
html[data-tema] .ast-button,
html[data-tema] .button,
html[data-tema] button.button,
html[data-tema] .woocommerce a.button,
html[data-tema] .woocommerce button.button {
	background: var(--shg-accent);
	color: var(--shg-on-accent);
	border: 0;
	border-radius: 999px;
}
html[data-tema] .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--shg-ink);
	border: 1.5px solid var(--shg-ink);
}
html[data-tema] .wp-block-button .wp-block-button__link:hover,
html[data-tema] .ast-button:hover,
html[data-tema] .button:hover {
	background: var(--shg-accent);
	color: var(--shg-on-accent);
	filter: brightness(0.92);
}
html[data-tema] .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--shg-ink);
	color: var(--shg-bg);
	filter: none;
}
html[data-tema] .main-header-menu .menu-link,
html[data-tema] .ast-builder-menu .menu-item > .menu-link { color: var(--shg-ink); }
html[data-tema] .main-header-menu .menu-link:hover,
html[data-tema] .main-header-menu .current-menu-item > .menu-link { color: var(--shg-label); }
html[data-tema] .site-header,
html[data-tema] .ast-primary-header-bar,
html[data-tema] .main-header-bar { background: var(--shg-bg); }
.custom-logo-link img, .site-logo-img .custom-logo { max-width: 190px; height: auto; }
@media (max-width: 760px) { .custom-logo-link img, .site-logo-img .custom-logo { max-width: 140px; } }
