/* eMarigiti child theme: mobile-first. Tokens come from theme.json (--wp--preset--color--*). */
:root {
	--emg-green: var(--wp--preset--color--accent-1);
	--emg-amber: var(--wp--preset--color--accent-2);
	--emg-red: var(--wp--preset--color--accent-3);
	--emg-muted: var(--wp--preset--color--accent-4);
	--emg-surface: var(--wp--preset--color--accent-5);
	--emg-border: var(--wp--preset--color--accent-6);
	--emg-radius: 10px;
	--emg-bar-h: 60px;
}
body { padding-bottom: calc(var(--emg-bar-h) + env(safe-area-inset-bottom)); }
:where(a, button, input, select, summary):focus-visible { outline: 3px solid var(--emg-amber); outline-offset: 2px; }
.emg-icon { width: 22px; height: 22px; flex: none; }

/* Header */
.emg-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--emg-border); padding-top: 8px; padding-bottom: 6px; }
.emg-header > * { margin-block: 0; }
.emg-header__row { gap: 8px; align-items: center; }
.emg-logo { font-size: 1.3rem; font-weight: 800; margin: 0; }
.emg-logo a { color: var(--emg-green); text-decoration: none; }
.emg-header-links { display: flex; gap: 14px; align-items: center; font-size: .875rem; }
.emg-header-links a { display: inline-flex; gap: 4px; align-items: center; color: inherit; text-decoration: none; min-height: 44px; }
.emg-header-links .emg-sell { display: none; color: var(--emg-green); font-weight: 600; }
.emg-header-links a span { display: none; }
.emg-search { margin-top: 6px !important; }
.emg-search .wp-block-search__inside-wrapper { border: 2px solid var(--emg-green); border-radius: 999px; padding: 2px; background: #fff; }
.emg-search .wp-block-search__input { border: 0; padding: 10px 14px; font-size: 16px; min-height: 44px; background: transparent; }
.emg-search .wp-block-search__button { border-radius: 999px; background: var(--emg-green); color: #fff; padding: 8px 16px; margin: 0; font-weight: 600; }

/* Departments */
.emg-departments ul { list-style: none; margin: 0; padding: 0; }
.emg-departments--chips ul { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.emg-departments--chips ul::-webkit-scrollbar { display: none; }
.emg-departments--chips a { display: inline-block; white-space: nowrap; padding: 8px 12px; min-height: 36px; border: 1px solid var(--emg-border); border-radius: 999px; font-size: .875rem; color: inherit; text-decoration: none; background: #fff; }
.emg-departments--chips a[aria-current="page"] { background: var(--emg-green); border-color: var(--emg-green); color: #fff; }
.emg-departments--grid ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.emg-departments--grid a { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--emg-border); border-radius: var(--emg-radius); color: inherit; text-decoration: none; background: var(--emg-surface); min-height: 64px; }
.emg-dept-badge { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--emg-green); color: #fff; font-weight: 700; }
.emg-dept-name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.emg-dept-count { color: var(--emg-muted); font-size: .8rem; }

/* Home */
.emg-trust { list-style: none; padding: 10px 0; margin: 8px 0 0; display: flex; gap: 8px; overflow-x: auto; font-size: .8rem; color: var(--emg-muted); }
.emg-trust { scrollbar-width: none; }
.emg-trust::-webkit-scrollbar { display: none; }
.emg-trust li { white-space: nowrap; padding: 6px 10px; background: var(--emg-surface); border-radius: 999px; }
.emg-trust li::before { content: "✓ "; color: var(--emg-green); font-weight: 700; }
.emg-section-title, .emg-home-section h2 { font-size: 1.2rem; margin: 20px 0 10px; }
.emg-home-section__head { display: flex; justify-content: space-between; align-items: baseline; }
.emg-home-section__head a { font-size: .9rem; font-weight: 600; }

/* Product grid (classic loop and [products]): 2 columns on phones */
.woocommerce ul.products, .woocommerce-page ul.products { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px !important; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { min-width: 0; box-sizing: border-box; width: auto !important; margin: 0 !important; float: none !important; padding: 8px; border: 1px solid var(--emg-border); border-radius: var(--emg-radius); background: #fff; display: flex; flex-direction: column; }
.woocommerce ul.products li.product a img { aspect-ratio: 1 / 1; object-fit: contain; background: var(--emg-surface); border-radius: 6px; margin-bottom: 8px !important; width: 100%; height: auto; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: .9rem !important; font-weight: 500; line-height: 1.3; padding: 0 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.woocommerce ul.products li.product .price { color: var(--wp--preset--color--contrast) !important; font-weight: 700; font-size: 1rem !important; }
.woocommerce ul.products li.product .price del { color: var(--emg-muted); font-weight: 400; font-size: .8rem; }
.woocommerce ul.products li.product .price ins { text-decoration: none; color: var(--emg-red); }
.woocommerce ul.products li.product .button { box-sizing: border-box; margin-top: auto !important; width: 100%; white-space: normal; text-align: center; min-height: 40px; border-radius: 8px; background: var(--emg-green); color: #fff; }
.woocommerce span.onsale { background: var(--emg-red); min-height: 0; min-width: 0; line-height: 1; padding: 6px 8px; border-radius: 6px; top: 8px; left: 8px; right: auto; margin: 0; font-size: .75rem; }
.woocommerce ul.products li.product .star-rating { display: none; } /* no reviews yet: hide empty stars */
.wcfmmp_sold_by_container, .wcfm-clearfix + .wcfmmp_sold_by_wrapper { font-size: .78rem; color: var(--emg-muted); }

/* Listing tools */
.woocommerce .woocommerce-result-count { font-size: .85rem; color: var(--emg-muted); }
.woocommerce .woocommerce-ordering select { min-height: 44px; border-radius: 8px; padding: 0 10px; }
.emg-filters { margin: 8px 0 12px; border: 1px solid var(--emg-border); border-radius: var(--emg-radius); background: var(--emg-surface); }
.emg-filters summary { padding: 12px 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
.emg-filters__form { padding: 0 14px 12px; display: grid; gap: 8px; }
.emg-filter { margin: 0; display: grid; gap: 4px; }
.emg-filter label { font-size: .85rem; font-weight: 600; }
.emg-filter select, .emg-filter input[type="number"] { min-height: 44px; border: 1px solid var(--emg-border); border-radius: 8px; padding: 0 10px; font-size: 16px; background: #fff; width: 100%; }
.emg-filter--price span { display: flex; gap: 6px; align-items: center; }
.emg-filter--check { display: flex; gap: 16px; flex-wrap: wrap; }
.emg-filter--check label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }
.emg-filters__actions { display: flex; gap: 14px; align-items: center; margin: 4px 0 0; }
.emg-filters__actions button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--emg-green); color: #fff; font-weight: 600; }
.emg-empty { padding: 16px; border: 1px dashed var(--emg-border); border-radius: var(--emg-radius); }

/* Single product */
.woocommerce div.product .product_title { font-size: 1.35rem; }
.woocommerce div.product p.price { color: var(--wp--preset--color--contrast); font-size: 1.4rem; font-weight: 700; }
.woocommerce div.product form.cart .button { min-height: 48px; padding: 0 28px; border-radius: 8px; }
.woocommerce div.product .woocommerce-product-gallery img { aspect-ratio: auto; background: var(--emg-surface); }

/* Footer */
.emg-footer { margin-top: 32px; padding-top: 20px; padding-bottom: 20px; background: var(--emg-surface); border-top: 1px solid var(--emg-border); font-size: .9rem; }
.emg-footer__cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.emg-footer h2 { font-size: .95rem; margin: 0 0 6px; }
.emg-footer ul { list-style: none; margin: 0; padding: 0; }
.emg-footer li a { display: inline-block; padding: 6px 0; color: inherit; }
.emg-footer__legal { color: var(--emg-muted); font-size: .8rem; margin-top: 16px; }

/* Mobile bottom bar */
.emg-bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--emg-border); padding-bottom: env(safe-area-inset-bottom); }
.emg-bottom-bar ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--emg-bar-h); }
.emg-bottom-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; font-size: .7rem; color: var(--wp--preset--color--contrast); text-decoration: none; }

@media (min-width: 600px) {
	.woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.emg-departments--grid ul { grid-template-columns: repeat(3, 1fr); }
	.emg-footer__cols { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 782px) {
	body { padding-bottom: 0; }
	.emg-bottom-bar { display: none; }
	.emg-header-links .emg-sell, .emg-header-links a span { display: inline; }
	.woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
	.emg-departments--grid ul { grid-template-columns: repeat(4, 1fr); }
	.emg-filters__form { grid-template-columns: repeat(3, 1fr); align-items: end; }
	.emg-filters__actions { grid-column: 1 / -1; }
}
@media (min-width: 1100px) { .emg-departments--grid ul { grid-template-columns: repeat(7, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Store matches on search results */
.emg-store-matches { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--emg-border); border-radius: var(--emg-radius); }
.emg-store-matches h2 { font-size: .95rem; margin: 0 0 6px; }
.emg-store-matches ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.emg-store-matches a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; min-height: 40px; border-radius: 999px; background: var(--emg-surface); color: inherit; text-decoration: none; font-size: .9rem; }

/* Product detail page (S2-14) */
.emg-pdp .woocommerce div.product, .emg-pdp div.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.emg-pdp div.product > * { min-width: 0; }
.emg-pdp .woocommerce-product-gallery__image { overflow: hidden; }
.emg-pdp .woocommerce-product-gallery img { max-width: 100%; height: auto; }
.emg-pdp div.product .woocommerce-product-gallery, .emg-pdp div.product .summary { width: 100% !important; float: none !important; margin: 0 !important; }
.emg-pdp div.product .woocommerce-product-gallery img { border-radius: var(--emg-radius); background: var(--emg-surface); }
.emg-pdp .product_title { font-size: 1.35rem; margin: 0 0 6px; }
.emg-pdp-attrs { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.emg-pdp-attrs li { font-size: .8rem; padding: 4px 8px; border-radius: 999px; background: var(--emg-surface); border: 1px solid var(--emg-border); }
.emg-pdp-attrs li span { color: var(--emg-muted); }
.emg-pdp div.product p.price { font-size: 1.5rem; font-weight: 700; color: var(--wp--preset--color--contrast); margin: 6px 0; }
.emg-pdp div.product p.price ins { text-decoration: none; color: var(--emg-red); }
.emg-pdp div.product p.price del { font-size: 1rem; color: var(--emg-muted); font-weight: 400; }
.emg-pdp .stock { font-weight: 600; }
.emg-pdp .stock.in-stock { color: var(--emg-green); }
.emg-pdp .stock.out-of-stock { color: var(--emg-red); }
.emg-pdp form.cart { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 12px 0 !important; }
.emg-pdp form.cart .quantity input.qty { min-height: 48px; width: 4.5em; font-size: 16px; border: 1px solid var(--emg-border); border-radius: 8px; }
.emg-pdp form.cart .single_add_to_cart_button { flex: 1 1 200px; min-height: 48px; border-radius: 8px; background: var(--emg-green) !important; color: #fff !important; font-size: 1rem; }
.emg-pdp-trust { border: 1px solid var(--emg-border); border-radius: var(--emg-radius); padding: 10px 12px; display: grid; gap: 6px; margin: 10px 0; font-size: .9rem; }
.emg-pdp-trust p { margin: 0; }
.emg-pdp-vendor { display: flex; gap: 8px; align-items: center; }
.emg-pdp-vendor a { font-weight: 600; }
.emg-pdp-protect { color: var(--emg-muted); }
.emg-pdp .woocommerce-tabs ul.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 !important; margin: 0 0 8px !important; }
.emg-pdp .woocommerce-tabs ul.tabs li { margin: 0 !important; border-radius: 999px !important; }
.emg-pdp .woocommerce-tabs ul.tabs li a { padding: 8px 12px !important; display: inline-block; min-height: 40px; }
.emg-pdp .related.products > h2 { font-size: 1.15rem; }
@media (min-width: 782px) {
	.emg-pdp .woocommerce div.product, .emg-pdp div.product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 28px; }
	.emg-pdp div.product .woocommerce-tabs, .emg-pdp div.product .related, .emg-pdp div.product .upsells { grid-column: 1 / -1; }
}
/* DEF-03: reserve space for the WooCommerce placeholder image (no width/height attributes) */
.woocommerce-product-gallery__image--placeholder img, img.woocommerce-placeholder { aspect-ratio: 1 / 1; width: 100%; height: auto; object-fit: contain; background: var(--emg-surface); }

/* Store directory (S2-16) */
.emg-store-search { display: grid; gap: 6px; margin: 8px 0 12px; }
.emg-store-search label { font-size: .85rem; font-weight: 600; }
.emg-store-search input, .emg-store-search select { min-height: 44px; font-size: 16px; border: 1px solid var(--emg-border); border-radius: 8px; padding: 0 10px; }
.emg-store-search button { min-height: 44px; border: 0; border-radius: 8px; background: var(--emg-green); color: #fff; font-weight: 600; }
.emg-store-count { color: var(--emg-muted); font-size: .85rem; }
.emg-stores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.emg-stores a { display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--emg-border); border-radius: var(--emg-radius); color: inherit; text-decoration: none; min-height: 64px; }
.emg-stores .emg-dept-badge { grid-row: span 2; }
.emg-store-name { font-weight: 600; }
.emg-store-meta { color: var(--emg-muted); font-size: .85rem; }
@media (min-width: 600px) { .emg-stores { grid-template-columns: repeat(2, 1fr); } .emg-store-search { grid-template-columns: 1fr 1fr auto; align-items: end; } .emg-store-search label { display: none; } }
@media (min-width: 1000px) { .emg-stores { grid-template-columns: repeat(3, 1fr); } }

/* S2-31 vendor application form */
.emg-reg { max-width: 520px; margin: 0 auto; display: grid; gap: 4px; }
.emg-reg__steps { list-style: none; counter-reset: s; display: flex; gap: 6px; padding: 0; margin: 0 0 12px; font-size: .8rem; color: var(--emg-muted); flex-wrap: wrap; }
.emg-reg__steps li { counter-increment: s; padding: 4px 10px; border-radius: 999px; background: var(--emg-surface); }
.emg-reg__steps li::before { content: counter(s) ". "; }
.emg-reg__steps li[aria-current] { background: var(--emg-green); color: #fff; }
.emg-reg__field { display: grid; gap: 4px; margin: 0 0 10px; }
.emg-reg__field label { font-weight: 600; }
.emg-reg__hint { font-size: .8rem; color: var(--emg-muted); }
.emg-reg input[type=text], .emg-reg input[type=tel], .emg-reg input[type=email], .emg-reg input[type=password], .emg-reg select { min-height: 48px; font-size: 16px; padding: 0 12px; border: 1px solid var(--emg-border); border-radius: 8px; width: 100%; box-sizing: border-box; background: #fff; }
.emg-reg .has-error input, .emg-reg .has-error select { border-color: var(--emg-red); }
.emg-reg__error { color: var(--emg-red); font-size: .85rem; }
.emg-reg__check label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.emg-reg__check input { width: 22px; height: 22px; margin-top: 2px; }
.emg-reg__privacy { font-size: .8rem; color: var(--emg-muted); }
.emg-reg__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.emg-reg__submit { width: 100%; min-height: 52px; border: 0; border-radius: 8px; background: var(--emg-green); color: #fff; font-size: 1.05rem; font-weight: 700; }
.emg-reg__summary { border: 2px solid var(--emg-red); border-radius: var(--emg-radius); padding: 10px 14px; margin-bottom: 12px; }
.emg-reg__summary a { color: var(--emg-red); }
.emg-app-status { border: 1px solid var(--emg-border); border-radius: var(--emg-radius); padding: 14px; }

/* S2-32/S2-34: verification form and onboarding checklist */
.emg-verify fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.emg-verify fieldset label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-right: 16px; }
.emg-reg__privacy, .emg-reg__hint { font-size: .9em; color: #555; }
.emg-onboarding { border: 1px solid #ddd; border-radius: var(--emg-radius, 8px); padding: 12px 16px; margin: 0 0 16px; background: #fff; }
.emg-onboarding h2 { font-size: 1.1em; margin: 0 0 8px; }
.emg-onboarding ol { list-style: none; margin: 0; padding: 0; }
.emg-onboarding li { padding: 8px 0; border-top: 1px solid #eee; }
.emg-onboarding li:first-child { border-top: 0; }
.emg-onboarding li.is-done { color: #1d6b2f; }
.emg-onb__mark { display: inline-block; width: 1.4em; font-weight: 700; }
.emg-onboarding small { color: #666; margin-left: 1.4em; display: inline-block; }

/* D-95 mobile: 44px touch targets for checkbox/radio labels, checklist links and status actions */
.emg-reg__check label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; }
.emg-reg input[type="checkbox"], .emg-reg input[type="radio"] { width: 22px; height: 22px; margin: 0; flex: none; }
.emg-onboarding li a, .emg-onb__more a { display: inline-flex; align-items: center; min-height: 44px; }
.emg-onb__more { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 8px 0 0; border-top: 1px solid #eee; }
.emg-app-status a.emg-reg__submit { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; text-decoration: none; }
.emg-reg__note { border-left: 4px solid var(--emg-green, #1d6b2f); background: #f3f8f4; padding: 10px 14px; margin: 0 0 12px; }
.emg-reg__summary:focus { outline: 3px solid var(--emg-red); outline-offset: 2px; }

/* D-96 accessibility (WCAG 2.2 target size 24px minimum; 16px form text to avoid iOS zoom) */
.emg-header-links a { min-width: 44px; justify-content: center; }
.woocommerce-breadcrumb a, .emg-filters__actions a { display: inline-block; padding-block: 4px; min-height: 24px; }
.wcfm_dashboard_item_title { display: inline-block; padding-block: 3px; min-height: 24px; }
.woocommerce-ordering select { font-size: 16px; min-height: 44px; }
.emg-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wcfmmp_sold_by_wrapper a, .emg-home-section__more { display: inline-block; padding-block: 4px; min-height: 24px; }
.product_meta a, .emg-pdp-vendor a, [class*="wcfmmp_sold_by_container"] a { display: inline-block; padding-block: 4px; min-height: 24px; }

.emg-notice { margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--emg-amber); border-radius: var(--emg-radius); background: var(--emg-surface); font-size: .9rem; }
.emg-verticals ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.emg-verticals li { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px dashed var(--emg-border); border-radius: var(--emg-radius); background: var(--emg-surface); min-height: 64px; }
.emg-vert-name { font-weight: 600; }
.emg-soon { color: var(--emg-muted); font-size: .8rem; }
