/*
Theme Name: Cosmetics Raw
Author: Hussnain Traders
Description: Catalogue theme for Cosmetics Raw (cosmetic raw materials, Lahore). Orders over WhatsApp via the cosmeticsraw-whatsapp plugin.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: cosmeticsraw
*/

/* ---------- Tokens (colours from the logo) ---------- */
:root {
	--green: #2f5a46;
	--green-dark: #1e3a2d;
	--sage: #7fa08e;
	--sage-soft: #eef4f0;
	--ink: #1c2420;
	--muted: #5b6b63;
	--line: #dde6e0;
	--bg: #ffffff;
	--wa: #25d366;
	--wa-dark: #1da851;
	--radius: 12px;
	--wrap: 1200px;
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text, .skip { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip:focus { left: 16px; top: 16px; width: auto; height: auto; background: #fff; padding: 8px 12px; z-index: 1000; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.4em; border-radius: 999px; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; border: 0; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-dark); color: #fff; }
.btn svg { flex: none; }

/* ---------- Top bar + header ---------- */
.topbar { background: var(--green-dark); color: #dfeae4; font-size: 13px; }
.topbar__in { display: flex; justify-content: space-between; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #fff; font-weight: 600; text-decoration: none; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header__in { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand__logo { width: 68px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 19px; color: var(--green-dark); }
.brand__text small { font-size: 12.5px; color: var(--muted); }
.header__search { flex: 1 1 260px; max-width: 360px; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: 4px; }
.site-nav a { white-space: nowrap; display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; border-radius: 8px; }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--green); background: var(--sage-soft); }
.site-nav .menu-item-has-children { position: relative; }
.site-nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.site-nav .sub-menu { position: absolute; top: 100%; left: 0; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(20, 40, 30, .12); padding: 8px; display: none; }
.site-nav .menu-item-has-children:hover > .sub-menu, .site-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
.icon-btn { display: none; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; border-radius: 8px; }
.icon-btn svg { display: block; }
.search-mobile { border-top: 1px solid var(--line); padding: 12px 0; }

/* Search form */
.sform { display: flex; align-items: center; background: var(--sage-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 3px 3px 16px; }
.sform input[type="search"] { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; padding: 8px 0; color: var(--ink); outline: none; }
.sform button { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sform:focus-within { border-color: var(--sage); }

/* ---------- Home ---------- */
.hero { background: linear-gradient(180deg, var(--sage-soft), #fff); }
.hero__in { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: .8em; }
.hero h1 { max-width: 16em; }
.hero__lead { font-size: 18px; color: var(--muted); max-width: 34em; }
.hero__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__logo { display: flex; justify-content: center; }
.hero__logo img { width: min(100%, 380px); }

.feats { border-bottom: 1px solid var(--line); }
.feats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.feat { display: flex; flex-direction: column; padding-left: 14px; border-left: 3px solid var(--sage); }
.feat strong { font-size: 16px; }
.feat span { font-size: 14px; color: var(--muted); }

.section { padding: 56px 0; }
.section--tint { background: var(--sage-soft); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.section__head h2 { margin: 0; }
.link-more { font-weight: 600; text-decoration: none; white-space: nowrap; }

.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.cat:hover { border-color: var(--sage); box-shadow: 0 8px 24px rgba(20, 40, 30, .08); color: var(--ink); }
.cat strong { font-size: 17px; color: var(--green-dark); }
.cat__desc { font-size: 14px; color: var(--muted); line-height: 1.5; flex: 1; }
.cat__count { font-size: 13px; font-weight: 600; color: var(--green); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 20px 64px; position: relative; border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { content: counter(step); position: absolute; left: 20px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; }
.steps span { color: var(--muted); font-size: 15px; }

.faqs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; align-items: start; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 24px 16px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 22px; color: var(--green); line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--muted); font-size: 15px; margin: 0 0 16px; }

.cta { background: var(--green-dark); color: #e6efe9; }
.cta__in { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 44px; padding-bottom: 44px; }
.cta h2 { color: #fff; margin-bottom: .3em; }
.cta p { margin: 0; }

/* ---------- Shop / category ---------- */
.wc-wrap, .page-wrap { padding-top: 24px; padding-bottom: 64px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 8px; }
.page-head { margin-bottom: 20px; }
.page-head__desc { color: var(--muted); max-width: 46em; }
.page-head__desc p { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); text-decoration: none; background: #fff; }
.chip:hover { border-color: var(--sage); color: var(--green); }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }

.woocommerce ul.products { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { margin: 0; width: auto; float: none; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: left; padding: 0 0 16px; }
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display: flex; flex-direction: column; flex: 1; color: var(--ink); text-decoration: none; }
.woocommerce ul.products li.product img, .woocommerce ul.products li.product .ph { margin: 0 0 14px; }
.woocommerce ul.products li.product .card-cat { display: block; font-size: 12.5px; color: var(--green); font-weight: 600; padding: 0 16px; margin-bottom: 2px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 16px; font-weight: 600; padding: 0 16px; margin: 0 0 6px; line-height: 1.35; }
.woocommerce ul.products li.product .price { display: block; padding: 0 16px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.woocommerce ul.products li.product .crw-wa-btn--small { margin: auto 16px 0; width: auto; }

/* Image placeholder: name tile until real photos are added */
.ph { aspect-ratio: 4 / 3; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 16px; text-align: center; background: linear-gradient(135deg, var(--sage-soft), #dfe9e3); color: var(--green-dark); border-bottom: 1px solid var(--line); }
.ph__name { font-weight: 700; font-size: 18px; line-height: 1.25; }
.ph__brand { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ph--lg { aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: var(--radius); }
.ph--lg .ph__name { font-size: 30px; }

/* ---------- Single product ---------- */
.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.woocommerce div.product div.images, .woocommerce div.product div.summary { width: auto; float: none; margin: 0; }
.woocommerce div.product div.images img { border-radius: var(--radius); }
.woocommerce div.product .product_title { font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 8px; }
.woocommerce div.product p.price { font-size: 16px; margin-bottom: 12px; }
.woocommerce div.product .woocommerce-product-details__short-description { color: var(--muted); }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product .related { grid-column: 1 / -1; }
.woocommerce div.product .woocommerce-tabs ul.tabs { display: flex; gap: 4px; padding: 0; margin: 0 0 16px; border-bottom: 1px solid var(--line); list-style: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before, .woocommerce div.product .woocommerce-tabs ul.tabs li::before, .woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { background: none; border: 0; border-radius: 0; margin: 0; padding: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { display: block; padding: 10px 16px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--green); border-bottom-color: var(--green); }
.woocommerce div.product .woocommerce-tabs .panel { margin: 0; }
.woocommerce div.product .woocommerce-tabs .panel > h2:first-child { display: none; }
.details { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 15px; }
.details th, .details td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.details th { width: 34%; background: var(--sage-soft); font-weight: 600; }
.related > h2 { margin-top: 24px; }
.crw-order { max-width: 100% !important; }

/* ---------- Location pages ---------- */
.loc { padding-top: 24px; padding-bottom: 48px; }
.loc__top { margin-bottom: 48px; }
.loc__top .section__head h2 { font-size: clamp(20px, 2.2vw, 26px); }
.loc__text a, .prose a { color: var(--green); font-weight: 600; text-decoration: underline; text-decoration-color: var(--sage); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.loc__text a:hover, .prose a:hover { color: var(--green-dark); text-decoration-color: currentColor; }
.loc__text h2 { font-size: 22px; margin-top: 28px; }
.loc__text h2:first-child { margin-top: 0; }
.loc__head { margin-bottom: 28px; }
.loc__head h1 { max-width: 20em; }
.loc__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.loc__text p { color: #34423b; }
.loc__delivery { background: var(--sage-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 110px; }
.loc__delivery h2 { font-size: 20px; }
.loc__delivery ul, .loc__delivery ol { padding-left: 1.2em; margin: 0 0 18px; display: grid; gap: 8px; font-size: 15px; }
.loc__delivery .btn { width: 100%; }
.loc__section { margin-top: 48px; }
.loc__links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.loc__links a { display: block; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 500; background: #fff; }
.loc__links a:hover { border-color: var(--sage); color: var(--green); }
.loc__group { font-size: 16px; color: var(--green); margin: 20px 0 10px; }
.loc__section .cats .cat { padding: 16px; }
.loc__why { padding: 0; }
.chips--loc { gap: 10px; margin: 0; }
.chips--loc .chip { padding: 9px 18px; font-size: 15px; font-weight: 500; }
.chips--loc .chip--near { border-color: var(--sage); color: var(--green-dark); }
.chips--loc .chip--all { background: var(--sage-soft); border-color: transparent; color: var(--green); font-weight: 600; }

/* ---------- Pages ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 20px 0; }
.contact-cards > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.empty { max-width: 560px; }
.empty .sform { margin: 16px 0; }
.post-list { padding-left: 1.2em; }
.woocommerce-info, .woocommerce-message { border-top-color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: #13251d; color: #c6d6cd; font-size: 15px; }
.section__lead { color: var(--muted); margin: -12px 0 18px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr .8fr .8fr 1fr; gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.brand--footer { margin-bottom: 14px; }
.brand--footer .brand__logo { background: #fff; border-radius: 50%; padding: 4px; width: 72px; }
.brand--footer .brand__text strong { color: #fff; }
.brand--footer .brand__text small { color: #9fb5a8; }
.footer__h { font-size: 15px; color: #fff; margin-bottom: 12px; }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: #e3ede7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer__contact a { display: inline-flex; align-items: center; gap: 6px; }
.footer__small { font-size: 14px; color: #9fb5a8; }
.social { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.social a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.social svg { flex: none; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; padding-bottom: 24px; font-size: 13px; color: #9fb5a8; }

/* ---------- Narrow desktop: search becomes an icon so the menu fits on one line ---------- */
@media (max-width: 1280px) {
	.header__search { display: none; }
	.search-toggle { display: block; }
	.header__in { gap: 16px; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
	.woocommerce ul.products, .cats { grid-template-columns: repeat(3, 1fr); }
	.footer__grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Phone (rules: menu left, logo centre, search icon right; small hero; tight sections) ---------- */
@media (max-width: 900px) {
	.wrap { padding: 0 16px; }
	.topbar { display: none; }
	.header__in { min-height: 64px; gap: 8px; display: grid; grid-template-columns: 44px 1fr 44px; }
	.menu-toggle { display: block; grid-column: 1; }
	.brand { grid-column: 2; justify-self: center; gap: 8px; }
	.brand__logo { width: 48px; }
	.brand__text strong { font-size: 16px; }
	.brand__text small { font-size: 11.5px; }
	.search-toggle { grid-column: 3; justify-self: end; }
	.header__wa { display: none; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(20, 40, 30, .1); max-height: calc(100vh - 64px); overflow-y: auto; margin: 0; }
	.nav-open .site-nav { display: block; }
	.site-nav > ul { flex-direction: column; gap: 0; padding: 8px 16px 16px; }
	.site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
	.site-nav .sub-menu { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 0 12px; min-width: 0; }
	.site-nav .menu-item-has-children:hover > .sub-menu { display: none; }
	.site-nav .menu-item-has-children.open > .sub-menu { display: block; }

	.hero__in { grid-template-columns: 1fr; gap: 0; padding-top: 28px; padding-bottom: 32px; }
	.hero h1 { font-size: 28px; }
	.hero__lead { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
	.hero__logo { display: none; }
	.hero__btns { flex-wrap: nowrap; gap: 8px; margin-top: 16px; }
	.hero__btns .btn { flex: 1 1 0; padding: .8em .6em; font-size: 14px; }

	.feats__grid { grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
	.feat strong { font-size: 15px; }
	.feat span { font-size: 13px; }

	.section { padding: 32px 0; }
	.section__head { margin-bottom: 16px; }
	.cats { grid-template-columns: 1fr 1fr; gap: 10px; }
	.cat { padding: 14px; }
	.cat strong { font-size: 15px; }
	.cat__desc { display: none; }
	.steps { grid-template-columns: 1fr; gap: 10px; }
	.faqs { grid-template-columns: 1fr; }
	.cta__in { flex-direction: column; align-items: flex-start; padding-top: 32px; padding-bottom: 32px; }

	.woocommerce ul.products { grid-template-columns: 1fr 1fr; gap: 12px; }
	.woocommerce ul.products li.product { padding-bottom: 12px; }
	.woocommerce ul.products li.product .card-cat { padding: 0 12px; font-size: 11.5px; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 14px; padding: 0 12px; }
	.woocommerce ul.products li.product .price { padding: 0 12px; font-size: 13px; }
	.woocommerce ul.products li.product .crw-wa-btn--small { margin: auto 12px 0; font-size: 13px; padding: .55em .6em; }
	/* Top products: one row you swipe sideways instead of 8 rows of cards */
	.product-row ul.products { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; gap: 12px; margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: thin; }
	.product-row ul.products li.product { flex: 0 0 44%; scroll-snap-align: start; }
	.ph__name { font-size: 15px; }
	.ph--lg { aspect-ratio: 16 / 9; }
	.ph--lg .ph__name { font-size: 24px; }

	.woocommerce div.product { grid-template-columns: 1fr; gap: 20px; }
	.details th { width: 40%; }
	.details th, .details td { padding: 9px 10px; font-size: 14px; }
	.contact-cards { grid-template-columns: 1fr; }
	.loc { padding-top: 16px; padding-bottom: 32px; }
	.loc__head h1 { font-size: 28px; }
	.loc__head .hero__btns { flex-wrap: nowrap; }
	.loc__head .hero__btns .btn { flex: 1 1 0; padding: .8em .6em; font-size: 14px; }
	.loc__grid { grid-template-columns: 1fr; gap: 20px; }
	.loc__delivery { position: static; padding: 18px; }
	.loc__section { margin-top: 32px; }
	.loc__links { grid-template-columns: 1fr 1fr; gap: 8px; }
	.loc__links a { padding: 10px 12px; font-size: 14px; }
	.footer__grid { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
	.footer__bottom { padding-bottom: 88px; } /* room for the floating WhatsApp button */
}
