/*
 * Modelo Hogar Core: estilos de los componentes funcionales.
 * Los colores vienen del tema (variables --mh-*); aquí hay valores de respaldo.
 */

.mh-icon { flex: none; vertical-align: -0.2em; }

/* Botones (respaldo de baja prioridad: el tema los puede redefinir). */
:where(.mh-btn) {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
	min-height: 48px; padding: 0.7em 1.4em;
	border: 2px solid transparent; border-radius: 6px;
	font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
}
:where(.mh-btn--primary) { background: var(--mh-green, #2f7d1e); color: #fff; }
:where(.mh-btn--secondary) { background: transparent; color: var(--mh-green-dark, #1e4d14); border-color: currentColor; }
:where(.mh-btn--small) { min-height: 40px; padding: 0.4em 1em; }
.mh-btn--whatsapp { background: #25d366; color: #06301a; border-color: #25d366; }
.mh-btn--whatsapp:hover, .mh-btn--whatsapp:focus-visible { background: #1fb957; border-color: #1fb957; color: #06301a; }
.mh-btn[disabled] { opacity: 0.6; cursor: progress; }

.mh-link-button {
	background: none; border: 0; padding: 0; font: inherit; color: var(--mh-muted, #55655a);
	text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.mh-link-button:hover { color: var(--mh-ink, #1c2a1e); }

/* Botón "Agregar a mi cotización". */
.mh-add {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
	width: 100%; min-height: 44px; padding: 0.5em 0.8em;
	background: #fff; color: var(--mh-green-dark, #1e4d14);
	border: 1.5px solid var(--mh-green, #2f7d1e); border-radius: 6px;
	font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.mh-add:hover, .mh-add:focus-visible { background: var(--mh-green, #2f7d1e); color: #fff; }
.mh-add__default, .mh-add__done { display: inline-flex; align-items: center; gap: 0.4em; }
.mh-add__done { display: none; }
.mh-add.is-added { background: var(--mh-tint, #f1f7ea); border-color: var(--mh-tint, #f1f7ea); color: var(--mh-green-dark, #1e4d14); }
.mh-add.is-added .mh-add__default { display: none; }
.mh-add.is-added .mh-add__done { display: inline-flex; }
.mh-add--large { width: auto; flex: 1 1 220px; min-height: 52px; background: var(--mh-green, #2f7d1e); color: #fff; font-size: 1rem; }
.mh-add--large:hover, .mh-add--large:focus-visible { background: var(--mh-green-dark, #1e4d14); border-color: var(--mh-green-dark, #1e4d14); }
.mh-add--large.is-added { background: var(--mh-tint, #f1f7ea); color: var(--mh-green-dark, #1e4d14); border-color: var(--mh-green, #2f7d1e); }

/* Cantidad. */
.mh-qty { display: inline-flex; flex-direction: column; gap: 4px; font-size: 0.875rem; color: var(--mh-muted, #55655a); }
.mh-qty__input {
	width: 6.5em; min-height: 52px; padding: 0.4em 0.6em;
	border: 1.5px solid var(--mh-line-strong, #a9b9a2); border-radius: 6px; background: #fff;
	font: inherit; font-size: 1rem; font-weight: 600; color: var(--mh-ink, #1c2a1e); text-align: center;
}
.mh-qty--inline .mh-qty__input { min-height: 44px; width: 5.5em; }

/* Bloque de cotización en la ficha del producto. */
.mh-quote-box { margin: 1.5rem 0; padding: 1.25rem; background: var(--mh-tint, #f1f7ea); border-radius: 8px; }
.mh-quote-box__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.mh-quote-box__links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 1rem 0 0; font-size: 0.9375rem; }
.mh-wa-link { display: inline-flex; align-items: center; gap: 0.4em; }

/* Página "Mi cotización". */
.mh-quote__filled { display: grid; gap: 2.5rem; }
@media (min-width: 960px) {
	.mh-quote__filled { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
	.mh-quote__list-wrap[hidden] + .mh-quote__form { grid-column: 1 / -1; max-width: 640px; }
}
.mh-quote__filled[hidden], .mh-quote__empty[hidden] { display: none; }
.mh-quote__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--mh-line, #d9e3d2); }
.mh-quote-item {
	display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
	padding: 14px 0; border-bottom: 1px solid var(--mh-line, #d9e3d2);
}
.mh-quote-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--mh-tint, #f1f7ea); }
.mh-quote-item__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mh-quote-item__name { font-weight: 600; color: var(--mh-ink, #1c2a1e); text-decoration: none; overflow-wrap: anywhere; }
.mh-quote-item__name:hover { text-decoration: underline; }
.mh-quote-item__meta { font-size: 0.875rem; color: var(--mh-muted, #55655a); }
.mh-quote-item .mh-qty { grid-column: 3; grid-row: 1; }
.mh-quote-item .mh-qty__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mh-quote-item__remove { grid-column: 2 / -1; justify-self: start; font-size: 0.875rem; }
@media (max-width: 520px) {
	.mh-quote-item { grid-template-columns: 64px minmax(0, 1fr) auto; }
	.mh-quote-item img { width: 64px; height: 64px; }
	.mh-quote-item__info { grid-column: 2 / -1; }
	.mh-quote-item .mh-qty { grid-column: 2; grid-row: 2; justify-self: start; }
	.mh-quote-item__remove { grid-column: 3; grid-row: 2; justify-self: end; align-self: center; }
}
.mh-quote.is-sent .mh-quote__form > h2, .mh-quote.is-sent .mh-quote__form > p { display: none; }
.mh-quote__more { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 1rem; font-size: 0.9375rem; }

/* Formularios. */
.mh-form__grid { display: grid; gap: 16px; }
@media (min-width: 600px) {
	.mh-form__grid { grid-template-columns: 1fr 1fr; }
	.mh-field--wide { grid-column: 1 / -1; }
}
.mh-field label { display: block; margin-bottom: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--mh-ink, #1c2a1e); }
.mh-field__optional { font-weight: 400; color: var(--mh-muted, #55655a); }
.mh-field input:not([type="checkbox"]), .mh-field select, .mh-field textarea {
	display: block; width: 100%; min-height: 48px; padding: 0.6em 0.8em;
	border: 1.5px solid var(--mh-line-strong, #a9b9a2); border-radius: 6px; background: #fff;
	font: inherit; font-size: 1rem; color: var(--mh-ink, #1c2a1e);
}
.mh-field textarea { min-height: 120px; resize: vertical; }
.mh-field input:focus-visible, .mh-field select:focus-visible, .mh-field textarea:focus-visible, .mh-qty__input:focus-visible {
	outline: 3px solid var(--mh-lime, #8dc63f); outline-offset: 1px; border-color: var(--mh-green, #2f7d1e);
}
.mh-field.has-error input, .mh-field.has-error select, .mh-field.has-error textarea { border-color: #b3261e; }
.mh-field__error { margin: 6px 0 0; font-size: 0.875rem; font-weight: 600; color: #b3261e; }
.mh-field__help { margin: 6px 0 0; font-size: 0.875rem; color: var(--mh-muted, #55655a); }
.mh-field--check { margin-top: 20px; }
.mh-field--check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.mh-field--check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--mh-green, #2f7d1e); }
.mh-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mh-form__actions { margin-top: 20px; }
.mh-form__status { margin: 16px 0 0; padding: 12px 14px; border-left: 4px solid #b3261e; background: #fdeceb; color: #7a1a15; font-weight: 600; }
.mh-form-done { padding: 1.5rem; border-left: 4px solid var(--mh-green, #2f7d1e); background: var(--mh-tint, #f1f7ea); border-radius: 0 8px 8px 0; }
.mh-form-done:focus { outline: none; }
.mh-form-done__title { margin-top: 0; }
[hidden] { display: none !important; }

/* Datos de la tienda. */
.mh-store { display: grid; gap: 24px; margin: 1.5rem 0; }
@media (min-width: 860px) {
	.mh-store:has(.mh-store__map) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
}
.mh-store__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.mh-store__list li { display: flex; gap: 12px; align-items: flex-start; }
.mh-store__list .mh-icon { color: var(--mh-green, #2f7d1e); margin-top: 2px; }
.mh-store__map iframe { display: block; width: 100%; height: 340px; border: 0; border-radius: 8px; background: var(--mh-tint, #f1f7ea); }

/* Aviso al agregar un producto. */
.mh-toast {
	position: fixed; left: 50%; bottom: 20px; z-index: 1000;
	width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px;
	background: var(--mh-green-deep, #143a0e); color: #fff; border-radius: 8px;
	font-size: 0.9375rem; box-shadow: 0 6px 24px rgba(20, 58, 14, 0.28);
	transform: translate(-50%, 140%); opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease; pointer-events: none;
}
.mh-toast.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.mh-toast a { color: var(--mh-label, #ffd23f); font-weight: 600; }

/* WhatsApp flotante. */
.mh-wa-float {
	position: fixed; right: 16px; bottom: 16px; z-index: 900;
	display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px;
	background: #25d366; color: #06301a; border-radius: 26px;
	font-weight: 700; text-decoration: none; box-shadow: 0 4px 16px rgba(6, 48, 26, 0.3);
}
.mh-wa-float:hover, .mh-wa-float:focus-visible { background: #1fb957; color: #06301a; }
@media (max-width: 600px) {
	.mh-wa-float { padding: 0; width: 56px; height: 56px; justify-content: center; border-radius: 50%; }
	.mh-wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.mh-toast { bottom: 84px; }
}

/* Aviso de cookies. */
.mh-cookies {
	position: fixed; left: 16px; bottom: 16px; z-index: 950;
	display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
	max-width: min(560px, calc(100vw - 32px)); padding: 16px 18px;
	background: #fff; color: var(--mh-ink, #1c2a1e); border: 1px solid var(--mh-line, #d9e3d2); border-radius: 8px;
	box-shadow: 0 8px 30px rgba(20, 58, 14, 0.18); font-size: 0.9375rem;
}
.mh-cookies p { margin: 0; flex: 1 1 260px; }
.mh-cookies__actions { display: flex; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
	.mh-toast { transition: none; }
}
