/* ==========================================================================
   Happy Tema — el aspecto del sitio por sección

   Cada sección (barra, categorías de la tienda, productos de /tienda,
   carruseles de la home) usa el estilo que se le eligió en Happy Plus →
   Tema, o ninguno ("Limpio"). Lo dice la clase de <body> (ht-categorias-
   natural, ht-tarjetas-tecnologia…); la barra la decide Happy Menu con su
   clase hm-estilo-<estilo>, que este plugin le indica.

   Los colores son variables por estilo (--ht-<estilo>-acento, …) que
   escribe el plugin desde el panel. Acá NO hay ningún color fijo de un
   estilo: todo sale de esas variables, así cambiar el acento lo cambia en
   todos lados.

   Para mejorar algo visual se toca este archivo; Happy Menu, Happy Store y
   Happy Homepage siguen dibujando su HTML como siempre.
   ========================================================================== */

/* ==========================================================================
   1. Barra de navegación (Happy Menu)
   ========================================================================== */

/* Los colores de la barra salen de la paleta de acá para los cuatro
   estilos. `body` delante: le gana a las variables de fábrica de Happy
   Menu (una sola clase) y a las de su hamburguesa. */
body .hm-estilo-natural,
body .ast-mobile-popup-drawer:has(.hm-ac.hm-estilo-natural) {
	--hm-fondo: var(--ht-natural-fondo);
	--hm-color: var(--ht-natural-texto);
	--hm-acento: var(--ht-natural-acento);
	--hm-panel-fondo: var(--ht-natural-panel);
	--hm-panel-texto: var(--ht-natural-panel-texto);
}

body .hm-estilo-ferreteria,
body .ast-mobile-popup-drawer:has(.hm-ac.hm-estilo-ferreteria) {
	--hm-fondo: var(--ht-ferreteria-fondo);
	--hm-color: var(--ht-ferreteria-texto);
	--hm-acento: var(--ht-ferreteria-acento);
	--hm-panel-fondo: var(--ht-ferreteria-panel);
	--hm-panel-texto: var(--ht-ferreteria-panel-texto);
}

body .hm-estilo-industrial,
body .ast-mobile-popup-drawer:has(.hm-ac.hm-estilo-industrial) {
	--hm-fondo: var(--ht-industrial-fondo);
	--hm-color: var(--ht-industrial-texto);
	--hm-acento: var(--ht-industrial-acento);
	--hm-panel-fondo: var(--ht-industrial-panel);
	--hm-panel-texto: var(--ht-industrial-panel-texto);
}

/* --- Tecnología: barra blanca, botones con esquina suave, acento al pasar */
body .hm-estilo-tecnologia,
body .ast-mobile-popup-drawer:has(.hm-ac.hm-estilo-tecnologia) {
	--hm-fondo: var(--ht-tecnologia-fondo);
	--hm-color: var(--ht-tecnologia-texto);
	--hm-acento: var(--ht-tecnologia-acento);
	--hm-panel-fondo: var(--ht-tecnologia-panel);
	--hm-panel-texto: var(--ht-tecnologia-panel-texto);
	--hm-item-tamano: 15px;
	--hm-item-peso: 500;
	--hm-alto: 52px;
	--hm-separacion: 4px;
}

.hm-estilo-tecnologia .hm-barra .hm-item {
	padding: 8px 14px;
	border-radius: 8px;
}

.hm-estilo-tecnologia .hm-barra .hm-item:hover,
.hm-estilo-tecnologia .hm-barra .hm-item[aria-expanded="true"] {
	background: color-mix(in srgb, var(--hm-acento) 10%, transparent);
	color: var(--hm-acento);
	text-decoration: none;
}

.hm-estilo-tecnologia .hm-barra .hm-item--destacado {
	background: var(--hm-acento);
	color: #fff;
}

.hm-cajon.hm-estilo-tecnologia .hm-cajon__cabeza {
	background: var(--hm-fondo);
	color: var(--hm-color);
	border-bottom: 1px solid color-mix(in srgb, var(--hm-color) 12%, transparent);
}

.hm-cajon.hm-estilo-tecnologia .hm-ac a.hm-ac-enlace,
.hm-ac.hm-estilo-tecnologia a.hm-ac-enlace {
	font-weight: 500;
}

