/* jk-mobile.css — mobile (<=749px) styling to match jkdesign.us
   Loaded AFTER jk.css so every rule here overrides desktop/base.
   Production reference (Shopify "Ride"): breakpoint 749px, tablet 750-989px,
   root 16px, mobile page gutter 1.5rem, home featured grid = 2-up,
   collection grid = 1-up, related/cross-sell = 2-up, add-to-cart full width. */

/* =========================================================================
   1. Global mobile guards (<=749px)
   ========================================================================= */
@media (max-width: 749px) {
	html, body, #page, .site, .site-content { max-width: 100%; overflow-x: hidden; }

	/* Consistent 1.5rem gutter to match production .page-width mobile padding. */
	.col-full {
		padding-left: 1.5rem !important;
		padding-right: 1.5rem !important;
	}

	/* Nothing should shoot past the viewport edge. */
	img, video, iframe, table { max-width: 100%; }
}

/* =========================================================================
   2. Header — hamburger LEFT, logo CENTER, cart RIGHT (production layout)
   Storefront nests the header in two separate .col-full wrappers, so we
   flatten them with display:contents and turn the <header> itself into one
   flex row, then use order to place the pieces.
   ========================================================================= */
@media (max-width: 749px) {
	.site-header {
		position: relative;
		display: flex !important;
		align-items: center;
		min-height: 58px;
		padding: .6em 1.5rem !important;
	}
	/* Flatten ONLY the wrapper divs so branding / nav / cart become the flex
	   children. We do NOT flatten nav.main-navigation itself — that would drop
	   the wide slide-down drawer into the header row and blow the layout width
	   out to ~500px (the drawer menu is nowrap ~452px). */
	.site-header > .col-full,
	.storefront-primary-navigation,
	.storefront-primary-navigation > .col-full {
		display: contents !important;
	}

	/* 1fr | auto | 1fr layout: nav (hamburger) claims the left third and
	   left-aligns, branding is the natural-width centre, cart claims the right
	   third and right-aligns. This centres the logo no matter what else is in
	   the row (mirrors production's grid-template-columns:auto 1fr auto). */
	.site-header nav.main-navigation {
		order: 1;
		flex: 1 1 0;
		display: flex;
		align-items: center;
		justify-content: flex-start;
		min-width: 0;
		width: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		background: transparent !important;
	}

	/* Hamburger toggle — 3-line icon, no aqua button chrome, no "MENU" text. */
	.site-header .menu-toggle {
		position: relative;
		width: 28px;
		height: 22px;
		padding: 0 !important;
		margin: 0 !important;
		background: transparent !important;
		color: var(--jk-text) !important;
		border: none !important;
		box-shadow: none !important;
		font-size: 0 !important;      /* hide the "Menu" label */
	}
	.site-header .menu-toggle::before {
		content: "";
		position: absolute;
		left: 3px;
		top: 3px;
		width: 22px;
		height: 2px;
		background: currentColor;
		box-shadow: 0 7px 0 currentColor, 0 14px 0 currentColor;
	}
	.site-header .menu-toggle:hover { color: var(--jk-aqua) !important; }

	/* Logo — natural-width centre column. */
	.site-header .site-branding {
		order: 2;
		flex: 0 0 auto;
		position: static;
		margin: 0 !important;
		padding: 0 !important;
		text-align: center;
	}
	.site-header .site-branding .site-title,
	.site-header .site-branding .site-description { display: none; }
	.site-header .custom-logo-link { display: inline-block; }
	.site-header .custom-logo,
	.site-header .custom-logo-link img { max-height: 40px !important; width: auto; }

	/* Cart — right third, right-aligned. */
	.site-header .site-header-cart {
		order: 3;
		flex: 1 1 0;
		min-width: 0;
		display: flex !important;
		justify-content: flex-end;
		align-items: center;
		margin: 0 !important;
		padding: 0 !important;
		width: auto !important;
		position: static !important;
	}
	/* Replace the "$0.00 / 0 items" text with a compact CSS-drawn shopping-bag
	   icon (Storefront ships no cart glyph in this build), matching
	   production's icon-only cart on the right. */
	.site-header .site-header-cart .cart-contents {
		position: relative;
		display: inline-block;
		width: 26px;
		height: 26px;
		padding: 0;
		color: var(--jk-text) !important;
		font-size: 0 !important;
		white-space: nowrap;
	}
	.site-header .site-header-cart .cart-contents .amount,
	.site-header .site-header-cart .cart-contents .count { display: none; }
	.site-header .site-header-cart .cart-contents::before {   /* bag body */
		content: "";
		position: absolute;
		left: 3px;
		bottom: 1px;
		width: 20px;
		height: 16px;
		border: 2px solid currentColor;
		/* jk.css's global `* { border-radius: 0 !important }` (styleguide Rule 1)
		   would otherwise square off this glyph — re-assert !important here so
		   the icon shape survives (higher specificity + !important wins). */
		border-radius: 2px !important;
	}
	.site-header .site-header-cart .cart-contents::after {    /* bag handle */
		content: "";
		position: absolute;
		left: 8px;
		top: 1px;
		width: 10px;
		height: 9px;
		border: 2px solid currentColor;
		border-bottom: none;
		border-radius: 50% 50% 0 0 !important; /* see note above */
	}
	.site-header .site-header-cart .cart-contents:hover { color: var(--jk-aqua) !important; }
	/* Mini-cart dropdown must never stretch the header row. */
	.site-header .site-header-cart .widget_shopping_cart_content { display: none; }

	/* Hide the desktop menu list + the header search widget on mobile. */
	.site-header .primary-navigation,
	.site-header .site-search { display: none !important; }

	/* Slide-down drawer: pulled OUT of flow, full width under the header row,
	   hidden until Storefront toggles it (.toggled / aria-expanded). */
	.site-header .handheld-navigation {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		z-index: 60;
		background: var(--jk-bg-2);
		border-top: 1px solid var(--jk-border);
		box-shadow: 0 12px 24px rgba(0,0,0,.4);
	}
	.site-header .main-navigation.toggled .handheld-navigation,
	.site-header .menu-toggle[aria-expanded="true"] ~ .handheld-navigation {
		display: block;
	}
	.site-header .handheld-navigation ul.menu,
	.site-header .handheld-navigation ul { width: 100%; margin: 0; }
	.site-header .handheld-navigation a {
		display: block;
		white-space: normal;
		padding: .85em 1.5rem;
		border-bottom: 1px solid var(--jk-border);
		color: var(--jk-text);
	}

	/* Production has no sticky bottom bar — remove Storefront's. */
	.storefront-handheld-footer-bar { display: none !important; }
	body.storefront-handheld-footer-bar,
	.site-content { padding-bottom: 0 !important; }
}

