/*
 * On Point Site – base adjustments (loaded on every page).
 *
 * WHY THIS IS CODE: the Divi theme adds `padding-bottom: 10px` to every h1–h6. Production has no
 * such padding, and Divi offers no visual setting to remove the theme default. Removing it lets each
 * heading's spacing be controlled entirely by its own Divi margin settings (editable visually).
 */
.et_pb_text_inner h1, .et_pb_text_inner h2, .et_pb_text_inner h3,
.et_pb_text_inner h4, .et_pb_text_inner h5, .et_pb_text_inner h6,
.et_pb_wc_title h1, .et_pb_post_title h1 {
	padding-bottom: 0;
}

/*
 * Store notices ("… has been added to your cart", stock errors, cart/checkout messages).
 * WHY THIS IS CODE: the Divi theme Customizer paints every WooCommerce notice in the accent colour with
 * !important, which Divi's module settings can't override. On Point style: white card, bronze edge.
 */
body .woocommerce-message,
body .woocommerce-error,
body .woocommerce-info { /* 'body' outranks Divi's later inline rule */
	background: #fff !important;
	color: #20262b !important;
	border: 1px solid #d9d7d1 !important;
	border-left: 3px solid #b98a55 !important;
	border-radius: 0 !important;
	padding: 16px 20px !important;
	font-size: 14px;
	line-height: 1.6;
	box-shadow: none !important;
}
body .woocommerce-error {
	border-left-color: #a73e32 !important;
}
.woocommerce-message a,
.woocommerce-error a,
.woocommerce-info a {
	color: #20262b !important;
}
.woocommerce-message .button,
.woocommerce-info .button {
	padding: 8px 14px !important;
	border: 1px solid #20262b !important;
	border-radius: 0 !important;
	background: transparent !important;
	font-size: 12px !important;
	font-weight: 600;
	color: #20262b !important;
}
.woocommerce-message .button::after,
.woocommerce-info .button::after {
	display: none !important;
}

/*
 * Old third-party breadcrumbs module (plugin "Divi Breadcrumbs", still inside the Optic Cut page content).
 * WHY THIS IS CODE: Divi 5 doesn't load the icon font for this unconverted module, so its separator shows
 * as the letter "9". Show a plain "/" instead. Remove when the plugin is retired (see migration plan).
 */
.lwp-breadcrumbs .separator.et-pb-icon {
	font-size: 0 !important; /* hide the glyph whether or not the icon font loads */
}
.lwp-breadcrumbs .separator.et-pb-icon::before {
	content: "/";
	margin: 0 6px;
	font: 400 13px/1 Inter, sans-serif !important;
	color: #60676c;
}

/*
 * "In the kit" list ([op_in_the_kit] in the product templates). Spacing and list markers only –
 * fonts and colours are set on the Divi text module.
 */
.op-kit {
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid #c5c4bf;
}
.op-kit h3 {
	margin: 0 0 10px;
}
.op-kit ul {
	margin: 0;
	padding: 0 0 0 18px;
	list-style: square;
}
.op-kit li::marker {
	color: #b98a55;
}

/*
 * Header mini-cart dropdown (text module "op-mini-cart-panel" inside the "op-header-cart" group).
 * WHY THIS IS CODE: the open/closed state, shadow and stacking can't be set on a Divi module, and the
 * WooCommerce mini-cart list inside it is WooCommerce markup. Values copied from production's mini-cart.
 * The panel's width, colours, border, padding and position are set in Divi.
 */
