/*
Theme Name: Kadence Child - One Cent Parfums
Template: kadence
Description: WPRobo child theme for One Cent Parfums. Home for all custom business logic (checkout, shipping, promotions, order lifecycle, product data) as well as visual/template overrides — see wp-content/docs/scope.md for the full architecture.
Version: 1.6.3
Author: WPRobo
Author URI: https://wprobo.com
Text Domain: wpr-store
*/

/*
 * Form fields: one border and one focus style for WooCommerce and theme
 * fields. Colours follow Customize > Colors and the corners follow
 * Customize > Buttons. Kadence Forms take their look from their own block
 * settings; only their focus is set here.
 */
:root {
	/* The two text colours the palette doesn't have: muted grey and a darker gold that passes contrast on white. */
	--wpr-muted: #6b6b6b;
	--wpr-gold-text: #8a6a36;
	--wpr-field-border: var(--global-palette6); /* The newsletter field's border; about 14:1 on white. */
	--wpr-field-focus: var(--global-palette3);
}

/* html:root outranks WooCommerce's own field selectors. */
html:root .wc-block-components-text-input.wc-block-components-text-input input,
html:root .wc-block-components-textarea.wc-block-components-textarea,
html:root .wc-blocks-components-select .wc-blocks-components-select__select,
html:root .wc-block-components-quantity-selector.wc-block-components-quantity-selector,
html:root .wc-block-product-filter-price-slider.wc-block-product-filter-price-slider input:not([type="range"]),
.woocommerce form .input-text,
.woocommerce form select,
.woocommerce .quantity .qty {
	border: 1px solid var(--wpr-field-border);
	border-radius: var(--wpr-btn-radius);
}

/* The quantity box draws its border on the wrapper, so its buttons and input carry none. */
html:root .wc-block-components-quantity-selector.wc-block-components-quantity-selector::after {
	border: 0;
}

/*
 * Focus thickens the field's own border to 2px instead of adding a ring
 * outside it, so a focused field shows one line, not two.
 */
:root :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus {
	outline: none !important;
	border-color: var(--wpr-field-focus) !important;
	box-shadow: 0 0 0 1px var(--wpr-field-focus) !important;
}

/* Phones: 16px field text, so iOS doesn't zoom the page when a field is tapped. */
@media (max-width: 767px) {
	html:root :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]) {
		font-size: 16px;
	}
}

/* Checkboxes and radios keep a ring, as they have no field border to thicken. */
:root input:is([type="checkbox"], [type="radio"], [type="range"]):focus-visible {
	outline: 2px solid var(--wpr-field-focus) !important;
	outline-offset: 2px;
}

/* The cart quantity box draws its border on the wrapper, so the wrapper shows focus. */
:root .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input:focus {
	border-color: transparent !important;
	box-shadow: none !important;
}

.wc-block-components-quantity-selector:focus-within {
	border-color: var(--wpr-field-focus);
	box-shadow: 0 0 0 1px var(--wpr-field-focus);
}

/* Fields on dark backgrounds focus in white; the contact form's underline fields thicken the underline only. */
#search-drawer {
	--wpr-field-focus: var(--global-palette9);
}

:root .kadence-column1182_f41af0-35 :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus {
	border-color: var(--global-palette9) !important;
	box-shadow: 0 1px 0 0 var(--global-palette9) !important;
}

/*
 * Kadence Forms messages. A field error is a short line under the field and
 * the field border turns red; the form message is a slim panel with a
 * coloured edge. Red and green come from palette 13 and 11.
 */
.kb-form-wrap {
	--wpr-form-error: var(--global-palette13);
	--wpr-form-success: var(--global-palette11);
	--wpr-form-message-text: var(--global-palette3);
}

:root .kb-form .kb-form-error-msg {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 6px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wpr-form-error);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
}

:root .kb-form .kb-form-error-msg::before {
	content: '!';
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--wpr-form-error);
	color: var(--global-palette9);
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
}

:root .kb-form .kb-field.has-error {
	border-color: var(--wpr-form-error) !important;
}

