/*
Theme Name:   ZAH Storefront
Theme URI:    https://zah.com.pk
Description:  Child theme of Storefront for ZAH. Brand styling, a single-product homepage, and cash-on-delivery reassurance built in. Editable settings live under Appearance > Customize > ZAH.
Author:       ZAH
Template:     storefront
Version:      1.0.2
Requires PHP: 7.4
Text Domain:  zah-storefront
*/

/* ==========================================================================
   Brand tokens — change these to restyle the whole site.
   ========================================================================== */
:root {
	--zah-ink:        #141414;  /* logo black */
	--zah-ink-soft:   #52504c;
	--zah-accent:     #e0931a;  /* logo marigold - decorative only */
	--zah-accent-dk:  #8a5a0b;  /* marigold darkened for link text (passes contrast) */
	--zah-accent-lt:  #fdf3e2;
	--zah-leaf:       #4f7a43;  /* logo leaf green */
	--zah-lavender:   #efecf7;  /* nod to the lavender scent */
	--zah-sand:       #faf8f4;
	--zah-line:       #e8e3da;
	--zah-white:      #ffffff;
	--zah-success:    #1f7a44;
	--zah-radius:     10px;
	--zah-shadow:     0 1px 2px rgba(20,20,20,.06), 0 8px 24px rgba(20,20,20,.07);
	--zah-maxw:       1120px;
}

/* ==========================================================================
   Base
   ========================================================================== */
body,
body.woocommerce-page {
	background: var(--zah-white);
	color: var(--zah-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
}

h1, h2, h3, h4, .site-title {
	color: var(--zah-ink);
	letter-spacing: -0.015em;
	line-height: 1.2;
}

a { color: var(--zah-accent); }
a:hover { color: var(--zah-accent-dk); }

.col-full { max-width: var(--zah-maxw); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	background: var(--zah-white);
	border-bottom: 1px solid var(--zah-line);
	padding-top: 1.4em;
	padding-bottom: 0;
}

.site-header .site-branding .site-title a,
.site-header .beta.site-title a {
	color: var(--zah-ink);
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-size: 1.1em;
}

.storefront-primary-navigation { background: transparent; }

.main-navigation ul.menu > li > a,
.main-navigation ul.nav-menu > li > a {
	color: var(--zah-ink);
	font-weight: 600;
	font-size: .94em;
	padding: 1em .9em;
}
.main-navigation ul.menu > li > a:hover { color: var(--zah-accent); }

.site-header-cart .cart-contents { color: var(--zah-ink); font-weight: 600; }
.site-header-cart .cart-contents:hover { color: var(--zah-accent); }

/* Announcement strip above the header */
.zah-topbar {
	background: var(--zah-ink);
	color: #e9efed;
	font-size: .82rem;
	letter-spacing: .02em;
	text-align: center;
	padding: .55em 1em;
}
.zah-topbar strong { color: var(--zah-white); font-weight: 600; }

/* ==========================================================================
   Buttons
   ========================================================================== */
button, .button,
input[type="submit"],
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	background: var(--zah-ink);
	color: var(--zah-white);
	border-radius: var(--zah-radius);
	font-weight: 650;
	letter-spacing: .01em;
	padding: .85em 1.5em;
	border: 0;
	transition: background .15s ease, transform .08s ease;
}
button:hover, .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
	background: #000;
	color: var(--zah-white);
}
button:active, .woocommerce button.button:active { transform: translateY(1px); }

.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt {
	background: var(--zah-ink);
	color: var(--zah-white);
}
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce input.button.alt:hover { background: #000; }

.woocommerce .single_add_to_cart_button {
	font-size: 1.05em;
	padding: 1em 2em;
	width: 100%;
	max-width: 420px;
}

/* ==========================================================================
   Single product
   ========================================================================== */
.woocommerce div.product .product_title { font-size: 2.1em; margin-bottom: .25em; }

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--zah-ink);
	font-size: 1.65em;
	font-weight: 700;
}

.woocommerce div.product .woocommerce-product-details__short-description {
	color: var(--zah-ink-soft);
	font-size: 1.04em;
	margin-bottom: 1.4em;
}

.woocommerce div.product form.cart { margin-bottom: 1.5em; }

.woocommerce .quantity .qty {
	border: 1px solid var(--zah-line);
	border-radius: var(--zah-radius);
	padding: .7em .4em;
	background: var(--zah-white);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	border-bottom-color: var(--zah-accent);
	background: transparent;
}

.woocommerce-breadcrumb { color: var(--zah-ink-soft); font-size: .86em; }

/* Reassurance block under the add-to-cart button */
.zah-assurance {
	border: 1px solid var(--zah-line);
	border-radius: var(--zah-radius);
	background: var(--zah-sand);
	padding: 1.1em 1.25em;
	margin: 0 0 1.6em;
	max-width: 480px;
}
.zah-assurance ul { list-style: none; margin: 0; padding: 0; }
.zah-assurance li {
	display: flex;
	align-items: flex-start;
	gap: .65em;
	font-size: .93em;
	color: var(--zah-ink);
	padding: .3em 0;
}
.zah-assurance li svg { flex: 0 0 auto; margin-top: .22em; color: var(--zah-accent); }

