/* =========================================================================
   MEDIADOR — Página de producto
   Ajustá los colores y tamaños desde las variables de abajo.
   ========================================================================= */

:root {
	--mdr-swatch-bg: #c95c27;
	--mdr-swatch-bg-hover: #bc4d17;
	--mdr-swatch-color: #ffffff;

	--mdr-cart-bg: #33691e;
	--mdr-cart-bg-hover: #284f17;
	--mdr-cart-color: #ffffff;

	--mdr-qty-border: #111111;
	--mdr-radius: 999px;
}


/* -------------------------------------------------------------------------
   1. Ocultar lo que reemplazamos
   ---------------------------------------------------------------------- */

/* El <select> sigue en el DOM (WooCommerce lo necesita) pero no se ve.
   Se oculta con la técnica "visually hidden" en lugar de display:none
   para no romper la validación nativa del formulario. */
.woocommerce div.product form.cart .variations select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Etiqueta "Tamaño" */
.woocommerce div.product form.cart .variations .label,
.woocommerce div.product form.cart .variations th.label,
.woocommerce div.product form.cart .variations label {
	display: none !important;
}

/* Enlace "Limpiar" 
.woocommerce div.product form.cart .reset_variations {
	display: none !important;
} */

/* Contador de stock "10 disponibles".
   Comentá este bloque si querés volver a mostrarlo. 
.woocommerce div.product p.stock {
	display: none !important;
} */

/* El fondo gris del bloque de variaciones que trae el tema */
.woocommerce div.product form.cart table.variations,
.woocommerce div.product form.cart .variations {
	background: transparent !important;
	border: 0 !important;
	margin: 0 0 22px !important;
	width: auto !important;
}

.woocommerce div.product form.cart table.variations td,
.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations tr {
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	display: block !important;
}


/* -------------------------------------------------------------------------
   2. Swatches (píldoras)
   ---------------------------------------------------------------------- */

.mdr-swatches {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
}

.mdr-swatch {
	display: inline-block;
	background: var(--mdr-swatch-bg) !important;
	color: var(--mdr-swatch-color);
	border: 0 !important;
	border-radius: var(--mdr-radius);
	line-height: 1.1;
	cursor: pointer;
	text-align: center;
	transition: background .15s ease, box-shadow .15s ease, opacity .15s ease;
	margin: 0 !important;
}

.mdr-swatch:hover,
.mdr-swatch:focus-visible {
	background: var(--mdr-swatch-bg-hover) !important;
	color: var(--mdr-swatch-color);
}

.mdr-swatch.is-active {
	background: var(--mdr-swatch-bg-hover);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, .85);
}

.mdr-swatch.is-disabled {
	opacity: .35;
	cursor: not-allowed;
	text-decoration: line-through;
}


/* -------------------------------------------------------------------------
   3. Cantidad − / +
   ---------------------------------------------------------------------- */

.mdr-qty {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.mdr-qty-btn {
	background: none !important;
	border: 0;
	padding: 0 4px;
	font-size: 34px;
	font-weight: 400;
	line-height: 1;
	color: var(--mdr-qty-border) !important;
	cursor: pointer;
	transition: opacity .15s ease;
}

.mdr-qty-btn:hover {
	opacity: .6;
}

.woocommerce div.product form.cart .mdr-qty .quantity {
	margin: 0;
	float: none;
}

.woocommerce div.product form.cart .mdr-qty input.qty::-webkit-outer-spin-button,
.woocommerce div.product form.cart .mdr-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}


/* -------------------------------------------------------------------------
   5. Disposición: cantidad y botón en la misma fila
   ---------------------------------------------------------------------- */

.woocommerce div.product .woocommerce-variation-add-to-cart,
.woocommerce div.product form.cart:not(.variations_form):not(.grouped_form) {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
}

/* El precio de la variación va arriba, en su propia línea */
.woocommerce div.product .woocommerce-variation {
	flex: 0 0 100%;
}


/* -------------------------------------------------------------------------
   6. Aviso inline "elegí una opción"
   ---------------------------------------------------------------------- */

