/*
Theme Name: Blocksy Child
Template: blocksy
Description: Child theme for Manziz digital products store. Carries the Manziz Growth design tokens over Blocksy.
Version: 1.0.11
Text Domain: blocksy-child
*/

:root {
	--mz-bg: #FDFAF8;
	--mz-surface: #FFFFFF;
	--mz-ink: #2B2030;
	--mz-accent: #F26100;
	--mz-space-sm: 8px;
	--mz-space-md: 16px;
	--mz-space-lg: 32px;
	--mz-space-xl: 64px;
	--mz-radius-sm: 6px;
	--mz-radius-md: 10px;
	--mz-radius-lg: 16px;

	/* Blocksy's global button color variable defaults to a stock blue
	   (#2872fa) that was never themed - align it with the one brand
	   accent so Add to cart buttons match the rest of the site. */
	--theme-button-background-initial-color: #F26100;
	--theme-button-background-hover-color: #2B2030;
	--theme-button-text-initial-color: #ffffff;
	--theme-button-text-hover-color: #ffffff;
}

/* ---------------------------------------------------------------
   Footer — professional restyle (Manziz Growth tokens)

   The footer's 4 widget columns (brand / Shop / Help & account /
   Policies & legal) were already built, but had zero styling: Blocksy's
   footer-builder CSS variable --grid-template-columns was never set for
   the top row, so the grid collapsed to a single implicit column and
   every column stacked full-width - matching the broken look in the
   bug report. This section fixes that, plus the oversized 150x150
   logo, unstyled .wp-block-heading titles and bare link lists.
   --------------------------------------------------------------- */
.ct-footer {
	background-color: #F6EFED !important;
}

.ct-footer [data-row="top"] > .ct-container {
	--columns-gap: var(--mz-space-lg);
	padding-block: var(--mz-space-xl) var(--mz-space-lg) !important;
	border-top: 1px dashed rgba(43, 32, 48, 0.18);
}

@media (min-width: 690px) {
	.ct-footer [data-row="top"] > .ct-container {
		--grid-template-columns: 2fr 1fr 1fr 1fr;
	}
}

