/* =========================================================================
   Layer 6 / 6, mobile fixes. Enqueued LAST. The only layer allowed to use
   !important, and every use is justified next to it.
   ====================================================================== */

/* 1. Grid/flex children may shrink below their content (long names, e-mail
      addresses), otherwise a 360px screen scrolls sideways. */
.hv-head__in > *, .hv-pdp > *, .hv-buy > *, .hv-shop > *, .hv-flow > *, .hv-foot__grid > *, .hv-svc > *, .hv-split > *, .hv-story > * { min-width: 0; }
.hv-foot a, .hv-foot__body, .hv-card__title, .hv-cdetail span, .hv-prose, .hv-citem__meta { overflow-wrap: anywhere; }
h1, h2, h3, h4 { overflow-wrap: break-word; }
.hv-prose table, .hvl-woo table { max-width: 100%; }
.hv-prose iframe, .hv-rich iframe { max-width: 100%; }

/* 2. Product page: the sticky gallery offset follows the measured header. */
@media (min-width: 900px) {
	.hv-gal { top: calc(var(--hvl-hdr-real, var(--hv-head-h)) + 20px); }
}

/* 3. Mobile product bar: only on the product page, never covering the drawer. */
@media (max-width: 899px) {
	body:not(.single-product) .hv-mobar { display: none; }
	.hv-drawer.is-open ~ .hv-mobar, body.hvl-side-cart-locked .hv-mobar { display: none; }
	.hvl-buy { flex-wrap: nowrap; }
	/* The WhatsApp float (third-party plugin, bottom 20px) sits on top of the buy bar. */
	body.single-product .whatsapp-float-button { bottom: 92px; }
}

/* 4. Shop: on mobile the rail is a toggled panel above the grid. */
@media (max-width: 899px) {
	.hv-rail[data-hvl-rail] { display: none; }
	.hv-rail[data-hvl-rail].is-open { display: flex; }
	.hvl-sort-form { margin-left: 0; }
	.hv-shoptools .hv-searchbox { flex-basis: 100%; max-width: none; }
}

/* 5. Cart on phones: each row is a small grid (WooCommerce's smallscreen CSS
      turns the table into blocks; these rules give it the concept look). */
@media (max-width: 768px) {
	.hvl-woo .woocommerce table.shop_table_responsive tr td { display: block; text-align: right; }
	.hvl-woo .woocommerce table.cart tr.cart_item { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-top: 1px solid var(--hv-line); }
	.hvl-woo .woocommerce table.cart tr.cart_item td { border: 0; padding: 4px 12px; text-align: left; }
	.hvl-woo .woocommerce table.cart tr.cart_item td::before { display: none; }
	.hvl-woo .woocommerce table.cart tr.cart_item td.product-thumbnail { display: block !important; /* WC smallscreen hides it */ grid-row: 1 / span 4; padding-right: 0; }
	.hvl-woo .woocommerce table.cart tr.cart_item td.product-remove { grid-column: 2; text-align: right; padding-bottom: 0; }
	.hvl-woo .woocommerce table.cart tr.cart_item td.product-price { display: none; }
	.hvl-woo .woocommerce table.cart td.product-thumbnail img { width: 76px; min-width: 76px; max-width: 76px; }
	.hvl-woo .woocommerce table.cart td.actions { text-align: left; }
	.hvl-woo .woocommerce table.cart td.actions .coupon { float: none; display: flex; margin-bottom: 10px; }
	.hvl-woo .woocommerce .woocommerce-billing-fields__field-wrapper, .hvl-woo .woocommerce .woocommerce-shipping-fields__field-wrapper { grid-template-columns: minmax(0, 1fr); }
	.hvl-woo .woocommerce .woocommerce-billing-fields__field-wrapper > .form-row-last, .hvl-woo .woocommerce .woocommerce-shipping-fields__field-wrapper > .form-row-last { grid-column: 1; }
}

/* 6. Footer: two columns on small phones, one below 430px. */
@media (max-width: 600px) { .hv-foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 430px) { .hv-foot__grid { grid-template-columns: minmax(0, 1fr); } }

/* 7. Search overlay on phones: full-width row, larger tap targets. */
@media (max-width: 599px) {
	.hvl-search .hv-btn { display: none; }
	.hvl-searchov__in { gap: 6px; }
}

/* 8. Every hover-only reveal is gated: touch never spends a tap on :hover. */
@media (hover: none), (pointer: coarse) {
	.hv-card:hover { transform: none; }
	.hv-card:hover .hv-card__media img { transform: none; }
	.hv-lbitem__cap { opacity: 1; }
}

/* 9. Product gallery never crops (2026-11-27). The frame follows the dominant
      photo orientation (gallery.php sets --wide 4:3 / --tall 3:4) and every
      photo is shown whole on the warm background; thumbnails too. */
.hv-gal__main { background-color: var(--hv-bg-deep); }
.hv-gal__main img { object-fit: contain; }
.hv-gal__thumbs button { background-size: contain; background-color: var(--hv-bg-deep); }
.hv-gal--tall .hv-gal__main { aspect-ratio: 3 / 4; }
.hv-gal--tall .hv-gal__thumbs button { width: 60px; height: 80px; }