/* =========================================================================
   3. Announcement bar
   ========================================================================= */
@media (max-width: 749px) {
	.jk-announcement-bar a { padding: .6em 1em; font-size: .78rem; }
}

/* =========================================================================
   4. Hero (image-with-text): image on top, centered text below
   ========================================================================= */
@media (max-width: 749px) {
	.jk-hero { padding: 1.5rem 1.5rem 2.25rem; }   /* hero has no .col-full wrapper — add gutter */
	.jk-hero__inner {
		flex-direction: column;         /* media first (it's first in markup) */
		gap: 1.75rem;
		text-align: center;
	}
	.jk-hero__media {
		order: -1;                      /* image above text, like production */
		flex: 1 1 auto;
		width: 100%;
		padding: 1.25rem;
		/* flat corners now (styleguide Rule 1 / jk.css's global reset) */
	}
	.jk-hero__media img { max-width: 260px; }
	.jk-hero__text { flex: 1 1 auto; max-width: 100%; text-align: center; }
	.jk-hero__text h1 {
		/* bumped from 1.9rem: Chakra Petch runs narrower than Oswald did at
		   the same size, and jk.css now sets line-height:.92 on the desktop
		   rule (was 1.05) — loosen slightly on mobile so a 2-line wrap still
		   has clear letter/line separation at this width. */
		font-size: 2.05rem;
		line-height: .98;
		margin: 0 0 1rem;
	}
	.jk-hero__text p {
		font-size: .98rem;
		line-height: 1.6;
		margin-bottom: 1.4rem;
	}
	.jk-hero__text .jk-btn { padding: .6em 2.6em; }
}

/* =========================================================================
   5. Product grids
   Default mobile = 2-up (home featured, related, cross-sell).
   Collection / shop / category archives = 1-up (matches production).
   ========================================================================= */
@media (max-width: 749px) {
	.woocommerce ul.products,
	.jk-featured ul.products,
	ul.products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 1rem !important;
	}

	/* Archive listings are single column on production. */
	.woocommerce-shop ul.products,
	.post-type-archive-product ul.products,
	.tax-product_cat ul.products,
	.woocommerce-page.archive ul.products {
		grid-template-columns: 1fr !important;
	}

	.woocommerce ul.products li.product,
	ul.products li.product { box-sizing: border-box; }

	/* Card type scale — production card heading ~1.2-1.3rem. Bumped from
	   1.05rem/.95rem: Barlow Semi Condensed + Chakra Petch both run narrower
	   than Figtree/Oswald at the same px size. */
	.woocommerce ul.products li.product .woocommerce-loop-product__title,
	ul.products li.product h2,
	.woocommerce ul.products li.product h3 {
		font-size: 1.12rem;
		line-height: 1.18;
		padding-top: .5em;
	}
	.woocommerce ul.products li.product .price,
	ul.products li.product .price { font-size: 1rem; }
}

/* =========================================================================
   6. Shop / archive header (result count + ordering)
   ========================================================================= */
@media (max-width: 749px) {
	.woocommerce .woocommerce-result-count,
	.woocommerce .woocommerce-ordering {
		float: none;
		width: 100%;
		margin: 0 0 1rem;
	}
	.woocommerce .woocommerce-ordering select { width: 100%; }
	.woocommerce-page .page-title,
	.woocommerce .storefront-sorting { margin-bottom: 1rem; }
}

/* =========================================================================
   7. Single product page
   ========================================================================= */
