/*
 * ToysCore front end styles.
 *
 * Deliberately small. Colours that WoodMart already exposes (row backgrounds,
 * link colours, the primary colour) are set through the theme's own settings or
 * the Header Builder, never here, so the site owner changes them in one place.
 * Only the things that have no theme control live in this file:
 *
 *   1. the dealer application button, which is a text element the Header
 *      Builder renders but cannot style;
 *   2. the top bar notice sizing;
 *   3. the dealer application call to action on the login page, which replaces
 *      a widget WoodMart renders empty;
 *   4. the WholesaleX dealer application form, which ships its own colours and
 *      ignores the WoodMart design tokens.
 */

.artvelog-toys-topbar-note {
	display: inline-block;
	font-size: 13px;
	line-height: 1.4;
}

/* Uses the theme's primary colour so it follows the WoodMart colour settings. */
.artvelog-toys-topbar-button {
	display: inline-block;
	padding: 4px 14px;
	border-radius: var(--wd-form-brd-radius, 3px);
	background-color: var(--wd-primary-color, #3452ef);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.artvelog-toys-topbar-button:hover {
	opacity: 0.85;
	color: #fff;
}

/* Cash payment only badge. */
.artvelog-toys-badge {
	display: inline-block;
	margin: 0 0 12px;
	padding: 4px 10px;
	border-radius: 3px;
	background-color: #1f2933;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/*
 * Dealer price gate.
 *
 * WoodMart prints the same login link in the single product's price slot, on
 * every product card and in the frequently-bought-together totals. The full
 * sentence only reads well in the first; repeated across a grid it is noise.
 * The link therefore carries both labels and these rules choose one: the
 * sentence in the main price slot, the compact badge in lists and bundle
 * totals, and in product cards the badge only once the card is hovered. No
 * template has to know about it.
 */
.artvelog-toys-gate-short {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 999px;
	background-color: #1f2933;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.01em;
	white-space: nowrap;
	vertical-align: middle;
}

.artvelog-toys-price-gate:hover .artvelog-toys-gate-short {
	background-color: #0b1218;
	color: #fff;
}

.artvelog-toys-gate-long {
	display: none;
}

/* Main price slot: explain why the price is missing. */
.wd-single-price .artvelog-toys-price-gate .artvelog-toys-gate-short,
.single-product .entry-summary .price .artvelog-toys-price-gate .artvelog-toys-gate-short {
	display: none;
}

.wd-single-price .artvelog-toys-price-gate .artvelog-toys-gate-long,
.single-product .entry-summary .price .artvelog-toys-price-gate .artvelog-toys-gate-long {
	display: inline;
}

/*
 * Product cards reveal the badge only on hover or keyboard focus. A grid of
 * twelve cards otherwise repeats it twelve times and drowns the page. Opacity
 * is used rather than display so the price line keeps its height and cards do
 * not jump when the badge appears. Hidden links are also kept out of the way
 * of the mouse; keyboard focus still reaches them.
 *
 * Touch screens cannot hover, so there the badge stays visible.
 */
@media (hover: hover) {
	.wd-product .artvelog-toys-price-gate {
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s ease;
	}

	.wd-product:hover .artvelog-toys-price-gate,
	.wd-product:focus-within .artvelog-toys-price-gate {
		opacity: 1;
		pointer-events: auto;
	}
}

/*
 * Replaces WoodMart's register column when registration is switched off.
 *
 * woodmart_register_form() returns immediately when
 * woocommerce_enable_myaccount_registration is not 'yes', which leaves the
 * Elementor wd_my_account_register widget rendering its heading over an empty
 * box. This fills that box with a dealer application call to action instead.
 */
.artvelog-toys-dealer-cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/*
	 * WoodMart gives both my-account columns the height of the taller one, which
	 * is the login form. A fixed `height` on this box therefore made it exactly
	 * that tall and its own content spilled out past the bottom of the card.
	 * `min-height` fills the column when there is room and grows instead of
	 * overflowing when there is not.
	 */
	min-height: 100%;
	box-sizing: border-box;
	padding: 24px;
	border: 1px solid var(--wd-form-brd-color, rgba(0, 0, 0, 0.1));
	border-radius: var(--wd-form-brd-radius, 30px);
	background-color: #fff;
	text-align: center;
}

.artvelog-toys-dealer-cta::before {
	display: block;
	width: 36px;
	height: 36px;
	margin-bottom: 14px;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.05);
	/* Uses the theme's icon font so it follows WoodMart's settings. */
	content: "\f103";
	font-family: "woodmart-font";
	font-size: 17px;
	line-height: 36px;
	color: var(--wd-primary-color, #3452ef);
}

.artvelog-toys-dealer-cta .artvelog-toys-dealer-cta-text {
	margin: 0 0 16px;
	color: var(--wd-text-color, #767676);
	font-size: 14px;
	line-height: 1.6;
}

.artvelog-toys-dealer-cta .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 190px;
	padding: 13px 32px;
	border-radius: var(--wd-form-brd-radius, 30px);
	background-color: var(--wd-primary-color, #3452ef);
	color: #fff;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.artvelog-toys-dealer-cta .button:hover {
	background-color: var(--wd-primary-color, #3452ef);
	filter: brightness(0.92);
	color: #fff;
	transform: translateY(-1px);
}

/* Own brand showcase shortcode. */
.artvelog-toys-own-brands-title {
	text-align: center;
}

.artvelog-toys-own-brands-list {
	display: grid;
	gap: 20px;
	margin: 24px 0;
	padding: 0;
	list-style: none;
}

.artvelog-toys-own-brands-list.columns-6 {
	grid-template-columns: repeat(6, 1fr);
}

.artvelog-toys-own-brands-list.columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.artvelog-toys-own-brands-list.columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.artvelog-toys-own-brand a {
	display: block;
	text-align: center;
	text-decoration: none;
}

.artvelog-toys-own-brand img {
	max-width: 100%;
	height: auto;
	filter: grayscale(100%);
	opacity: 0.75;
	transition: filter 0.25s ease, opacity 0.25s ease;
}

.artvelog-toys-own-brand a:hover img {
	filter: grayscale(0);
	opacity: 1;
}

.artvelog-toys-own-brands-all {
	text-align: center;
}

/*
 * Dealer application form.
 *
 * WholesaleX renders its form with its own `--wsx-*` custom properties, which
 * it writes into `:root` from the colours configured in its form builder. Those
 * values ignore the WoodMart design tokens entirely, so the form looked like a
 * different theme than the rest of the store.
 *
 * The plugin's rules read the variables at use time and most carry
 * `!important`, so overriding the variables on the form wrapper is the only
 * lever that survives: a value declared on the wrapper wins for every element
 * inside it, and `!important` on the declaration itself is not needed.
 *
 * Everything below therefore restates a `--wsx-*` variable in terms of a WoodMart
 * variable. Change the theme colours once and this form follows.
 */
.wholesalex-form,
.wholesalex-form-wrapper {
	/* See the note above: the 1200px cap is applied to both nested elements. */
	--wsx-form-container-width: 100%;
}

.wholesalex-form-wrapper {
	--wsx-input-bg: #fff;
	--wsx-input-color: var(--wd-title-color, #242424);
	--wsx-input-border-color: var(--wd-form-brd-color, rgba(0, 0, 0, 0.1));
	--wsx-input-focus-bg: #fff;
	--wsx-input-focus-color: var(--wd-title-color, #242424);
	/* The theme has no focus colour of its own, so the primary colour is used.
	   It is a solid fill rather than a glow, which keeps an orange usable. */
	--wsx-input-focus-border-color: var(--wd-primary-color, #ef8e26);
	--wsx-input-border-radius: var(--wd-form-brd-radius, 30px);
	--wsx-input-placeholder-color: var(--wd-text-color, #767676);
	--wsx-input-font-size: 15px;
	--wsx-input-font-family: var(--wd-text-font, inherit);
	--wsx-input-padding: 14px 18px;
	--wsx-input-width: 100%;
	--wsx-form-label-color: var(--wd-title-color, #242424);
	--wsx-form-label-color-active: var(--wd-primary-color, #ef8e26);
	--wsx-form-label-font-size: 14px;
	--wsx-form-link-color: var(--wd-primary-color, #ef8e26);
	/* WoodMart exposes no hover shade for the primary colour, so the hover
	   background stays the primary colour and is darkened with a filter below. */
	--wsx-form-button-bg: var(--wd-primary-color, #ef8e26);
	--wsx-form-button-hover-bg: var(--wd-primary-color, #ef8e26);
	--wsx-form-button-color: #fff;
	--wsx-form-button-hover-color: #fff;
	--wsx-form-button-border-width: 0;
	--wsx-form-button-border-radius: var(--wd-form-brd-radius, 30px);
	--wsx-form-button-padding: 15px 34px;
	--wsx-form-button-width: 100%;
	--wsx-form-button-align: center;
	--wsx-form-button-font-size: 15px;
	--wsx-form-button-weight: 600;
	/* The appearance layer is the last word on the button: it pins its height,
	   max-width and radius with `!important`, so those three have to be set
	   here as well or the button stays 36px tall and half width. */
	--wsx-appearance-button-size: 52px;
	--wsx-appearance-button-width: 100%;
	--wsx-appearance-field-shape: var(--wd-form-brd-radius, 30px);
	--wsx-form-container-border-width: 1px;
	--wsx-form-container-border-color: var(--wd-form-brd-color, rgba(0, 0, 0, 0.1));
	--wsx-form-container-radius: 16px;
	--wsx-form-reg-border-width: 1px;
	--wsx-form-reg-border-color: var(--wd-form-brd-color, rgba(0, 0, 0, 0.1));
	--wsx-form-reg-bg: #fff;
	--wsx-reg-title-color: var(--wd-title-color, #242424);
	--wsx-reg-title-font-size: 26px;
	--wsx-reg-description-color: var(--wd-text-color, #767676);
	--wsx-appearance-field-shape: var(--wd-form-brd-radius, 30px);
}

.wholesalex-form-wrapper .wholesalex-form-wrapper,
.wholesalex-form-wrapper .wsx-reg-form-heading-text,
.wholesalex-form-wrapper .wsx-login-form-title-text {
	font-family: var(--wd-title-font, inherit);
}

.wholesalex-form-wrapper button.wsx-register-btn:hover,
.wholesalex-form-wrapper button.wsx-login-btn:hover {
	filter: brightness(0.92);
}

/* The form is a single column of inputs and reads better with the theme's own
   vertical rhythm than with WholesaleX's default 54px padding. */
.wholesalex-form-wrapper .wsx-reg-form-heading {
	margin-bottom: 28px;
}

.wholesalex-form-wrapper .wsx-reg-fields .wsx-reg-form-row {
	margin-bottom: 18px;
}

/* Labels sit above the field; the plugin's heading wrapper only exists to hold
   them, so its own spacing is not needed. */
.wholesalex-form-wrapper .wsx-field-heading {
	margin-bottom: 8px;
}

/* Consent rows carry the text in the checkbox label, not in a label above, so
   they need room to breathe instead of the input spacing. */
.wholesalex-form-wrapper .wsx-reg-fields .wsx-form-checkbox {
	margin-top: 8px;
}

.wholesalex-form-wrapper .wsx-form-checkbox .wholesalex-field-wrap {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.wholesalex-form-wrapper .wsx-form-checkbox .wholesalex-field-wrap > label {
	color: var(--wd-text-color, #767676);
	cursor: pointer;
	line-height: 1.6;
}

/* WholesaleX renders its tick as a text glyph, which lands as a stray character
   once the icon font is not loaded. An inline SVG keeps the box readable. */
.wholesalex-form-wrapper .wsx-form-checkbox .wholesalex-field-wrap > input {
	flex-shrink: 0;
	margin-top: 3px;
	border: 1px solid var(--wd-form-brd-color, rgba(0, 0, 0, 0.1));
	border-radius: 4px;
	background-color: #fff;
	appearance: none;
}

.wholesalex-form-wrapper .wsx-form-checkbox .wholesalex-field-wrap > input:checked {
	border-color: var(--wd-primary-color, #ef8e26);
	background-color: var(--wd-primary-color, #ef8e26);
}

.wholesalex-form-wrapper .wsx-form-checkbox .wholesalex-field-wrap > input:checked::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px 12px;
}

/* Errors are read from the form, so give them a visible weight and a colour the
   theme's own error red matches. */
.wholesalex-form-wrapper .wsx-form-field-warning-message:not(:empty) {
	display: block;
	margin-top: 6px;
	color: #e35050;
	font-size: 13px;
	line-height: 1.5;
}

/* WholesaleX already sizes the wrapper to `width: 100%`; the variable above is
   what lifts the 1200px cap. Nothing else to constrain here. */

/* The button is full width; below 600px the two-column rows stack, or the
   inputs become too narrow to read. */
@media (max-width: 600px) {
	.wholesalex-form-wrapper .wsx-reg-form-row.double-column {
		flex-direction: column;
		gap: 0;
	}
}

@media (max-width: 1024px) {
	.artvelog-toys-own-brands-list.columns-6,
	.artvelog-toys-own-brands-list.columns-4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.artvelog-toys-own-brands-list.columns-6,
	.artvelog-toys-own-brands-list.columns-4,
	.artvelog-toys-own-brands-list.columns-3 {
		grid-template-columns: repeat(2, 1fr);
	}
}