.hm-cajon.hm-estilo-tecnologia .hm-cajon__panel {
	border-radius: 0 12px 12px 0;
}

/* ==========================================================================
   2. Categorías de la tienda (Happy Store: columna y panel de filtros)
   ========================================================================== */

/* Paleta del estilo → variables del filtro de Happy Store. */
body.ht-categorias-natural { --ht-c-fondo: var(--ht-natural-fondo); --ht-c-texto: var(--ht-natural-texto); --ht-c-acento: var(--ht-natural-acento); --ht-c-panel: var(--ht-natural-panel); --ht-c-panel-texto: var(--ht-natural-panel-texto); --ht-c-recuadro: var(--ht-natural-recuadro); }
body.ht-categorias-ferreteria { --ht-c-fondo: var(--ht-ferreteria-fondo); --ht-c-texto: var(--ht-ferreteria-texto); --ht-c-acento: var(--ht-ferreteria-acento); --ht-c-panel: var(--ht-ferreteria-panel); --ht-c-panel-texto: var(--ht-ferreteria-panel-texto); --ht-c-recuadro: var(--ht-ferreteria-recuadro); }
body.ht-categorias-industrial { --ht-c-fondo: var(--ht-industrial-fondo); --ht-c-texto: var(--ht-industrial-texto); --ht-c-acento: var(--ht-industrial-acento); --ht-c-panel: var(--ht-industrial-panel); --ht-c-panel-texto: var(--ht-industrial-panel-texto); --ht-c-recuadro: var(--ht-industrial-recuadro); }
body.ht-categorias-tecnologia { --ht-c-fondo: var(--ht-tecnologia-fondo); --ht-c-texto: var(--ht-tecnologia-texto); --ht-c-acento: var(--ht-tecnologia-acento); --ht-c-panel: var(--ht-tecnologia-panel); --ht-c-panel-texto: var(--ht-tecnologia-panel-texto); --ht-c-recuadro: var(--ht-tecnologia-recuadro); }

body.ht-categorias .wc-cat-wrap,
body.ht-categorias .wc-cat-activos,
body.ht-categorias .hs-orden {
	--wc-cat-texto: var(--ht-c-panel-texto);
	--wc-cat-fondo-panel: var(--ht-c-panel);
	--wc-cat-activo: var(--ht-c-acento);
	--wc-cat-toggle: var(--ht-c-panel-texto);
	--wc-cat-hover: color-mix(in srgb, var(--ht-c-acento) 12%, transparent);
	--wc-cat-borde: color-mix(in srgb, var(--ht-c-panel-texto) 12%, transparent);
	--wc-cat-cantidad: color-mix(in srgb, var(--ht-c-panel-texto) 55%, transparent);
	--wc-cat-familia: inherit;
	--wc-cat-font-main: 15px;
	--wc-cat-font-sub: 14px;
	--wc-cat-peso: 400;
	--wc-cat-peso-activa: 600;
}

body.ht-categorias .wc-cat-wrap .wc-cat-title {
	padding: 10px 6px;
	border-radius: 0;
	border-bottom: 1px solid var(--wc-cat-borde);
}

body.ht-categorias .wc-cat-wrap .wc-cat-title:hover,
body.ht-categorias .wc-cat-wrap .wc-cat-title.is-active:hover {
	background: transparent;
	color: var(--wc-cat-activo);
}

body.ht-categorias .wc-cat-wrap .wc-cat-title.is-active {
	box-shadow: inset 3px 0 0 var(--wc-cat-activo);
	padding-left: 12px;
}

body.ht-categorias .wc-cat-wrap .wc-cat-toggle {
	color: var(--wc-cat-texto);
	font-size: 18px;
	font-weight: 400;
}

body.ht-categorias .wc-cat-wrap .wc-cat-grupo-titulo {
	color: var(--wc-cat-texto);
	border-bottom: 2px solid var(--wc-cat-activo);
}

/* La última categoría ya tiene su línea abajo: la del bloque de Marcas
   sobraba y quedaban dos rayas juntas. */
body.ht-categorias .wc-cat-wrap .wc-cat-marcas-grupo {
	border-top: 0;
	padding-top: 8px;
}

