/*
Theme Name: Moto22 Child
Theme URI: https://moto22.pe/
Author: Valdemar Lozada
Description: Personalizaciones del sitio Moto22 sobre el tema padre Moto22.
Version: 0.1.0
Template: moto22
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: moto22-child
*/

/* Añadir aquí únicamente personalizaciones visuales propias de la instalación. */

/* Brand-aware commerce links and hover states. Error colors stay semantic. */
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.wc-block-components-button:not(.is-link):hover {
	background: var(--red);
	color: var(--moto22-on-primary, #fff);
	box-shadow: inset 0 0 0 2px currentColor;
}

.wc-block-components-product-name,
.wc-block-components-product-name:visited,
.wc-block-components-product-name:hover,
.woocommerce-loop-product__link .woocommerce-loop-product__title {
	color: var(--red);
}

:root {
	--moto22-focus-ring: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent);
}

/* Sale hierarchy for native offers and active scheduled promotions. */
body :is(.woocommerce .price, .woocommerce-page .price, .moto22-timed-price, .wc-block-components-product-price, .wp-block-woocommerce-product-price) del {
	display: inline-block;
	margin-inline-end: .45em;
	color: #6b675f;
	font-size: clamp(.8rem, .78em, 1.125rem);
	font-weight: 400;
	line-height: 1.5;
	opacity: 1;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

body :is(.woocommerce .price, .woocommerce-page .price, .moto22-timed-price, .wc-block-components-product-price, .wp-block-woocommerce-product-price) ins {
	display: inline-block;
	background: transparent;
	color: var(--red);
	font-size: 1.12em;
	font-weight: 800;
	line-height: 1.4;
	text-decoration: none;
}

body :is(.woocommerce .price, .woocommerce-page .price, .moto22-timed-price, .wc-block-components-product-price, .wp-block-woocommerce-product-price) :is(del, ins) .woocommerce-Price-amount {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	white-space: nowrap;
}

/* Hide the secondary price only after it has been shown in the main price. */
.single-product .variations_form.moto22-price-synced .woocommerce-variation-price {
	display: none;
}

.single-product div.product form.cart.variations_form .single_variation:not(:empty) {
	background: #f7f7f5;
	border-left-color: var(--line);
}

.single-product div.product .stock {
	display: inline-block;
	padding: .45rem .7rem;
	border-radius: .35rem;
	line-height: 1.4;
}
.single-product div.product .stock.in-stock {
	color: #216337;
	background: #edf7ef;
}
.single-product div.product .stock.out-of-stock {
	color: #a12619;
	background: #fff0ee;
}
.single-product div.product .stock.available-on-backorder {
	color: #205b85;
	background: #edf5fc;
}
.single-product div.product .stock.in-stock.moto22-low-stock {
	color: #79520b;
	background: #fff5dc;
}

/* One thumbnail rail on every screen size instead of an expanding grid. */
.single-product div.product div.images.woocommerce-product-gallery .flex-control-thumbs {
	display: flex;
	flex-wrap: nowrap;
	gap: .65rem;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	padding: .5rem .2rem .8rem;
	margin-top: .75rem;
	scroll-snap-type: x proximity;
	scroll-padding-inline: .2rem;
	scrollbar-width: thin;
	scrollbar-color: #837c72 #f1eee7;
}
.single-product div.product div.images.woocommerce-product-gallery .flex-control-thumbs li {
	flex: 0 0 clamp(4.5rem, 8vw, 5.5rem);
	width: clamp(4.5rem, 8vw, 5.5rem);
	min-width: 0;
	float: none;
	margin: 0;
	scroll-snap-align: start;
}
.single-product div.product div.images.woocommerce-product-gallery .flex-control-thumbs img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	border: 2px solid transparent;
	border-radius: .35rem;
}
.single-product div.product div.images.woocommerce-product-gallery .flex-control-thumbs img.flex-active {
	border-color: var(--red);
	opacity: 1;
}
.single-product div.product div.images.woocommerce-product-gallery .flex-control-thumbs img:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 1px;
}

/* Native sale badges travel with the selected variation's price. */
body .moto22-native-sale-badge {
	display: table;
	margin-top: .55rem;
	padding: .35rem .6rem;
	border-radius: .35rem;
	background: var(--red);
	color: var(--moto22-on-primary, #fff);
	font-size: .8rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: normal;
	text-decoration: none;
}