@media (min-width: 480px) and (max-width: 689.98px) {
	.ct-footer [data-row="top"] > .ct-container {
		--grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Brand lockup: logo + wordmark side by side, logo capped to icon size */
.ct-footer .mz-footer-brand {
	flex-direction: row !important;
	align-items: center !important;
	gap: var(--mz-space-sm);
	margin: 0 0 var(--mz-space-md);
}

.ct-footer .mz-footer-logo {
	margin: 0 !important;
	flex: 0 0 auto;
}

.ct-footer .mz-footer-logo img {
	width: 40px !important;
	height: 40px !important;
	object-fit: contain;
}

.ct-footer .mz-footer-wordmark {
	margin: 0 !important;
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 0.02em;
	color: var(--mz-ink);
}

/* Column titles (real markup: h5.wp-block-heading, not .widget-title) */
.ct-footer [data-row="top"] .wp-block-heading {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 15px;
	color: var(--mz-ink);
	margin: 0 0 var(--mz-space-sm);
	letter-spacing: 0.01em;
}

/* Link lists (real markup: ul.wp-block-list, not a generic ul) */
.ct-footer [data-row="top"] .wp-block-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ct-footer [data-row="top"] .wp-block-list a {
	font-size: 14px;
	line-height: 1.4;
	color: rgba(43, 32, 48, 0.72);
	text-decoration: none;
	transition: color 0.2s ease;
}

.ct-footer [data-row="top"] .wp-block-list a:hover,
.ct-footer [data-row="top"] .wp-block-list a:focus-visible {
	color: var(--mz-accent);
	text-decoration: underline;
}

/* "Your files are ready..." helper line under Help & account */
.ct-footer [data-column="widget-area-2"] .wp-block-group > p {
	margin: var(--mz-space-sm) 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: rgba(43, 32, 48, 0.55);
}

/* ---------------------------------------------------------------
   Mobile UX pass: compact header, 2-col product grid, tight footer
   --------------------------------------------------------------- */
@media (max-width: 768px) {

	/* Related/upsell product sections are hidden below 690px by Blocksy's
	   own ct-hidden-sm/ct-hidden-md utility classes - show them like Etsy
	   does on single product pages. */
	.woocommerce section.related.products.ct-hidden-sm,
	.woocommerce section.related.products.ct-hidden-md,
	.woocommerce section.up-sells.products.ct-hidden-sm,
	.woocommerce section.up-sells.products.ct-hidden-md {
		display: block !important;
	}

	/* Product grid: 2 per row */
	.woocommerce ul.products {
		display: grid !important;
		grid-template-columns: repeat(2, 1fr) !important;
		gap: var(--mz-space-sm) !important;
	}

	.woocommerce ul.products li.product {
		width: 100% !important;
		margin: 0 !important;
	}

	.woocommerce ul.products li.product img {
		width: 100% !important;
		height: 160px !important;
		object-fit: cover !important;
		border-radius: var(--mz-radius-sm) !important;
	}

	.woocommerce ul.products li.product .woocommerce-loop-product__title {
		font-size: 13px !important;
		line-height: 1.3 !important;
		margin: var(--mz-space-sm) 0 4px !important;
		color: var(--mz-ink) !important;
	}

	.woocommerce ul.products li.product .price {
		font-size: 13px !important;
	}

	.woocommerce ul.products li.product .button {
		font-size: 12px !important;
		padding: 6px 10px !important;
		width: 100% !important;
	}

	/* Header: compact (actual Blocksy markup: header#header.ct-header) */
	#header.ct-header [data-row="middle"] > .ct-container {
		padding-top: var(--mz-space-sm) !important;
		padding-bottom: var(--mz-space-sm) !important;
		min-height: 36px !important;
	}

	#header.ct-header .site-logo-container {
		height: 36px !important;
	}

	#header.ct-header img.default-logo {
		max-height: 36px !important;
		width: auto !important;
	}

	#header.ct-header .site-title-container {
		display: none;
	}

	#header.ct-header .ct-header-trigger {
		height: 36px !important;
		align-items: center !important;
	}

	/* Footer: widget columns are live (brand + Shop + Help & account +
	   Policies & legal). Scoped to the real markup: h5.wp-block-heading
	   titles and ul.wp-block-list links, not the generic .widget-title. */
	#footer.ct-footer [data-row="top"] > .ct-container {
		padding-top: var(--mz-space-lg) !important;
		padding-bottom: var(--mz-space-md) !important;
		row-gap: var(--mz-space-lg) !important;
	}

	#footer.ct-footer .mz-footer-logo img {
		width: 32px !important;
		height: 32px !important;
	}

	#footer.ct-footer .mz-footer-wordmark {
		font-size: 17px !important;
	}

	#footer.ct-footer .wp-block-heading {
		font-size: 13px !important;
		margin-bottom: var(--mz-space-sm) !important;
	}

	#footer.ct-footer .wp-block-list {
		gap: 8px !important;
	}

	#footer.ct-footer .wp-block-list a {
		font-size: 12px !important;
		line-height: 1.4 !important;
	}

	#footer.ct-footer .ct-footer-copyright {
		font-size: 11px !important;
	}

	/* Page-title banner (archive/page H1 hero): trim the oversized padding
	   that pushes content far below the header on mobile. */
	.entry-header.ct-container-narrow {
		min-height: 0 !important;
		padding-top: var(--mz-space-lg) !important;
		padding-bottom: var(--mz-space-md) !important;
	}

	.entry-header.ct-container-narrow .page-title {
		font-size: 28px !important;
	}

	/* ---------------------------------------------------------------
	   Mobile header overlays (bug report): tapping search blacked out
	   the whole page, the offcanvas menu had no background so nav text
	   showed over the hero with no contrast, and the cart icon's
	   hover-only dropdown flashed open broken/overlapping on tap.
	   --------------------------------------------------------------- */

	/* Search modal: swap the near-opaque dark scrim for a light,
	   on-brand card so the page stays visible behind it instead of
	   disappearing. */
	#search-modal.ct-panel {
		background: rgba(43, 32, 48, 0.45) !important;
		align-items: flex-start !important;
		padding-top: 96px !important;
	}

	#search-modal .ct-panel-content {
		width: 100%;
		max-width: 420px;
		margin: 0 auto;
		padding: 0 var(--mz-space-md);
	}

	#search-modal .ct-search-form-inner {
		background: var(--mz-surface) !important;
		border-radius: var(--mz-radius-md) !important;
		border-color: rgba(43, 32, 48, 0.15) !important;
		box-shadow: 0 10px 30px rgba(43, 32, 48, 0.18);
	}

	#search-modal input.modal-field {
		color: var(--mz-ink) !important;
	}

	#search-modal input.modal-field::placeholder {
		color: rgba(43, 32, 48, 0.5) !important;
	}

	#search-modal .ct-search-form button[type="submit"] {
		background: var(--mz-accent) !important;
	}

	#search-modal .ct-search-form button[type="submit"] svg {
		fill: #ffffff !important;
	}

	#search-modal .ct-toggle-close svg {
		fill: var(--mz-ink) !important;
	}

	/* Offcanvas mobile menu: the panel had no background color at all,
	   so the hero text showed through behind the white/blue nav links. */
	#offcanvas.ct-panel {
		background: var(--mz-ink) !important;
	}

	#offcanvas .ct-toggle-close svg {
		fill: #ffffff !important;
	}

	/* Header cart icon: its dropdown is a desktop :hover/:focus-within
	   panel. On tap it only flashes open, badly positioned, before the
	   tap finishes navigating to the cart page. Hide it below the
	   desktop breakpoint; the icon still links straight to the cart. */
	.ct-header-cart .ct-cart-content {
		display: none !important;
	}

	/* Benefits strip (#mz-benefits): each icon+text row was set to wrap,
	   so the text column (nearly full row width) couldn't fit beside the
	   icon and dropped to its own line, doubling every row's height and
	   leaving large empty gaps down the section. Keep icon and text on
	   one line and let the text wrap internally instead. */
	#mz-benefits .e-con-inner > .e-con.e-child {
		flex-wrap: nowrap !important;
	}

	#mz-benefits .e-con-inner > .e-con.e-child > .e-con.e-child {
		min-width: 0 !important;
		flex: 1 1 auto !important;
	}
}