body.ht-categorias .wc-cat-panel-head {
	padding: 18px 12px 14px 20px;
	background: var(--ht-c-fondo);
	color: var(--ht-c-texto);
	border-bottom: 3px solid var(--ht-c-acento);
}

body.ht-categorias .wc-cat-panel-head h2,
body.ht-categorias .wc-cat-panel-head .wc-cat-cerrar {
	color: inherit;
	font-size: 16px;
	font-weight: 700;
}

body.ht-categorias .wc-cat-wrap .wc-cat-ver {
	background: var(--wc-cat-activo);
	border-color: var(--wc-cat-activo);
	color: #fff;
}

/* Ferretería e Industrial: mayúsculas, como su barra. */
body.ht-categorias-ferreteria .wc-cat-wrap .wc-cat-grupo-titulo,
body.ht-categorias-industrial .wc-cat-wrap .wc-cat-grupo-titulo,
body.ht-categorias-ferreteria .wc-cat-panel-head h2,
body.ht-categorias-industrial .wc-cat-panel-head h2 {
	text-transform: uppercase;
	letter-spacing: .05em;
}

body.ht-categorias-ferreteria .wc-cat-wrap .wc-cat-link {
	font-weight: 600;
}

body.ht-categorias-industrial .wc-cat-wrap .wc-cat-link {
	text-transform: uppercase;
	letter-spacing: .05em;
	font-size: 13px;
	font-weight: 600;
}

/* Natural: panel redondeado. */
body.ht-categorias-natural .wc-cat-panel {
	border-radius: 0 18px 18px 0;
	overflow: hidden;
}

/* Tecnología: sin rayas entre filas y con una casilla delante de cada
   categoría y marca (la elegida, marcada), como un filtro de checkboxes.
   Los números se van: en este rubro la lista es corta y se lee mejor. */