:root .kb-form-wrap .kadence-blocks-form-message {
	margin: 16px 0 0;
	padding: 12px 16px;
	border: 0;
	border-left: 3px solid var(--wpr-form-error);
	border-radius: 0 6px 6px 0;
	background: color-mix(in srgb, var(--wpr-form-error) 7%, transparent);
	color: var(--wpr-form-message-text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-align: left;
}

:root .kb-form-wrap .kadence-blocks-form-message.kadence-blocks-form-success {
	border-left-color: var(--wpr-form-success);
	background: color-mix(in srgb, var(--wpr-form-success) 8%, transparent);
}

/* On the dark contact panel: a lighter red, and white message text. */
.kadence-column1182_f41af0-35 .kb-form-wrap {
	--wpr-form-error: color-mix(in srgb, var(--global-palette13) 40%, var(--global-palette9));
	--wpr-form-success: color-mix(in srgb, var(--global-palette11) 40%, var(--global-palette9));
	--wpr-form-message-text: var(--global-palette9);
}

.kadence-column1182_f41af0-35 .kb-form .kb-form-error-msg::before {
	color: var(--global-palette3);
}

/* Dots take their text colour from Kadence (white), so that can't be used on white sections. */
.splide__pagination__page:focus-visible {
	outline: 2px solid var(--global-palette3) !important;
	outline-offset: 3px;
}

.kb-row-layout-idoc_hero2_row .splide__pagination__page:focus-visible {
	outline-color: var(--global-palette9) !important;
}

/*
 * Small controls the theme renders below the 24px target size.
 */
.dropdown-nav-special-toggle {
	min-width: 24px;
	min-height: 24px;
}

.show-password-input {
	min-width: 24px;
	min-height: 24px;
}

/*
 * Contacts page — contact-form column sits on a photographic background.
 * Kadence's column-level overlay attributes didn't translate into any
 * visible effect for this block, so the darkening is done directly here:
 * a dark scrim behind the form content keeps the white labels/inputs
 * readable regardless of what part of the photo is behind them.
 */
.kadence-column1182_f41af0-35 .kt-inside-inner-col {
	position: relative;
}

.kadence-column1182_f41af0-35 .kt-inside-inner-col::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(13, 13, 13, 0.5);
	pointer-events: none;
	z-index: 0;
}

.kadence-column1182_f41af0-35 .kt-inside-inner-col > * {
	position: relative;
	z-index: 1;
}

/*
 * Header top announcement bar — a single Kadence "Header HTML" block (the
 * header builder only supports one global HTML block, so the 3 messages
 * live inside it as one flex row rather than 3 separate header elements).
 */
.header-html .wpr-announce-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
}

.header-html .wpr-announce-item {
	font-family: 'Montserrat', sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--global-palette9);
	white-space: nowrap;
}

@media (max-width: 600px) {
	.header-html .wpr-announce-bar {
		flex-wrap: wrap;
		justify-content: center;
		gap: 2px 14px;
	}

	.header-html .wpr-announce-item {
		font-size: 11px;
		letter-spacing: 0.03em;
		white-space: normal;
		text-align: center;
	}
}

.site-top-header-wrap .site-header-row-container-inner {
	width: 100%;
}

/*
 * Homepage trust marquee — continuous-scroll strip of trust points below
 * the hero carousel. Content/speed come from Customizer > Trust Marquee
 * (see inc/marquee.php); this is just the look + animation.
 */
.wpr-marquee {
	--wpr-marquee-speed: 32s;
	position: relative;
	overflow: hidden;
	background: linear-gradient(90deg, var(--global-palette3) 0%, #1a1308 30%, #3d2e0a 60%, var(--global-palette3) 100%);
	padding: 18px 0;
}

.wpr-marquee::before,
.wpr-marquee::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 64px;
	z-index: 2;
	pointer-events: none;
}

.wpr-marquee::before {
	left: 0;
	background: linear-gradient(90deg, var(--global-palette3), transparent);
}

.wpr-marquee::after {
	right: 0;
	background: linear-gradient(270deg, var(--global-palette3), transparent);
}

.wpr-marquee-track {
	display: flex;
	width: max-content;
	animation: wpr-marquee-scroll var(--wpr-marquee-speed) linear infinite;
}

.wpr-marquee:hover .wpr-marquee-track,
.wpr-marquee:focus-within .wpr-marquee-track,
.wpr-marquee.is-paused .wpr-marquee-track {
	animation-play-state: paused;
}

.wpr-marquee-toggle {
	position: absolute;
	top: 50%;
	right: 8px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--global-palette2);
	border-radius: 50%;
	background: var(--global-palette3);
	color: var(--global-palette2);
	transform: translateY(-50%);
	cursor: pointer;
}

.wpr-marquee-toggle[hidden] {
	display: none;
}

.wpr-marquee-toggle:hover {
	background: var(--global-palette2);
	color: var(--global-palette3);
}

.wpr-marquee-toggle:focus-visible {
	outline: 2px solid var(--global-palette9);
	outline-offset: 2px;
}

.wpr-marquee-toggle svg {
	width: 14px;
	height: 14px;
}

.wpr-marquee-icon-play,
.wpr-marquee-toggle[aria-pressed="true"] .wpr-marquee-icon-pause {
	display: none;
}

.wpr-marquee-toggle[aria-pressed="true"] .wpr-marquee-icon-play {
	display: block;
}

.wpr-marquee-group {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.wpr-marquee-item {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--global-palette7);
	white-space: nowrap;
	padding: 0 28px;
}

