/**
 * FARAE Core Fixes frontend styles.
 */

:root {
	--farae-smoky-black: #141009;
	--farae-van-dyke: #493B36;
	--farae-cinereous: #A3968C;
	--farae-bone: #DEDACF;
	--farae-powder: #F9F8F5;
	--farae-border: rgba(20, 16, 9, 0.14);
	--farae-shadow: 0 14px 34px rgba(20, 16, 9, 0.08);
}

/* ------------------------------------------------------------
 * Section header standardisation
 * ------------------------------------------------------------ */
.elementor-widget-heading.farae-section-heading,
.farae-section-heading,
.farae-section-title,
.farae-products-section .elementor-heading-title,
.farae-product-section .elementor-heading-title,
.elementor-widget-woocommerce-products + .elementor-widget-heading .elementor-heading-title,
.woocommerce .related.products > h2,
.woocommerce .up-sells > h2,
.woocommerce .cross-sells > h2 {
	text-align: center;
}

/* ------------------------------------------------------------
 * Product card consistency: image contain + name line clamp
 * ------------------------------------------------------------ */
.woocommerce ul.products li.product,
.elementor-widget-woocommerce-products ul.products li.product,
.elementor-widget-wc-archive-products ul.products li.product {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.elementor-widget-woocommerce-products ul.products li.product a.woocommerce-LoopProduct-link,
.elementor-widget-wc-archive-products ul.products li.product a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.woocommerce ul.products li.product a img,
.elementor-widget-woocommerce-products ul.products li.product a img,
.elementor-widget-wc-archive-products ul.products li.product a img,
.elementor-widget-loop-carousel .e-loop-item .woocommerce-loop-product__link img,
.elementor-widget-loop-grid .e-loop-item .woocommerce-loop-product__link img {
	width: 100%;
	height: 260px;
	object-fit: contain;
	object-position: center;
	padding: 18px;
	background: var(--farae-powder);
	box-sizing: border-box;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.elementor-widget-woocommerce-products ul.products li.product .woocommerce-loop-product__title,
.elementor-widget-wc-archive-products ul.products li.product .woocommerce-loop-product__title,
.elementor-widget-loop-carousel .e-loop-item .woocommerce-loop-product__title,
.elementor-widget-loop-grid .e-loop-item .woocommerce-loop-product__title,
.farae-product-card .woocommerce-loop-product__title,
.farae-product-card .product-title,
.farae-product-card .elementor-heading-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: 2.8em;
	line-height: 1.4;
}

.woocommerce ul.products li.product .price,
.elementor-widget-woocommerce-products ul.products li.product .price,
.elementor-widget-wc-archive-products ul.products li.product .price {
	margin-top: auto;
}

/* Subtle Phase 3 card hover lift; safe and lightweight. */
.woocommerce ul.products li.product,
.elementor-widget-woocommerce-products ul.products li.product,
.elementor-widget-wc-archive-products ul.products li.product,
.elementor-widget-loop-carousel .e-loop-item,
.elementor-widget-loop-grid .e-loop-item {
	transition: transform 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) {
	.woocommerce ul.products li.product:hover,
	.elementor-widget-woocommerce-products ul.products li.product:hover,
	.elementor-widget-wc-archive-products ul.products li.product:hover,
	.elementor-widget-loop-carousel .e-loop-item:hover,
	.elementor-widget-loop-grid .e-loop-item:hover {
		transform: translateY(-3px);
		box-shadow: var(--farae-shadow);
	}
}

/* ------------------------------------------------------------
 * Women/Men sub-navigation active state
 * ------------------------------------------------------------ */
.farae-subnav,
.farae-sub-navigation,
.women-subnav,
.mens-subnav,
.farae-shop-subnav {
	position: relative;
}

.farae-subnav a,
.farae-sub-navigation a,
.women-subnav a,
.mens-subnav a,
.farae-shop-subnav a,
.elementor-nav-menu a.farae-is-active,
.elementor-nav-menu .current-menu-item > a,
.elementor-nav-menu .current_page_item > a,
.elementor-nav-menu .current-menu-ancestor > a {
	transition: color 180ms ease, border-color 180ms ease, font-weight 180ms ease;
}

.farae-subnav .current-menu-item > a,
.farae-subnav .current_page_item > a,
.farae-subnav .current-menu-ancestor > a,
.farae-subnav a.is-active,
.farae-sub-navigation .current-menu-item > a,
.farae-sub-navigation .current_page_item > a,
.farae-sub-navigation .current-menu-ancestor > a,
.farae-sub-navigation a.is-active,
.women-subnav .current-menu-item > a,
.women-subnav .current_page_item > a,
.women-subnav a.is-active,
.mens-subnav .current-menu-item > a,
.mens-subnav .current_page_item > a,
.mens-subnav a.is-active,
.farae-shop-subnav a.is-active,
.elementor-nav-menu a.farae-is-active {
	color: var(--farae-smoky-black) !important;
	font-weight: 600;
	border-bottom: 1px solid var(--farae-smoky-black);
}

@media (max-width: 767px) {
	.farae-subnav,
	.farae-sub-navigation,
	.women-subnav,
	.mens-subnav,
	.farae-shop-subnav {
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.farae-subnav::-webkit-scrollbar,
	.farae-sub-navigation::-webkit-scrollbar,
	.women-subnav::-webkit-scrollbar,
	.mens-subnav::-webkit-scrollbar,
	.farae-shop-subnav::-webkit-scrollbar {
		display: none;
	}
}

/* ------------------------------------------------------------
 * Product page helpers
 * ------------------------------------------------------------ */
.farae-product-brand {
	margin-bottom: 8px;
	font-family: Poppins, Helvetica, Arial, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--farae-cinereous);
}

.farae-payment-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--farae-van-dyke);
}

