/**
 * Responsive — mobile is the priority breakpoint. Desktop rules above are
 * treated as the enhancement; here we adapt grids, typography and touch
 * targets down for phones/tablets and guarantee no horizontal scrolling.
 */

/* Global overflow guard */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe, table { max-width: 100%; }

/* ---- Large desktop / laptop (below 4K, above 1440) ---- */
@media (max-width: 1440px) {
	:root { --bz-container: 1200px; }
}

/* ---- Laptop / small desktop ---- */
@media (max-width: 1200px) {
	.woocommerce ul.products { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Tablet ---- */
@media (max-width: 991px) {
	.woocommerce ul.products { grid-template-columns: repeat(3, 1fr); gap: var(--bz-space-4); }

	.single-product div.product {
		grid-template-columns: 1fr;
		gap: var(--bz-space-6);
	}
	.woocommerce-product-gallery { position: static; }

	.woocommerce-checkout form.checkout {
		grid-template-columns: 1fr;
	}
	#order_review { position: static; order: -1; }

	.woocommerce-account .woocommerce {
		grid-template-columns: 1fr;
	}
	.woocommerce-MyAccount-navigation { position: static; }

	.woocommerce-Addresses,
	.u-columns.col2-set { grid-template-columns: 1fr; }
}

/* ---- Mobile ---- */
@media (max-width: 767px) {

	:root {
		--bz-space-7: 2rem;
		--bz-space-8: 2.5rem;
		--bz-space-9: 3.5rem;
	}

	/* Sticky, compact mobile header */
	.site-header {
		position: sticky;
		top: 0;
		z-index: var(--bz-z-header);
	}
	.header--row-inner { padding-top: var(--bz-space-2); padding-bottom: var(--bz-space-2); }
	.site-header .brand .site-title,
	.site-header .title-with-logo { font-size: 1.15rem; }

	/* 2-column product grid on phones, generous touch spacing */
	.woocommerce ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--bz-space-4) var(--bz-space-3);
	}
	.woocommerce ul.products li.product .woocommerce-loop-product__title {
		font-size: var(--bz-fs-xs);
	}

	.bz-shop-toolbar { flex-direction: column; align-items: flex-start; }

	/* Product page stacks; add-to-cart bar becomes a fixed bottom bar */
	.single-product .product_title { font-size: var(--bz-fs-xl); }
	.single-product form.cart {
		position: sticky;
		bottom: 0;
		background: var(--bz-surface);
		padding: var(--bz-space-3) var(--bz-space-4);
		margin: 0 calc(-1 * var(--bz-space-4)) var(--bz-space-4);
		border-top: 1px solid var(--bz-border);
		box-shadow: 0 -8px 24px rgba(20, 21, 26, 0.06);
		z-index: 20;
	}
	.single-product form.cart .single_add_to_cart_button { min-width: 0; }

	.woocommerce-tabs ul.tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		flex-wrap: nowrap;
		gap: var(--bz-space-4);
	}
	.woocommerce-tabs ul.tabs li a { white-space: nowrap; }

	/* Cart table -> stacked cards */
	.woocommerce-cart table.shop_table thead { display: none; }
	.woocommerce-cart table.shop_table,
	.woocommerce-cart table.shop_table tbody,
	.woocommerce-cart table.shop_table tr,
	.woocommerce-cart table.shop_table td {
		display: block;
		width: 100%;
	}
	.woocommerce-cart table.shop_table tr {
		border: 1px solid var(--bz-border);
		border-radius: var(--bz-radius-md);
		padding: var(--bz-space-3);
		margin-bottom: var(--bz-space-3);
	}
	.woocommerce-cart table.shop_table td { border: none; padding: var(--bz-space-1) 0; }
	.woocommerce-cart table.shop_table td.product-thumbnail { display: inline-block; }

	.cart-collaterals .cart_totals { width: 100%; float: none; }

	/* Checkout inputs full width & bigger tap targets */
	.woocommerce-checkout input[type="text"],
	.woocommerce-checkout input[type="email"],
	.woocommerce-checkout input[type="tel"],
	.woocommerce-checkout select {
		width: 100%;
		font-size: 16px; /* prevents iOS auto-zoom on focus */
		padding: 0.95em 1em;
	}
	.woocommerce-checkout #customer_details,
	#order_review { padding: var(--bz-space-4); }

	/* Ensure every tappable control meets a 44px minimum target */
	.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.bz-qty-btn,
	.nv-nav-wrap .menu-item > a,
	.cart-icon-wrapper {
		min-height: 44px;
	}

	.footer-row-wrapper { padding: var(--bz-space-6) 0; }
	.bz-footer-legal { flex-direction: column; align-items: flex-start; }
	.bz-newsletter form { flex-direction: column; }
}

/* ---- Small phones ---- */
@media (max-width: 420px) {
	.woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: var(--bz-space-3); }
	h1, .h1 { font-size: 1.9rem; }
}