.wpr-marquee-item svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: var(--global-palette2);
}

.wpr-marquee-sep {
	color: var(--global-palette2);
	font-size: 10px;
	opacity: 0.55;
}

@keyframes wpr-marquee-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpr-marquee-track {
		animation: none;
	}

	/* Nothing moves here, so there is nothing to pause. */
	.wpr-marquee-toggle {
		display: none;
	}
}

@media (max-width: 600px) {
	.wpr-marquee-item {
		font-size: 12px;
		padding: 0 18px;
		gap: 8px;
	}

	.wpr-marquee-item svg {
		width: 15px;
		height: 15px;
	}
}

/*
 * Shop The Collection filter tabs (Kadence Tabs block, class
 * wpr-shop-filter-tabs) — the block's own Style panel only exposes
 * Normal/Hover/Active colors one field at a time, slow to get an exact
 * match through; this gets the rounded-pill look in one pass, scoped to
 * just this block via its own custom class so it doesn't affect any
 * other Tabs block on the site.
 */
.wpr-shop-filter-tabs .kt-tabs-title-list {
	justify-content: center;
	flex-wrap: wrap;
	gap: 14px;
}

.wpr-shop-filter-tabs .kt-title-item {
	margin: 0;
}

.wpr-shop-filter-tabs .kt-tab-title {
	/* !important throughout this block: Kadence emits an inline <style>
	   block scoped to this instance's own ID (padding, border-radius,
	   display:flex, etc.) loaded after this stylesheet with the same
	   selector specificity, so it wins on every property left unmarked —
	   confirmed live (computed border-radius was its default asymmetric
	   "4px 4px 999px 999px", not a clean pill, with no border at all). */
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 12px 30px !important;
	border: 1.5px solid var(--global-palette3) !important;
	border-radius: 999px !important;
	background: var(--global-palette9) !important;
	color: var(--global-palette3) !important;
	font-family: 'Montserrat', sans-serif !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.wpr-shop-filter-tabs .kt-title-item.kt-tab-title-active .kt-tab-title {
	background: var(--global-palette3) !important;
	border-color: var(--global-palette3) !important;
	color: var(--global-palette9) !important;
}

.wpr-shop-filter-tabs .kt-title-item.kt-tab-title-inactive .kt-tab-title:hover {
	border-color: var(--global-palette2) !important;
	color: var(--global-palette3) !important;
}

/* Kadence's own default "Content Settings > Border" (1px, light gray)
   boxes the whole tab panel — sits right under the pill row, making
   them read as clipped. Not wanted; drop it. */
.wpr-shop-filter-tabs .kt-tab-inner-content {
	border: none !important;
}

@media (max-width: 600px) {
	.wpr-shop-filter-tabs .kt-tab-title {
		padding: 10px 20px !important;
		font-size: 12px !important;
	}
}

/* 404 page (404.php). */
.wpr-404 {
	max-width: 640px;
	margin: 0 auto;
	padding: 64px 0;
	text-align: center;
}

@media (max-width: 600px) {
	.site-bottom-footer-inner-wrap .footer-html-inner p {
		flex-direction: column;
	}
}

/*
 * Buttons. Colours, type, padding and radius come from Customize > General >
 * Buttons: the primary style for light backgrounds, the secondary style for
 * dark ones. The --wpr-btn-* variables mirror that panel (functions.php),
 * so buttons that WooCommerce, Kadence Forms or the product cards size on
 * their own match the rest. These rules only cover what Kadence's own
 * settings don't reach.
 */
.wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button),
.wp-block-button__link {
	border-radius: var(--wpr-btn-radius);
}

:root .wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button),
:root .wc-block-cart__submit-button,
:root .wc-block-product-filters__apply,
:root .kb-form .kadence-blocks-form-field .kb-forms-submit,
:root .woocommerce div.product form.cart .single_add_to_cart_button,
:root .woocommerce form .form-row .button,
:root .wc-block-components-product-button .wp-block-button__link,
:root .wc-block-grid__product-add-to-cart .wp-block-button__link,
:root .woocommerce ul.products li.product .product-action-wrap .button {
	min-height: 44px;
	padding: var(--wpr-btn-padding);
	font-size: var(--wpr-btn-font-size);
	font-weight: var(--wpr-btn-font-weight);
	line-height: 1.4;
	letter-spacing: 0.03em;
}

/* Product cards are narrow on phones, so their buttons keep a smaller side padding. */
:root .wc-block-components-product-button .wp-block-button__link,
:root .wc-block-grid__product-add-to-cart .wp-block-button__link,
:root .woocommerce ul.products li.product .product-action-wrap .button {
	padding-left: 12px;
	padding-right: 12px;
	white-space: nowrap;
}