body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-title {
	border-bottom: 0;
	padding: 6px 4px;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-title.is-active {
	box-shadow: none;
	padding-left: 4px;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-link {
	justify-content: flex-start;
	gap: 10px;
	font-size: 14px;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-link::before {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border: 1.5px solid color-mix(in srgb, var(--wc-cat-texto) 45%, transparent);
	border-radius: 3px;
	background: #fff;
	align-self: center;
	transition: background-color .15s ease, border-color .15s ease;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-title.is-active .wc-cat-link::before,
body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-link[aria-current="page"]::before {
	border-color: var(--wc-cat-activo);
	background: var(--wc-cat-activo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-count {
	display: none;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-grupo-titulo {
	border-bottom: 0;
	padding-bottom: 4px;
	font-weight: 700;
	font-size: 16px;
}

body.ht-categorias-tecnologia .wc-cat-wrap .wc-cat-marcas-grupo {
	border-top: 1px solid color-mix(in srgb, var(--wc-cat-texto) 70%, transparent);
}

/* ==========================================================================
   3. Recuadro detrás de Categorías y Marcas (solo en computadora)
   Encendido desde el panel. Cada estilo le da su forma; con la sección en
   "Limpio" es un gris neutro.
   ========================================================================== */

@media (min-width: 1024px) {
	body.ht-recuadro .wc-cat-wrap:not(.is-movido) .wc-cat-panel {
		padding: 22px 22px 18px;
		background: var(--ht-c-recuadro, #f5f6f8);
		border-radius: 10px;
	}

	body.ht-recuadro-natural .wc-cat-wrap:not(.is-movido) .wc-cat-panel {
		border-radius: 20px;
		border: 1px solid color-mix(in srgb, var(--ht-c-acento) 20%, transparent);
		overflow: visible;
	}

	body.ht-recuadro-ferreteria .wc-cat-wrap:not(.is-movido) .wc-cat-panel {
		border-radius: 4px;
		border-left: 4px solid var(--ht-c-acento);
	}

	body.ht-recuadro-industrial .wc-cat-wrap:not(.is-movido) .wc-cat-panel {
		border-radius: 8px;
		overflow: hidden;
		border: 1px solid color-mix(in srgb, var(--ht-c-panel-texto) 15%, transparent);
		border-top: 3px solid var(--ht-c-acento);
	}

	body.ht-recuadro-tecnologia .wc-cat-wrap:not(.is-movido) .wc-cat-panel {
		border-radius: 8px;
		box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 10px rgba(0, 0, 0, .04);
	}

	body.ht-recuadro .wc-cat-wrap:not(.is-movido) .wc-cat-panel-body {
		padding: 0;
	}
}

/* ==========================================================================
   4. Tarjetas de producto: /tienda (ht-tarjetas-*) y carruseles de la home
   (ht-carrusel-*)

   Cada sección tiene su estilo: una tienda puede tener la tienda en
   Tecnología y la home en Limpio, o al revés.
   ========================================================================== */

/* Los colores, tamaños, bordes y el botón de la tarjeta NO se pintan acá:
   los decide "Tarjeta de producto" (HT_Tarjeta) y se los dicta a Happy
   Store y Happy Homepage, que los imprimen como siempre. Acá quedan solo
   los detalles de forma que hacen reconocible a cada estilo. */

/* /tienda: el botón (y el sumador) al pie, a la misma altura en la fila. */
body.ht-tarjetas ul.products li.product {
	display: flex;
	flex-direction: column;
}

body.ht-tarjetas ul.products li.product .astra-shop-summary-wrap {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

body.ht-tarjetas ul.products li.product .astra-shop-summary-wrap > .button,
body.ht-tarjetas ul.products li.product .astra-shop-summary-wrap > .ht-agregar {
	margin-top: auto;
}

/* Tecnología: sombra suave que crece al pasar el mouse. */
body.ht-tarjetas-tecnologia ul.products li.product,
body.ht-carrusel-tecnologia .lpc-carousel .lpc-card {
	box-shadow: 0 1px 3px rgba(0, 0, 0, .07), 0 4px 14px rgba(0, 0, 0, .05) !important;
	transition: box-shadow .2s ease;
}

body.ht-tarjetas-tecnologia ul.products li.product:hover,
body.ht-carrusel-tecnologia .lpc-carousel .lpc-card:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 10px 24px rgba(0, 0, 0, .08) !important;
}

/* Industrial: franja de acento arriba de cada tarjeta. */
body.ht-tarjetas-industrial ul.products li.product,
body.ht-carrusel-industrial .lpc-carousel .lpc-card {
	border-top: 3px solid var(--ht-industrial-acento) !important;
}

/* Natural: sombra cálida apenas visible. */
body.ht-tarjetas-natural ul.products li.product:hover,
body.ht-carrusel-natural .lpc-carousel .lpc-card:hover {
	box-shadow: 0 6px 18px color-mix(in srgb, var(--ht-natural-texto) 12%, transparent) !important;
}

/* ==========================================================================
   5. Sumador de cantidad: [ − 1 + ] [ Agregar ]
   Lo imprime HT_Cantidad en todo producto simple; se muestra solo donde
   está encendido (ht-cant-tarjetas, ht-cant-carrusel). En el celular, el
   sumador va arriba del botón.
   ========================================================================== */

.ht-agregar {
	display: flex;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.ht-agregar > .button {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
}

.ht-cantidad {
	display: none;
}

body.ht-cant-tarjetas ul.products .ht-cantidad,
body.ht-cant-carrusel .lpc-carousel .ht-cantidad {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	border: 1.5px solid var(--ht-k-btn-fondo, currentColor);
	border-radius: var(--ht-k-btn-radio, 8px);
	background: var(--ht-k-fondo, #fff);
	overflow: hidden;
}

.ht-cantidad__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	min-height: 34px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--ht-k-texto, inherit) !important;
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
}

.ht-cantidad__btn:hover {
	color: var(--ht-k-btn-fondo, inherit) !important;
}

.ht-cantidad__num {
	width: 34px;
	min-height: 34px;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--ht-k-texto, inherit);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.ht-cantidad__num::-webkit-outer-spin-button,
.ht-cantidad__num::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Si el sumador está apagado en esa sección, el botón ocupa todo. */
body:not(.ht-cant-tarjetas) ul.products .ht-agregar,
body:not(.ht-cant-carrusel) .lpc-carousel .ht-agregar {
	display: block;
}

@media (max-width: 767px) {
	body.ht-cant-tarjetas ul.products .ht-agregar,
	body.ht-cant-carrusel .lpc-carousel .ht-agregar {
		flex-direction: column;
	}

	body.ht-cant-tarjetas ul.products .ht-cantidad,
	body.ht-cant-carrusel .lpc-carousel .ht-cantidad {
		justify-content: space-between;
		width: 100%;
	}

	body.ht-cant-tarjetas ul.products .ht-cantidad__num,
	body.ht-cant-carrusel .lpc-carousel .ht-cantidad__num {
		flex: 1 1 auto;
	}
}


/* ==========================================================================
   6. Medidas armónicas en tablet y celular, y precios apilados (1.2.0)

   Para la tienda y los carruseles por igual, con cualquier estilo (también
   en "Limpio"): el tamaño de cada cosa en tablet y celular sale de
   HT_Tarjeta::escala_automatica(); acá va lo que no es un tamaño.
   ========================================================================== */

/* El precio anterior (tachado) SIEMPRE arriba del precio nuevo, uno por
   renglón. En la misma línea, según cuántos dígitos tuviera cada producto
   entraban o se partían, y la fila quedaba desfasada. */
body.ht-activo ul.products li.product .price del,
body.ht-activo ul.products li.product .price ins,
body.ht-activo .lpc-carousel .lpc-price del,
body.ht-activo .lpc-carousel .lpc-price ins {
	display: block;
	margin: 0;
	text-decoration-thickness: 1px;
}

body.ht-activo ul.products li.product .price ins,
body.ht-activo .lpc-carousel .lpc-price ins {
	text-decoration: none;
}

body.ht-activo ul.products li.product .price del,
body.ht-activo .lpc-carousel .lpc-price del {
	margin-bottom: 2px;
	line-height: 1.2;
}

@media (max-width: 1024px) {
	/* El botón nunca se corta con "…": si el texto no entra en una línea,
	   pasa a dos. Happy Store y los carruseles le fuerzan nowrap. */
	body.ht-activo ul.products li.product .button,
	body.ht-activo .lpc-carousel .lpc-cart .button {
		white-space: normal !important;
		text-overflow: clip !important;
		overflow: visible !important;
		line-height: 1.2 !important;
		padding-left: 8px !important;
		padding-right: 8px !important;
	}
}

@media (max-width: 767px) {
	body.ht-activo ul.products li.product .button,
	body.ht-activo .lpc-carousel .lpc-cart .button {
		letter-spacing: 0 !important;
		padding-left: 6px !important;
		padding-right: 6px !important;
	}

	/* Menos aire entre la foto, el título, el precio y el botón: en media
	   pantalla el título necesita el lugar. */
	body.ht-activo ul.products li.product {
		--hs-card-pad: 10px;
		--hs-price-top: 6px;
		--hs-price-bottom: 8px;
	}

	body.ht-activo ul.products li.product .woocommerce-loop-product__title {
		margin: 6px 0 2px !important;
	}

	body.ht-activo .lpc-carousel .lpc-body {
		padding: 10px 10px 12px !important;
		gap: 5px !important;
	}

	body.ht-activo .lpc-carousel .lpc-cart {
		padding-top: 4px !important;
	}
}


/* Industrial con esquinas de 8 px (1.2.1, a pedido): el recuadro de
   categorías, las tarjetas y los botones (desde HT_Tarjeta::preset), el
   panel de filtros y el panel lateral del menú. */
body.ht-categorias-industrial .wc-cat-panel {
	border-radius: 0 8px 8px 0;
	overflow: hidden;
}

@media (min-width: 1024px) {
	body.ht-categorias-industrial .wc-cat-wrap:not(.is-movido) .wc-cat-panel {
		border-radius: 8px;
	}
}

.hm-cajon.hm-estilo-industrial .hm-cajon__panel {
	border-radius: 0 8px 8px 0 !important;
	overflow: hidden;
}

.hm-cajon--derecha.hm-estilo-industrial .hm-cajon__panel {
	border-radius: 8px 0 0 8px !important;
}

body.ht-tarjetas-industrial ul.products li.product,
body.ht-carrusel-industrial .lpc-carousel .lpc-card {
	overflow: hidden;
}