/* WhatsApp order button beside add-to-cart */
.zah-whatsapp-order {
	display: inline-flex;
	align-items: center;
	gap: .55em;
	background: #1fa855;
	color: #fff !important;
	border-radius: var(--zah-radius);
	padding: .9em 1.6em;
	font-weight: 650;
	text-decoration: none;
	margin-bottom: 1.4em;
}
.zah-whatsapp-order:hover { background: #17893f; color: #fff !important; }

/* Floating WhatsApp bubble */
.zah-wa-float {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 9999;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: #1fa855;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.zah-wa-float:hover { background: #17893f; }

/* ==========================================================================
   Shop / product cards
   ========================================================================== */
.woocommerce ul.products li.product {
	background: var(--zah-white);
	border: 1px solid var(--zah-line);
	border-radius: var(--zah-radius);
	padding: 1em;
	transition: box-shadow .18s ease;
}
.woocommerce ul.products li.product:hover { box-shadow: var(--zah-shadow); }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 1.02em;
	font-weight: 650;
	padding-bottom: .3em;
}
.woocommerce ul.products li.product .price { color: var(--zah-ink); font-weight: 650; }

/* ==========================================================================
   Checkout — COD friendly
   ========================================================================== */
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 { float: none; width: 100%; }

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.select2-container .select2-selection--single {
	border: 1px solid var(--zah-line);
	border-radius: var(--zah-radius);
	padding: .8em .9em;
	background: var(--zah-white);
	font-size: 1em;
}
.woocommerce form .form-row label { font-weight: 600; font-size: .92em; }

.woocommerce-checkout #payment { background: var(--zah-sand); border-radius: var(--zah-radius); }
.woocommerce-checkout #payment div.payment_box { background: var(--zah-accent-lt); color: var(--zah-ink); }
.woocommerce-checkout #payment div.payment_box::before { border-bottom-color: var(--zah-accent-lt); }

.woocommerce .woocommerce-info,
.woocommerce .woocommerce-message {
	border-top-color: var(--zah-accent);
	background: var(--zah-sand);
}
.woocommerce .woocommerce-info::before,
.woocommerce .woocommerce-message::before { color: var(--zah-accent); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
	background: var(--zah-ink);
	color: #c8d3d0;
	font-size: .92em;
}
.site-footer a { color: var(--zah-white); }
.site-footer a:hover { color: var(--zah-accent-lt); }
.site-footer h2, .site-footer h3, .site-footer .widget-title { color: var(--zah-white); }

.zah-footer-note {
	border-top: 1px solid rgba(255,255,255,.12);
	margin-top: 1.5em;
	padding-top: 1.2em;
	font-size: .86em;
	color: #9fb0ac;
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 767px) {
	.woocommerce div.product .product_title { font-size: 1.55em; }
	.woocommerce div.product p.price { font-size: 1.4em; }
	.woocommerce .single_add_to_cart_button { max-width: 100%; }
	.zah-whatsapp-order { width: 100%; justify-content: center; }
	.col-full { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================================
   Homepage
   ========================================================================== */
.zah-home section { margin-bottom: 3rem; }

.zah-bleed {
	background: var(--zah-sand);
	border-radius: 16px;
	padding: 3rem 2.25rem;
}

/* Hero */
.zah-hero__inner {
	display: grid;
	grid-template-columns: 1.05fr .95fr;
	gap: 2.5rem;
	align-items: center;
}
.zah-hero__title {
	font-size: clamp(2rem, 4.2vw, 3.1rem);
	font-weight: 800;
	margin: 0 0 .6em;
}
.zah-hero__sub {
	font-size: 1.1rem;
	color: var(--zah-ink-soft);
	max-width: 34em;
	margin-bottom: 1.8em;
}
.zah-hero__actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin: 0; }
.zah-hero__price { font-weight: 700; font-size: 1.15rem; color: var(--zah-ink); }
.zah-hero__media img { border-radius: 12px; display: block; width: 100%; height: auto; }
.zah-hero__placeholder {
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--zah-accent-lt), var(--zah-lavender));
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px dashed var(--zah-accent);
}
.zah-hero__placeholder span {
	font-weight: 800;
	letter-spacing: .2em;
	color: var(--zah-accent-dk);
	font-size: 1.5rem;
}

/* Trust strip */
.zah-trust {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	border-block: 1px solid var(--zah-line);
	padding: 1.25rem 0;
}
.zah-trust__item {
	display: flex;
	align-items: flex-start;
	gap: .6rem;
	font-size: .95rem;
	color: var(--zah-ink);
}
.zah-trust__item svg { flex: 0 0 auto; margin-top: .25em; color: var(--zah-accent); }

/* Featured product */
.zah-product {
	display: grid;
	grid-template-columns: .9fr 1.1fr;
	gap: 2.5rem;
	align-items: center;
}
.zah-product__media img { border-radius: 12px; width: 100%; height: auto; display: block; }
.zah-product h2 { font-size: 1.9rem; margin: 0 0 .3em; }
.zah-product__price { font-size: 1.4rem; font-weight: 700; margin: 0 0 1rem; }
.zah-product__excerpt { color: var(--zah-ink-soft); }