.mdr-notice {
	display: none;
	align-items: center;
	gap: 9px;
	width: 100%;
	margin: -35px 0px 20px 0px;
	padding: 12px 18px;
	border-radius: 10px;
	border-left: 4px solid #c0392b;
	background: #fdecea;
	color: #8c2018;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
}

.mdr-notice.is-visible {
	display: flex;
	animation: mdr-notice-in .25s ease;
}

.mdr-notice::before {
	content: "!";
	flex: 0 0 21px;
	height: 21px;
	border-radius: 50%;
	background: #c0392b;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 21px;
	text-align: center;
}

@keyframes mdr-notice-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* Sacudida de las píldoras al intentar comprar sin elegir */
.mdr-shake {
	animation: mdr-shake .5s ease;
}

@keyframes mdr-shake {

	10%,
	90% {
		transform: translateX(-3px);
	}

	20%,
	80% {
		transform: translateX(5px);
	}

	30%,
	50%,
	70% {
		transform: translateX(-8px);
	}

	40%,
	60% {
		transform: translateX(8px);
	}
}

@media (prefers-reduced-motion: reduce) {

	.mdr-shake,
	.mdr-notice.is-visible {
		animation: none;
	}
}


/* -------------------------------------------------------------------------
   7. Toasts — avisos flotantes de WooCommerce
   ---------------------------------------------------------------------- */

#mdr-toasts {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: min(380px, calc(100vw - 32px));
	pointer-events: none;
}

.woocommerce #mdr-toasts .mdr-toast,
#mdr-toasts .mdr-toast {
	position: relative;
	display: block;
	width: 100%;
	margin: 0 !important;
	padding: 18px 46px 18px 20px !important;
	border: 0 !important;
	border-left: 5px solid var(--mdr-cart-bg) !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: #1c1c1c !important;
	font-size: 15px;
	line-height: 1.45;
	list-style: none !important;
	box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
	pointer-events: auto;
	opacity: 0;
	transform: translateX(120%);
	transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .32s ease;
}

#mdr-toasts .mdr-toast.is-in {
	opacity: 1;
	transform: none;
}

#mdr-toasts .mdr-toast.is-out {
	opacity: 0;
	transform: translateX(120%);
}

/* WooCommerce pinta un ::before propio; lo neutralizamos */
#mdr-toasts .mdr-toast::before {
	display: none !important;
}

#mdr-toasts .woocommerce-error {
	border-left-color: #c0392b !important;
}

#mdr-toasts .woocommerce-info {
	border-left-color: #2b6cb0 !important;
}

/* Botón "Ver carrito" dentro del toast */
#mdr-toasts .mdr-toast .button {
	display: inline-block;
	float: none !important;
	margin: 12px 0 0 !important;
	padding: 9px 20px !important;
	border-radius: var(--mdr-radius) !important;
	background: var(--mdr-cart-bg) !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
}

#mdr-toasts .mdr-toast .button:hover {
	background: var(--mdr-cart-bg-hover) !important;
}

.mdr-toast-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #8a8a8a;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.mdr-toast-close:hover {
	background: rgba(0, 0, 0, .07);
	color: #1c1c1c;
}

@media (max-width: 600px) {

	#mdr-toasts {
		top: auto;
		bottom: 16px;
		right: 16px;
		left: 16px;
		width: auto;
	}

	#mdr-toasts .mdr-toast {
		transform: translateY(140%);
	}

	#mdr-toasts .mdr-toast.is-out {
		transform: translateY(140%);
	}
}

@media (prefers-reduced-motion: reduce) {

	#mdr-toasts .mdr-toast {
		transition: opacity .2s ease;
		transform: none !important;
	}
}


/* -------------------------------------------------------------------------
   8. Responsive
   ---------------------------------------------------------------------- */

@media (max-width: 767px) {

	.mdr-swatch {
		padding: 11px 22px;
		font-size: 17px;
	}

	.woocommerce div.product form.cart .mdr-qty input.qty {
		width: 66px;
		height: 50px;
		font-size: 18px;
	}

	.mdr-qty-btn {
		font-size: 30px;
	}

	.woocommerce div.product form.cart .single_add_to_cart_button {
		padding: 15px 26px !important;
		font-size: 18px !important;
	}
}