.farae-payment-line__badge {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	padding: 2px 7px;
	border: 1px solid var(--farae-border);
	border-radius: 999px;
	background: var(--farae-powder);
	font-size: 11px;
	font-weight: 600;
	color: var(--farae-smoky-black);
}

.farae-wishlist-link,
.farae-wishlist-link button,
.farae-wishlist-link a {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	font-family: Poppins, Helvetica, Arial, sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--farae-van-dyke);
	text-decoration: none;
	cursor: pointer;
}

.farae-wishlist-link:hover,
.farae-wishlist-link button:hover,
.farae-wishlist-link a:hover {
	color: var(--farae-smoky-black);
	text-decoration: underline;
}

.farae-trust-bar {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	border: 1px solid var(--farae-border);
	background: var(--farae-powder);
	color: var(--farae-van-dyke);
}

.farae-trust-bar__item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 10px 12px;
	font-size: 12px;
	line-height: 1.25;
	text-align: center;
	border-right: 1px solid var(--farae-border);
}

.farae-trust-bar__item:last-child {
	border-right: 0;
}

.farae-trust-bar__icon {
	font-size: 14px;
	line-height: 1;
	color: var(--farae-smoky-black);
}

/* Woo/Elementor accordion active mocha tone. */
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.elementor-widget-woocommerce-product-data-tabs .wc-tabs li.active a,
.elementor-accordion .elementor-tab-title.elementor-active,
.elementor-toggle .elementor-tab-title.elementor-active {
	color: var(--farae-powder) !important;
	background: var(--farae-van-dyke) !important;
}

.woocommerce div.product form.cart .button,
.woocommerce div.product .single_add_to_cart_button,
.elementor-widget-woocommerce-product-add-to-cart .single_add_to_cart_button {
	min-height: 44px;
	background: var(--farae-smoky-black);
	color: var(--farae-powder);
	border-color: var(--farae-smoky-black);
}

@media (max-width: 767px) {
	.farae-trust-bar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.farae-trust-bar__item {
		border-right: 1px solid var(--farae-border);
		border-bottom: 1px solid var(--farae-border);
	}

	.farae-trust-bar__item:nth-child(2n) {
		border-right: 0;
	}

	.farae-trust-bar__item:nth-last-child(-n+2) {
		border-bottom: 0;
	}
}

/* ------------------------------------------------------------
 * Mobile sticky Add To Basket bar
 * ------------------------------------------------------------ */
.farae-mobile-atb {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99990;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	background: rgba(249, 248, 245, 0.98);
	border-top: 1px solid var(--farae-border);
	box-shadow: 0 -8px 24px rgba(20, 16, 9, 0.08);
	transform: translateY(110%);
	transition: transform 220ms ease;
}

.farae-mobile-atb.is-visible {
	transform: translateY(0);
}

.farae-mobile-atb[hidden] {
	display: none !important;
}

.farae-mobile-atb__info {
	min-width: 0;
}

.farae-mobile-atb__name {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--farae-smoky-black);
}

.farae-mobile-atb__price {
	margin-top: 2px;
	font-size: 12px;
	line-height: 1.2;
	color: var(--farae-van-dyke);
}

.farae-mobile-atb__price del {
	opacity: 0.55;
}

.farae-mobile-atb__button {
	min-width: 128px;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--farae-smoky-black);
	border-radius: 0;
	background: var(--farae-smoky-black);
	color: var(--farae-powder);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
}

.farae-mobile-atb__button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

@media (min-width: 768px) {
	.farae-mobile-atb {
		display: none !important;
	}
}

@media (max-width: 767px) {
	body.single-product.farae-has-mobile-atb {
		padding-bottom: 78px;
	}
}

/* ------------------------------------------------------------
 * Mobile QA helpers
 * ------------------------------------------------------------ */
@media (max-width: 767px) {
	button,
	.button,
	.elementor-button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button {
		min-height: 44px;
	}

	/* Category circle tiles should breathe better on mobile when using Elementor grids. */
	.farae-category-tiles .elementor-grid,
	.farae-circle-tiles .elementor-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	/* Footer single-column fallback. */
	.farae-footer .elementor-container,
	footer .elementor-container {
		flex-wrap: wrap;
	}

	/* Brand spotlight stacking fallback. */
	.farae-brand-spotlight .elementor-container,
	.farae-brand-spotlight .elementor-grid {
		grid-template-columns: 1fr !important;
	}
}