@media (max-width: 767px) {
	:root .wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button),
	:root .wc-block-cart__submit-button,
	:root .wc-block-product-filters__apply,
	:root .kb-form .kadence-blocks-form-field .kb-forms-submit,
	:root .woocommerce div.product form.cart .single_add_to_cart_button,
	:root .woocommerce form .form-row .button {
		padding: var(--wpr-btn-padding-mobile);
	}
}

/* Outline buttons (e.g. Clear filters): fill dark on hover; Kadence's default hover text is gold, which fails contrast. */
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button__link.is-style-outline:hover {
	border-color: var(--global-palette3);
	background: var(--global-palette3);
	color: var(--global-palette9);
}

/* Text-only controls: Kadence's button hover and focus fill shouldn't reach them. */
.wc-block-product-filters__open-overlay:is(:hover, :focus),
.wc-block-product-filters__close-overlay:is(:hover, :focus),
.wc-block-product-filter-removable-chips__remove:is(:hover, :focus),
.wc-block-components-quantity-selector__button:is(:hover, :focus),
.wc-block-components-panel__button:is(:hover, :focus),
.show-password-input:is(:hover, :focus) {
	background: transparent;
	color: var(--global-palette3);
}

/* Selected text: brand gold behind dark text (about 9:1 contrast). Follows Customize > Colors. */
::selection {
	background: var(--global-palette2);
	color: var(--global-palette3);
}

/* Links stay dark on hover (gold text fails contrast on white); the gold shows in the underline. */
a:hover {
	text-decoration-color: var(--global-palette2);
}

/* Menus: a gold underline on hover, in the header, its dropdowns, the mobile menu and the footer. */
.header-navigation .menu-item > a:hover,
.mobile-navigation .menu-item > a:hover,
.site-footer .menu a:hover {
	text-decoration: underline;
	text-decoration-color: var(--global-palette2);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

/*
 * One focus ring for links and buttons: dark with a light halo, visible on
 * light and dark backgrounds. !important because Kadence's button shadow
 * setting writes a focus shadow later in the page.
 */
:root :is(a, button, [role="button"], .button, .wp-block-button__link, .kb-button):focus-visible {
	outline: 2px solid var(--global-palette3) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 4px var(--global-palette9) !important;
}

/* Review stars: 24px targets (WCAG 2.5.8). */
.woocommerce p.stars a {
	width: 24px;
	height: 24px;
	font-size: 24px;
}

/* Home tab pills: a visible hover on the inactive tabs. */
.wpr-shop-filter-tabs .kt-title-item.kt-tab-title-inactive .kt-tab-title:hover {
	background: var(--global-palette7) !important;
}

/*
 * Carousel dots: a 24px tap target (WCAG 2.5.8) with a 10px dot inside.
 * Inactive dots are rings and the active dot is solid, so the state doesn't
 * rely on colour alone. Dark on light sections, white on the dark hero.
 */
.splide__pagination__page {
	position: relative;
	width: 24px !important;
	height: 24px !important;
	margin: 0 !important;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent !important;
	opacity: 1 !important;
	transform: none !important;
	--wpr-dot: var(--global-palette6);
}

.splide__pagination__page::before {
	content: '';
	position: absolute;
	inset: 7px;
	border: 1.5px solid var(--wpr-dot);
	border-radius: 50%;
}

.splide__pagination__page.is-active::before {
	background: var(--wpr-dot);
}

.kb-row-layout-idoc_hero2_row .splide__pagination__page {
	--wpr-dot: var(--global-palette9);
}

/*
 * Spacing. Section padding, gaps and gutters come from each block's spacing
 * settings and from Customize > General > Layout and the Header and Footer
 * builders. These rules only reach parts that have no setting of their own.
 */

/*
 * Drawer close buttons: 44px tap targets (WCAG 2.5.8). The header icons get
 * theirs from their padding settings in the Header builder.
 */
.drawer-header .drawer-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
}

/* Media & Text: the text keeps clear of the image's top and bottom edges, and of the image once stacked. */
.wp-block-media-text > .wp-block-media-text__content {
	padding-top: 32px;
	padding-bottom: 32px;
}

@media (max-width: 600px) {
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content {
		padding-top: 24px;
		padding-bottom: 0;
	}
}

/* Narrow reading pages (the policies): paragraphs about one line apart, list items not touching. */
.content-width-narrow .entry-content p {
	margin-top: 0;
	margin-bottom: 1em;
}

.content-width-narrow .entry-content li + li {
	margin-top: 6px;
}

.content-width-narrow .entry-content :is(h2, h3) {
	margin-bottom: 16px;
}

/* Mobile menu submenu arrows: 44px tap targets. */
.mobile-navigation .drawer-sub-toggle {
	min-width: 44px;
	min-height: 44px;
}
