/*
 Theme Name:   Woodmart Child
 Description:  Parapharmacie Maroc. Design per the approved spec: pharmacy green
               as the trust anchor, neutral ground, one warm accent reserved for
               price and promo. No page builder on shop, category or product
               templates - those render thousands of times and decide CWV.
 Author:       RMG Solutions
 Author URI:   https://rmgsolutions.ma
 Template:     woodmart
 Version:      1.1.0
 Text Domain:  woodmart
*/

/* =========================================================================
   Design tokens

   Pharmacy green is the francophone signifier for "pharmacie" - it does the
   trust work instantly for cold traffic landing from a brand search, which is
   most of the traffic this site is built to earn. The warm accent is reserved
   strictly for price and promo so it never competes with itself.
   ========================================================================= */

:root {
	--para-green: #0e7a57;
	--para-green-dark: #0a5b41;
	--para-green-tint: #e7f2ee;

	--para-ink: #14201b;
	--para-ink-soft: #55635c;
	--para-ink-faint: #8b978f;

	--para-surface: #f5f7f6;
	--para-rule: rgba(20, 32, 27, 0.12);

	/* Price and promo only. Never decoration. */
	--para-accent: #d9531e;
}

/* =========================================================================
   Trust strip
   Delivery threshold, speed, payment, authenticity - the four claims every
   Moroccan competitor makes. Omitting any of them reads as amateur here.
   ========================================================================= */

.para-trustbar {
	background: var(--para-green);
	color: #fff;
}

.para-trustbar__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem 2.25rem;
	max-width: 1400px;
	margin-inline: auto;
	padding: 0.55rem 1rem;
	font-size: 0.79rem;
	line-height: 1.4;
}

.para-trustbar__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	white-space: nowrap;
}

.para-trustbar__item svg {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	opacity: 0.85;
}

@media (max-width: 768px) {
	.para-trustbar__inner {
		gap: 0.3rem 1rem;
		font-size: 0.7rem;
	}
	/* Four claims will not fit two-up on a phone; drop the weakest. */
	.para-trustbar__item:nth-child(4) {
		display: none;
	}
}

/* =========================================================================
   Layout shift protection
   CLS is the cheapest Core Web Vital to lose and the cheapest to protect.
   ========================================================================= */

.woocommerce ul.products li.product img,
.woocommerce div.product div.images img {
	aspect-ratio: 1 / 1;
	object-fit: contain;
	height: auto;
	width: 100%;
	background: #fff;
}

/* =========================================================================
   Catalog density
   Shoppers arrive knowing the product name - `cicaplast baume b5` alone is
   9,900 searches a month. Price visible without hover, compact cards.
   ========================================================================= */

.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .price ins,
.wd-product .price,
.wd-product .price ins {
	color: var(--para-accent);
	font-weight: 700;
	text-decoration: none;
}

.woocommerce ul.products li.product .price del,
.wd-product .price del {
	color: var(--para-ink-faint);
	font-weight: 400;
}

/* Out-of-stock should be legible, not hidden - 3,167 of the market's
   20,270 listings are out of stock, so this state is common. */
.wd-product .wd-product-stock.stock.out-of-stock {
	color: var(--para-ink-faint);
}

/* =========================================================================
   Rayon list beside the hero - Elementor wd_mega_menu, menu "Category menu"
   ========================================================================= */

/* Packshots shot on white: multiply drops the box out against the page. */
.elementor-widget-wd_mega_menu .wd-nav-img {
	object-fit: contain;
	mix-blend-mode: multiply;
}

/* =========================================================================
   Homepage rayon tiles
   ========================================================================= */

.elementor-widget-wd_product_categories .wd-cat-thumb {
	width: 100%;
	max-width: 168px;
	aspect-ratio: 1 / 1;
	transition: transform 0.22s ease;
}

.elementor-widget-wd_product_categories .category-grid-item .wd-cat-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	border-radius: 0;
	overflow: visible;
}

.elementor-widget-wd_product_categories .wd-cat-image {
	width: 100%;
	height: 100%;
	margin: 0;
}

.elementor-widget-wd_product_categories .wd-cat-image img {
	width: 100%;
	height: 100%;
	padding: 6%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.elementor-widget-wd_product_categories .category-grid-item:hover .wd-cat-thumb {
	transform: translateY(-4px);
}

/* Theme already scales the image on hover; that plus the lift is too much. */
.elementor-widget-wd_product_categories .category-grid-item:hover .wd-cat-image {
	transform: none;
}

/* cat-design-default is printed inside the widget, so it lands after this file
   and wins every tie - hence .cat-design-default in the selectors below.
   It overlays the caption on the image, which hides a round tile completely. */
.elementor-widget-wd_product_categories .cat-design-default .wd-cat-content {
	position: static;
	transform: none;
	padding: 12px 4px 0 !important;
	background: none;
}

.elementor-widget-wd_product_categories .cat-design-default .wd-entities-title {
	position: static;
	inset: auto;
	display: block;
	margin: 0;
	min-height: 2.6em; /* keeps counts aligned when "Bébé & Maman" wraps */
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	color: var(--para-ink);
	transition: color 0.18s ease;
}

.elementor-widget-wd_product_categories .category-grid-item:hover .wd-entities-title {
	color: var(--para-green);
}

/* Counts reassure on a 15k catalog; the theme only reveals them on hover. */
.elementor-widget-wd_product_categories .cat-design-default mark,
.elementor-widget-wd_product_categories .cat-design-default .wd-cat-count {
	margin-top: 2px;
	opacity: 1;
	transform: none;
	background: none;
	color: var(--para-ink-faint);
	font-size: 0.8rem;
	font-weight: 400;
}

.elementor-widget-wd_product_categories .wd-sub-categories {
	display: none;
}

@media (max-width: 1024px) {
	.elementor-widget-wd_product_categories .wd-cat-thumb {
		max-width: 140px;
	}
}

/* =========================================================================
   Brand index (/marque/)
   Gated to brands with enough products to be indexable, so the page does not
   spend crawl budget linking to hubs we noindex ourselves.
   ========================================================================= */

.para-brand-index {
	padding: 40px 0 64px;
}

.para-brand-index__title {
	margin: 0 0 8px;
	font-size: 1.9rem;
	font-weight: 700;
	color: var(--para-ink);
}

.para-brand-index__intro {
	margin: 0 0 28px;
	max-width: 62ch;
	color: var(--para-ink-soft);
}

.para-brand-index__jump {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 36px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--para-rule);
}