.op-header-cart {
	cursor: pointer;
}
.op-header-cart:hover,
.op-header-cart.is-open {
	border-color: #b98a55 !important;
}
.op-mini-cart-panel {
	display: none !important;
	z-index: 9999;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
	cursor: auto;
	text-align: left;
}
.op-header-cart.is-open .op-mini-cart-panel {
	display: block !important;
}
.op-mini-cart-panel ul.woocommerce-mini-cart {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 55vh;
	overflow-y: auto;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item {
	position: relative;
	min-height: 96px;
	margin: 0;
	padding: 16px 32px 16px 80px !important; /* WooCommerce widget CSS sets 4px 0 */
	border-bottom: 1px solid #d9d7d1;
	line-height: 1.5;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item:first-child {
	padding-top: 8px !important;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item img {
	position: absolute;
	left: 0;
	top: 16px;
	width: 64px !important;
	height: 64px;
	margin: 0 !important;
	object-fit: contain;
	background: #e9e7e1;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item:first-child img {
	top: 8px;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item a:not(.remove) {
	display: block;
	font-weight: 500;
	font-size: 14px;
	color: #20262b;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item .quantity,
.op-mini-cart-panel li.woocommerce-mini-cart-item .variation {
	display: block;
	font-size: 13px;
	color: #60676c;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item .variation dt,
.op-mini-cart-panel li.woocommerce-mini-cart-item .variation dd,
.op-mini-cart-panel li.woocommerce-mini-cart-item .variation p {
	display: inline;
	margin: 0;
	padding: 0;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item a.remove {
	position: absolute;
	right: 0;
	top: 16px;
	width: 22px;
	height: 22px;
	border: 1px solid #d5d8dc;
	border-radius: 50%;
	font-size: 16px;
	line-height: 19px;
	text-align: center;
	color: #60676c !important;
	background: none !important;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item:first-child a.remove {
	top: 8px;
}
.op-mini-cart-panel li.woocommerce-mini-cart-item a.remove:hover {
	color: #876238 !important;
	border-color: #876238;
}
.op-mini-cart-panel .woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	margin: 0;
	padding: 18px 0;
	font-weight: 500;
	font-size: 15px;
	color: #20262b;
}
.op-mini-cart-panel .woocommerce-mini-cart__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
	padding: 0;
}
.op-mini-cart-panel .woocommerce-mini-cart__buttons a.button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 0;
	padding: 12px 10px !important;
	border: 1px solid #20262b;
	border-radius: 0;
	background: transparent;
	font-weight: 600;
	font-size: 12px;
	line-height: 1.5;
	letter-spacing: 0;
	text-align: center;
	color: #20262b;
}
.op-mini-cart-panel .woocommerce-mini-cart__buttons a.button:hover {
	background: #20262b;
	color: #f3f1ec;
}
.op-mini-cart-panel .woocommerce-mini-cart__buttons a.button.checkout {
	border-color: #b98a55;
	background: #b98a55;
	color: #15191c;
}
.op-mini-cart-panel .woocommerce-mini-cart__buttons a.button.checkout:hover {
	border-color: #c79964;
	background: #c79964;
}
.op-mini-cart-panel .woocommerce-mini-cart__buttons a.button::after {
	display: none !important; /* Divi's hover arrow */
}
.op-mini-cart-panel .woocommerce-mini-cart__empty-message {
	margin: 0;
	padding: 8px 0;
	font-size: 14px;
	line-height: 1.6;
	color: #60676c;
}

/*
 * Main navigation – desktop dropdown (Divi Menu module "op-main-menu"; colours/fonts set in the module).
 * WHY THIS IS CODE: Divi has no setting for the dropdown's bronze top edge, shadow and inner padding.
 */
/* Menu items with the CSS class "op-menu-indent" (set in Appearance → Menus) appear indented in the
   same dropdown, e.g. Slide / Frame / Grip Parts under 2011/1911 DS. */
.op-main-menu .et-menu .sub-menu li.op-menu-indent > a {
	padding-left: 36px !important;
	color: #b9bec2 !important;
}
.op-main-menu .et-menu .sub-menu li.op-menu-indent > a:hover {
	color: #f3f1ec !important;
}
.op-main-menu .et-menu .sub-menu {
	padding: 8px 0;
	border: 1px solid #3b454d;
	border-top: 2px solid #b98a55;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

/*
 * Phone menu groups ([op_mobile_menu] inside the "Menu" toggle). Fonts/colours come from the toggle.
 */
.op-mnav-list {
	margin: 0;
	padding: 0 !important;
	list-style: none;
}
.op-mnav-list li {
	padding: 0;
	list-style: none;
	line-height: 48px; /* same 48px rows as the other phone menu links (touch-friendly) */
}
.op-mnav-list li a {
	display: block;
}
.op-mnav summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	list-style: none;
	cursor: pointer;
}
.op-mnav summary::-webkit-details-marker {
	display: none;
}
.op-mnav-toggle {
	flex: 0 0 44px;
	height: 44px;
	position: relative;
}
.op-mnav-toggle::before {
	content: "";
	position: absolute;
	right: 19px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -6px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.op-mnav details[open] > summary .op-mnav-toggle::before {
	margin-top: -2px;
	transform: rotate(-135deg);
}
.op-mnav-depth-1 {
	margin: -4px 0 8px !important;
	padding-left: 16px !important;
	border-left: 1px solid #3b454d;
}
.op-mnav li.op-menu-indent {
	padding-left: 18px;
}
.op-mnav li.op-menu-indent a {
	color: #b9bec2 !important;
}

/*
 * Phone menu (Divi Toggle with the class "op-phone-menu" in the Global Header).
 * WHY THIS IS CODE: Divi's toggle icon comes from its icon font, which has no thin chevron.
 * Production draws a 7px line chevron; this reproduces it. Colour follows the toggle's icon colour.
 */
.op-phone-menu .et_pb_toggle_title:before {
	content: "" !important;
	width: 7px;
	height: 7px;
	right: 19px;
	margin-top: -6px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.op-phone-menu.et_pb_toggle_open .et_pb_toggle_title:before {
	margin-top: -2px;
	transform: rotate(-135deg);
}

/*
 * Shop & category archives (Divi Shop module).
 * WHY THIS IS CODE: the Shop module lays products out with WooCommerce's float grid and has no
 * column-gap control, and WooCommerce's sort dropdown is not exposed to Divi's design settings.
 * These rules reproduce production: on the shop/category archives 3 cards of 340px with 90px gaps in the
 * 1200px container (other product grids keep WooCommerce's default gaps, as on production), one card
 * per row on phones, and the bordered sort box. Title/price fonts, colors and the page spacing stay in Divi.
 */
@media (min-width: 981px) {
	.post-type-archive-product .et_pb_shop ul.products.columns-3 li.product,
	.tax-product_cat .et_pb_shop ul.products.columns-3 li.product {
		width: 28.333%;
		margin-right: 7.5%;
	}
	.post-type-archive-product .et_pb_shop ul.products.columns-3 li.product.last,
	.tax-product_cat .et_pb_shop ul.products.columns-3 li.product.last {
		margin-right: 0;
	}
}
@media (max-width: 767px) {
	/* Production shows one full-width card per row on phones (Divi/WooCommerce force two with !important). */
	#page-container #et-boc .et-l .et_pb_shop ul.products li.product:nth-child(n) {
		width: 100% !important;
		margin-right: 0 !important;
		margin-bottom: 32px !important;
		float: none;
	}
	.post-type-archive-product #page-container #et-boc .et-l .et_pb_shop ul.products li.product:nth-child(n),
	.tax-product_cat #page-container #et-boc .et-l .et_pb_shop ul.products li.product:nth-child(n) {
		margin-bottom: 38px !important;
	}
}
/*
 * Contact page form (Divi Contact Form module with the class "op-contact-form").
 * WHY THIS IS CODE: Divi 5 offers no design settings for the field labels, and it always pushes the
 * submit button to the right. Production uses small dark labels and a left-aligned button.
 * Fields, colors, button colors/fonts and spacing are still edited in the Divi module.
 */
.op-contact-form .et_pb_contact_form_label {
	font-size: 12px;
	line-height: 18px;
	color: #20262b;
}
.op-contact-form .et_contact_bottom_container {
	margin-left: 0 !important; /* Divi prints margin-left:auto with an ID selector */
	flex-basis: 100%;
}
.op-contact-form .et_pb_contact_submit {
	margin-left: 0 !important; /* Divi's default 18px left offset */
}

body p.woocommerce-result-count { /* "body p." beats Divi's inline critical CSS rule `p.woocommerce-result-count` */
	color: #60676c; /* was #999 – too light on the Bone background (WCAG AA) */
}
.woocommerce-ordering select.orderby {
	height: 38px;
	padding: 0 12px;
	background-color: #faf9f6;
	border: 1px solid #d9d7d1;
	border-radius: 0;
	font-size: 12px;
	color: #666;
}

/*
 * YITH add-on titles were <h3> directly under the page <h1> (heading level skipped). includes/accessibility.php prints them as
 * <h2>; this keeps the original size so nothing changes visually.
 */
h2.wapo-addon-title {
	font-size: 22px;
	line-height: 22px;
}

/* "Coming soon" section of the Shop & Categories template (see on-point-site.php, feature 4): only on empty categories. */
body.op-cat-has-products .op-coming-soon {
	display: none !important;
}
body.op-cat-empty .et_pb_shop .woocommerce-info {
	display: none;
}

/* WooCommerce's green "In stock" text (#958e09) is only 3:1 on the Bone background; a darker shade of the same hue passes WCAG AA (4.5:1). */
.woocommerce div.product .stock.in-stock {
	color: #6b6606;
}