@media (max-width: 749px) {
	.woocommerce div.product .images,
	.woocommerce div.product .summary {
		float: none !important;
		width: 100% !important;
		margin: 0 0 1.5rem !important;
	}
	/* Bumped from 1.7rem: condensed display face needs a bit more size to
	   carry the same visual weight as the old Oswald heading at this width. */
	.woocommerce div.product .product_title { font-size: 1.85rem; line-height: 1.05; }
	.woocommerce div.product p.price,
	.woocommerce div.product span.price { font-size: 1.3rem; }

	/* Quantity + Add-to-cart stack, button full width (production). */
	.woocommerce div.product form.cart { display: block; }
	.woocommerce div.product form.cart .quantity {
		float: none;
		display: block;
		margin: 0 0 .75rem;
	}
	.woocommerce div.product form.cart .quantity .qty { width: 5rem; }
	.woocommerce div.product form.cart .button,
	.woocommerce div.product form.cart .single_add_to_cart_button {
		float: none;
		display: block;
		width: 100%;
		padding: .9em 1em;
	}
	/* Variation selects full width */
	.woocommerce div.product form.cart .variations,
	.woocommerce div.product form.cart .variations td,
	.woocommerce div.product form.cart .variations select { width: 100%; }
	.woocommerce div.product form.cart .variations select { display: block; }

	/* Tabs stack tidily */
	.woocommerce div.product .woocommerce-tabs ul.tabs li { display: block; margin: 0 0 2px; }
}

/* =========================================================================
   8. Cart (+ empty-state cross-sell grid)
   ========================================================================= */
@media (max-width: 749px) {
	.woocommerce-cart table.cart,
	.woocommerce-cart table.cart tbody,
	.woocommerce-cart table.cart tr { display: block; width: 100%; }
	.woocommerce-cart .cart-collaterals,
	.woocommerce-cart .cart-collaterals .cart_totals { width: 100% !important; float: none; }

	.woocommerce .wc-proceed-to-checkout a.checkout-button,
	.woocommerce-cart table.cart td.actions .button { width: 100%; box-sizing: border-box; }

	/* Cross-sell / "New in store" cards should sit inside the gutter. */
	.woocommerce .cross-sells ul.products,
	.woocommerce .cart-empty ~ .woocommerce ul.products,
	.woocommerce ul.products { max-width: 100%; }
	.woocommerce ul.products li.product img { width: 100%; }
	.woocommerce-cart .cart-empty,
	.return-to-shop { text-align: center; }

	/* Empty-cart "New in store" recommendations render as a wc-block-grid
	   (Gutenberg Products block), not ul.products — style its cards/buttons to
	   match the rest of the shop. */
	.woocommerce-cart .wc-block-grid__products {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
		margin: 0;
	}
	.woocommerce-cart .wc-block-grid__product { margin: 0 !important; padding: 0 !important; max-width: 100%; }
	.woocommerce-cart .wc-block-grid__product-title { color: var(--jk-text); font-family: var(--jk-heading-font); text-transform: uppercase; font-size: 1rem; }
	.woocommerce-cart .wc-block-grid__product-price { color: var(--jk-text-muted); }
	.woocommerce-cart .wc-block-grid__products .wp-block-button__link {
		display: block;
		width: 100%;
		box-sizing: border-box;
		background: var(--jk-aqua) !important;
		color: var(--jk-bg-2) !important; /* was a stale hardcoded navy hex */
		font-family: var(--jk-heading-font);
		text-transform: uppercase;
		letter-spacing: .04em;
		font-weight: 600;
		/* flat corners now (styleguide Rule 1; jk.css's global reset would
		   zero this anyway, set explicitly here for clarity) */
	}
}

/* =========================================================================
   9. Contact form (Contact Form 7)
   ========================================================================= */
@media (max-width: 749px) {
	.wpcf7 { max-width: 100%; }
	.wpcf7 input[type="text"],
	.wpcf7 input[type="email"],
	.wpcf7 input[type="tel"],
	.wpcf7 input[type="number"],
	.wpcf7 textarea,
	.wpcf7 select {
		width: 100%;
		box-sizing: border-box;
		max-width: 100%;
	}
	.wpcf7 .wpcf7-submit { width: auto; }
}

/* =========================================================================
   10. Newsletter band
   ========================================================================= */
@media (max-width: 749px) {
	/* jk.css uses width:100vw + negative margins here; on mobile 100vw
	   (which includes the scrollbar / can exceed the layout width) creates a
	   feedback loop that widens the whole page. Pin it to normal flow width. */
	.jk-newsletter {
		width: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding: 2.5rem 1.5rem;
	}
	.jk-newsletter h2 { font-size: 1.6rem; }
	.jk-newsletter form { max-width: 100%; }
}

/* =========================================================================
   11. Footer — stack columns, center
   ========================================================================= */
@media (max-width: 749px) {
	.site-footer .col-full { display: block; }
	.site-footer .footer-widgets,
	.site-footer .footer-widget,
	.site-footer .widget {
		width: 100% !important;
		float: none !important;
		margin: 0 0 1.75rem;
		text-align: center;
	}
	.site-footer .site-info { text-align: center; }
}