/* Steps */
.zah-steps { background: var(--zah-ink); color: #dce6e3; }
.zah-steps h2 { color: var(--zah-white); margin-top: 0; font-size: 1.7rem; }
.zah-steps__list {
	list-style: none;
	margin: 1.8rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}
.zah-steps__list li { margin: 0; }
.zah-steps__n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--zah-accent);
	color: #141414;
	font-weight: 700;
	margin-bottom: .8rem;
}
.zah-steps__list h3 { color: var(--zah-white); font-size: 1.08rem; margin: 0 0 .4em; }
.zah-steps__list p { color: #b6c6c2; font-size: .95rem; margin: 0; }

/* FAQ */
.zah-faq h2 { font-size: 1.7rem; margin-bottom: 1.4rem; }
.zah-faq__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem 2.5rem; }
.zah-faq__grid h3 { font-size: 1.05rem; margin: 0 0 .35em; }
.zah-faq__grid p { color: var(--zah-ink-soft); margin: 0; font-size: .97rem; }

@media (max-width: 860px) {
	.zah-hero__inner,
	.zah-product { grid-template-columns: 1fr; gap: 1.8rem; }
	.zah-hero__media { order: -1; }
	.zah-trust,
	.zah-steps__list,
	.zah-faq__grid { grid-template-columns: 1fr; gap: 1rem; }
	.zah-bleed { padding: 2rem 1.25rem; }
	.zah-steps__list { gap: 1.6rem; }
}

/* Footer navigation */
.zah-footer-nav {
	display: flex;
	flex-wrap: wrap;
	gap: .5em 1.75em;
	padding-bottom: .5em;
}
.zah-footer-nav a {
	color: #dce6e3;
	text-decoration: none;
	font-size: .93em;
	border-bottom: 1px solid transparent;
}
.zah-footer-nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,.4); }

/* Keep the logo to a sensible header height */
.site-header .custom-logo-link img,
.site-branding .custom-logo { max-height: 92px; width: auto; }
@media (max-width: 767px) {
	.site-header .custom-logo-link img,
	.site-branding .custom-logo { max-height: 60px; }
}

/* ==========================================================================
   Centred header logo
   ========================================================================== */
/* Storefront floats .site-branding left and .site-search right, so the logo
   sits hard against the left edge. Centring the text inside the branding
   block alone is not enough: its line box shrinks to clear the search float,
   which lands the logo about 130px left of true centre. The row is laid out
   as a flex row instead, with an empty ::before mirroring the search's width
   on the opposite side.

   Two details that look like noise but are not:
   - The child combinator. The primary navigation row below has a .col-full
     of its own, holding the menu and the cart, and it must keep Storefront's
     float layout.
   - The `div.` in the selectors. Storefront sets float, width and
     margin-right on .site-branding from a rule that outranks a plain
     `.site-header .site-branding`, so the override has to be more specific. */
@media (min-width: 768px) {
	.site-header > .col-full {
		/* Storefront's own width for .site-search, mirrored on the left. */
		--zah-header-side: 21.7391304348%;
		display: flex;
		align-items: center;
		/* Stands in for the bottom margin dropped from .site-branding below,
		   so the gap above the navigation row is unchanged. */
		padding-bottom: 1.4em;
	}
	.site-header > .col-full::before {
		content: "";
		display: block;
		flex: 0 0 var(--zah-header-side);
	}
	.site-header > .col-full > div.site-branding {
		flex: 1 1 auto;
		float: none;
		width: auto;
		margin: 0;
		text-align: center;
	}
	/* The logo link is a block with its own text-align, so it does not
	   inherit the centring above. */
	.site-header > .col-full > div.site-branding .custom-logo-link {
		display: inline-block;
	}
	.site-header > .col-full > div.site-search {
		flex: 0 0 var(--zah-header-side);
		float: none;
		width: auto;
		margin: 0;
	}
}

/* On mobile the search is hidden and the menu button sits in the navigation
   row, so the branding is the only thing in this row. Unfloating it to full
   width centres the logo; the Menu button moves onto its own line below. */
@media (max-width: 767px) {
	.site-header > .col-full > div.site-branding {
		float: none;
		width: 100%;
		margin: 0;
		text-align: center;
	}
	.site-header > .col-full > div.site-branding .custom-logo-link {
		display: inline-block;
	}
}

/* ==========================================================================
   Right-aligned primary menu
   ========================================================================== */
/* The menu sits in the navigation row with the cart floated right after it.
   The list items are inline-blocks, so text-align on the list is enough to
   push them over; no float or width change is needed, which keeps the row
   height and the cart's position exactly as Storefront had them.

   The margin-left reset matters: Storefront pulls the list 16px left so the
   FIRST link's text lines up with the page's left content edge. Right-aligned
   that pull only eats into the gap before the cart, so it goes. */
@media (min-width: 768px) {
	.storefront-primary-navigation .main-navigation ul.nav-menu {
		text-align: right;
		margin-left: 0;
	}
}