.para-brand-index__jump a {
	min-width: 34px;
	padding: 5px 8px;
	border: 1px solid var(--para-rule);
	border-radius: 6px;
	color: var(--para-ink);
	font-size: 0.86rem;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.para-brand-index__jump a:hover {
	background: var(--para-green);
	border-color: var(--para-green);
	color: #fff;
}

.para-brand-index__group {
	margin-bottom: 30px;
	scroll-margin-top: 120px;
}

.para-brand-index__letter {
	margin: 0 0 12px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--para-green-tint);
	color: var(--para-green);
	font-size: 1.05rem;
	font-weight: 700;
}

.para-brand-index__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 2px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.para-brand-index__list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 2px;
	color: var(--para-ink);
	text-decoration: none;
	border-bottom: 1px solid rgba(20, 32, 27, 0.06);
}

.para-brand-index__list a:hover .para-brand-index__name {
	color: var(--para-green);
}

.para-brand-index__count {
	color: var(--para-ink-faint);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Brand filter (para-core widget, shop sidebar)
   ========================================================================= */

.para-brand-filter {
	margin: 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
	list-style: none;
}

.para-brand-filter a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	padding: 5px 0;
	color: var(--para-ink);
	font-size: 0.9rem;
	text-decoration: none;
}

.para-brand-filter a:hover .para-brand-filter__name {
	color: var(--para-green);
}

.para-brand-filter__item.is-active a {
	color: var(--para-green);
	font-weight: 600;
}

.para-brand-filter__item.is-active a::before {
	content: "×";
	margin-right: 6px;
	font-weight: 700;
}

.para-brand-filter__count {
	color: var(--para-ink-faint);
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
}

.para-brand-filter__reset {
	margin: 8px 0 0;
	font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
 * Bundle components
 *
 * Product Bundles gives every component the class `bundled_product_title
 * product_title`, and WoodMart styles `.product_title` at 34px because it means
 * the page's own H1. So each component in a pack rendered at page-heading size.
 * Scope them back down; a component is a line item, not a title.
 * -------------------------------------------------------------------------- */
.bundled_product_title.product_title {
	font-size: 1rem;
	line-height: 1.35;
	font-weight: 600;
	margin: 0 0 4px;
}

.bundled_product_excerpt.product_excerpt {
	font-size: 0.85rem;
	color: var(--para-ink-faint);
	margin: 0 0 6px;
}

.bundled_item_wrap {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 12px 0;
	border-bottom: 1px solid rgba(2, 1, 1, 0.08);
}

.bundled_product_images.images {
	flex: 0 0 64px;
	max-width: 64px;
	margin: 0;
}

.bundled_item_wrap .stock {
	font-size: 0.82rem;
	margin: 0;
}

/* Bundle buy row. WoodMart injects "Acheter Maintenant" with JS as a direct child
 * of .bundle_data, while the add-to-cart sits two levels deeper inside
 * .bundle_wrap > .bundle_button, and .bundle_data is display:block - so they
 * stacked. Flatten the wrapper and lay the row out like a simple product's. */
form.cart.bundle_form .bundle_data {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 10px;
	row-gap: 10px;
}

/* Most shoppers are on a phone, where this row always wraps: the add-to-cart
 * fills the space beside the quantity box, and buy-now takes its own full line. */
form.cart.bundle_form .bundle_button {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
}

form.cart.bundle_form .bundle_button .single_add_to_cart_button {
	flex: 1 1 auto;
}

form.cart.bundle_form .bundle_price:empty,
form.cart.bundle_form .bundle_error:empty {
	display: none;
}

@media (max-width: 768.98px) {
	form.cart.bundle_form .bundle_button,
	form.cart.bundle_form .wd-buy-now-btn {
		flex: 1 1 100%;
	}
}

form.cart.bundle_form .bundle_wrap {
	display: contents;
}

form.cart.bundle_form .bundle_availability {
	flex: 0 0 100%;
	margin: 0 0 10px;
}

form.cart.bundle_form .bundle_price,
form.cart.bundle_form .bundle_error {
	flex: 0 0 100%;
}
