/* ========================================================================== 
   Pelier Market — mobile-first finishing layer
   Loaded after the shared, home, shop and cart styles.
   ========================================================================== */

@media (max-width: 767px) {
	:root {
		--container-pad: 16px;
		--pm-announce-h: 34px;
		--pm-header-h: 62px;
	}

	html {
		scroll-padding-top: calc(var(--pm-header-h) + var(--pm-adminbar-h) + 12px);
	}
	body {
		font-size: 14.5px;
		line-height: 22px;
		overflow-wrap: break-word;
	}
	.pm-container {
		padding-left: max(var(--container-pad), env(safe-area-inset-left));
		padding-right: max(var(--container-pad), env(safe-area-inset-right));
	}
	.pm-section { padding: 44px 0; }
	.pm-section--tight { padding: 32px 0; }
	h1 { font-size: 30px; }
	h2 { font-size: 25px; }
	.pm-btn {
		min-height: 48px;
		padding: 14px 18px;
		white-space: normal;
	}
	.pm-input,
	.pm-select,
	.pm-textarea { font-size: 16px; }
	.pm-slider__track { scroll-padding-inline: var(--container-pad); }
	.pm-slider__slide { scroll-snap-stop: always; }

	/* Compact, thumb-friendly header. */
	.pm-header { box-shadow: 0 1px 0 color-mix(in srgb, var(--pm-ink) 8%, transparent); }
	.pm-announce__inner { min-height: var(--pm-announce-h); }
	.pm-announce__text {
		padding: 7px 0;
		font-size: 10.5px;
		line-height: 20px;
		letter-spacing: .075em;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.pm-logo-area__inner {
		height: var(--pm-header-h);
		grid-template-columns: minmax(92px, 1fr) auto minmax(48px, 1fr);
		gap: 4px;
	}
	.pm-logo-area__left { margin-left: -8px; }
	.pm-logo-area__right { margin-right: -8px; }
	.pm-hbtn,
	.pm-hlink { min-width: 46px; min-height: 46px; }
	.pm-burger { margin-left: 0; }
	.pm-site-logo {
		max-width: 46vw;
		font-size: clamp(17px, 5.5vw, 22px);
		letter-spacing: .055em;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.pm-site-logo__link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
	.pm-site-logo .custom-logo { max-width: 42vw; max-height: 42px; }
	.pm-cart-link .pm-cart-count { top: -4px; right: -7px; }

	/* Search becomes a calm, useful mobile sheet. */
	.pm-search-panel {
		max-height: calc(100dvh - var(--pm-header-h) - var(--pm-adminbar-h));
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.pm-search-panel__inner {
		padding-top: 58px;
		padding-bottom: calc(24px + env(safe-area-inset-bottom));
	}
	.pm-search-panel__form { border-radius: 0; }
	.pm-search-panel__input { height: 52px; padding-left: 16px; padding-right: 54px; }
	.pm-search-panel__close { width: 44px; height: 44px; top: 6px; right: 6px; }
	.pm-search-panel__popular {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 8px;
		margin-left: calc(-1 * var(--container-pad));
		margin-right: calc(-1 * var(--container-pad));
		padding: 2px var(--container-pad) 6px;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.pm-search-panel__popular::-webkit-scrollbar { display: none; }
	.pm-search-panel__popular-label { align-self: center; flex: 0 0 auto; }
	.pm-search-panel__chip { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 18px; }

	/* Full-height menu, including safe areas on modern phones. */
	.pm-menu-drawer {
		height: calc(100dvh - var(--pm-adminbar-h, 0px));
		width: min(420px, 100vw);
	}
	.pm-menu-drawer__head {
		min-height: 58px;
		padding-left: max(18px, env(safe-area-inset-left));
		padding-right: max(6px, env(safe-area-inset-right));
	}
	.pm-menu-drawer__search { padding: 14px 16px 6px; }
	.pm-menu-drawer__body { padding: 0 16px; }
	.pm-menu-drawer__foot {
		padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
	}
	.pm-mnav__link { min-height: 54px; }
	.pm-mnav__toggle { width: 50px; height: 50px; }
	.pm-mnav__sublink { min-height: 42px; padding: 10px 0; }

	/* Home: immersive media with readable copy and swipe cues. */
	.pm-hero {
		height: min(132vw, 690px);
		min-height: 470px;
		max-height: calc(100svh - var(--pm-header-h));
	}
	.pm-hero__shade {
		background: linear-gradient(to bottom, color-mix(in srgb, var(--pm-ink) 8%, transparent) 20%, color-mix(in srgb, var(--pm-ink) 64%, transparent) 100%);
	}
	.pm-hero__content {
		bottom: 30px;
		width: calc(100% - 48px);
		max-width: 440px;
	}
	.pm-hero__title { font-size: clamp(31px, 9vw, 40px); line-height: 1.12; }
	.pm-hero__text { font-size: 15px; line-height: 1.45; }
	.pm-hero__arrow { top: 30%; background: color-mix(in srgb, var(--pm-white) 16%, transparent); border-radius: 50%; }
	.pm-gallery2__grid,
	.pm-tiles__track {
		scroll-padding-left: var(--container-pad);
		overscroll-behavior-inline: contain;
	}
	.pm-gallery2__grid > .pm-tile,
	.pm-tiles__slide { flex-basis: min(82vw, 360px); }
	.pm-tile__overlay { padding: 22px; }
	.pm-tile__title--lg { font-size: 28px; }
	.pm-tile--card .pm-tile__title { font-size: 21px; }
	.pm-marquee { height: 42px; margin: 16px 0; }
	.pm-marquee__text { font-size: 19px; }
	.pm-stl { margin-top: 28px; }
	.pm-stl__media { aspect-ratio: 4 / 5; }
	.pm-stl__content { padding: 24px 18px 0; }
	.pm-stl__title { font-size: 28px; line-height: 1.18; }
	.pm-stl__text { max-width: 31ch; font-size: 14.5px; line-height: 1.5; }
	.pm-stl__products { padding: 16px 16px 28px; }
	.pm-stl__card { grid-template-columns: 76px minmax(0, 1fr); column-gap: 14px; padding: 12px; }
	.pm-about { padding: 40px 0; }
	.pm-about__grid { gap: 18px; }
	.pm-about__title { font-size: 24px; line-height: 1.3; }
	.pm-collections { padding: 40px 0; }
	.pm-collections__head { position: relative; margin-bottom: 18px; }
	.pm-collections__title { max-width: calc(100% - 88px); font-size: 20px; line-height: 1.2; }
	.pm-collections__arrow { width: 40px; height: 40px; }
	.pm-collections__slide { width: calc((100vw - 2 * var(--container-pad) - 12px) / 2); }
	.pm-collection__name { margin-top: 8px; font-size: 13px; line-height: 19px; }
	.pm-testimonials { padding-bottom: 46px; }
	.pm-testimonial__quote { font-size: 20px; line-height: 1.4; }

	/* Catalog: controls remain visible, products stay legible at two columns. */
	.pm-shop,
	.pm-product-page,
	.pm-wishlist-page { padding-top: 14px; padding-bottom: 56px; }
	.pm-breadcrumb { font-size: 11px; }
	.pm-shop__head { margin-top: 16px; }
	.pm-shop__title,
	.pm-wishlist__title { font-size: 28px; line-height: 1.2; }
	.pm-shop__desc { font-size: 14px; line-height: 22px; }
	.pm-shop__toolbar {
		position: sticky;
		top: calc(var(--pm-header-h) + var(--pm-adminbar-h));
		z-index: 20;
		min-height: 54px;
		margin: 20px calc(-1 * var(--container-pad)) 22px;
		padding: 0 var(--container-pad);
		background: color-mix(in srgb, var(--pm-white) 97%, transparent);
		backdrop-filter: blur(10px);
	}
	.pm-filter-toggle { min-height: 44px; font-size: 11px; letter-spacing: .08em; }
	.pm-sort__select { width: 136px; height: 42px; padding-left: 10px; font-size: 12px; }
	.pm-grid,
	.pm-grid--related,
	.pm-shop__layout.is-filters-open .pm-grid,
	.pm-wishlist__loading { gap: 26px 10px; }
	.pm-card__body { padding-top: 10px; }
	.pm-card__title { min-height: 38px; margin-bottom: 2px; font-size: 13px; line-height: 19px; }
	.pm-card__meta,
	.pm-card__price { font-size: 11px; line-height: 17px; }
	.pm-card__wish { width: 40px; height: 40px; top: 4px; right: 4px; }
	.pm-card__badges { top: 6px; left: 6px; gap: 4px; }
	.pm-badge { padding: 4px 6px; font-size: 9px; }
	.pm-filters,
	.pm-shop__layout.is-filters-open .pm-filters {
		height: calc(100dvh - var(--pm-adminbar-h, 0px));
		width: min(420px, 100vw);
	}
	.pm-filters__head { height: 58px; padding: 0 16px; }
	.pm-filters__form { padding: 0 16px calc(18px + env(safe-area-inset-bottom)); }
	.pm-filter__title { min-height: 50px; padding: 14px 0; }
	.pm-filter__cat,
	.pm-check { min-height: 40px; }
	.pm-check__box { width: 22px; height: 22px; }
	.pm-filters__actions { padding-bottom: 2px; }

	/* Product detail: edge-to-edge gallery followed by an easy purchase form. */
	.pm-product { gap: 22px; }
	.pm-product__gallery { margin-left: calc(-1 * var(--container-pad)); margin-right: calc(-1 * var(--container-pad)); }
	.pm-gallery__main { aspect-ratio: 4 / 5; }
	.pm-gallery__thumbs { padding-inline: var(--container-pad); overflow-x: auto; grid-auto-flow: column; grid-auto-columns: 66px; grid-template-columns: none; }
	.pm-product__title { font-size: 27px; line-height: 1.2; margin-bottom: 12px; }
	.pm-product__price-note { padding: 13px 14px; font-size: 14px; }
	.pm-product__form { padding-top: 16px; }
	.pm-attr__select { max-width: none; }
	.pm-swatch { width: 42px; height: 42px; }
	.pm-swatch__dot { width: 32px; height: 32px; }
	.pm-size { min-width: 52px; height: 48px; }
	.pm-qty__btn { width: 48px; }
	.pm-qty__input { width: 50px; font-size: 16px; }
	.single_add_to_cart_button,
	.pm-product__wa { width: 100%; min-height: 52px; }
	.pm-accordion__title { min-height: 54px; padding-block: 14px; }
	.pm-related { margin-top: 48px; padding-top: 34px; }
	.pm-related__title { margin-bottom: 22px; }

	/* Cart drawer and checkout remain usable above mobile browser chrome. */
	.pm-drawer { height: calc(100dvh - var(--pm-adminbar-h, 0px)); }
	.pm-drawer__panel { width: 100%; }
	.pm-drawer__head { height: 60px; padding: 0 16px; }
	.pm-drawer__title { font-size: 22px; }
	.pm-drawer__scroll { padding-bottom: env(safe-area-inset-bottom); }
	.pm-drawer__foot { padding-bottom: env(safe-area-inset-bottom); background: var(--pm-white); }
	.pm-lines { padding: 0 16px; }
	.pm-line { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 16px 0; }
	.pm-line__thumb { width: 76px; height: 96px; }
	.pm-line__actions { align-items: flex-end; }
	.pm-cqty { height: 42px; }
	.pm-cqty__btn { width: 40px; }
	.pm-cqty__input { width: 42px; font-size: 16px; }
	.pm-min { padding-left: 16px; padding-right: 16px; }
	.pm-summary { padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); }
	.pm-cart-page { padding: 24px 0 56px; }
	.pm-cart-page__title { margin-bottom: 22px; font-size: 28px; }
	.pm-cart-grid { gap: 26px; }
	.pm-summary-card .pm-summary { padding: 20px 16px; }
	.pm-order-form__submit { min-height: 54px; }

	/* Footer and generic content: no cramped columns or clipped tables. */
	.pm-xpromos__item { padding: 16px 0; }
	.pm-xpromos__title { font-size: 17px; }
	.pm-xpromos__sub { font-size: 13px; line-height: 20px; }
	.pm-site-footer__cols {
		grid-template-columns: 1fr;
		gap: 0;
		padding-top: 28px;
		padding-bottom: 32px;
	}
	.pm-site-footer__col { padding: 18px 0; border-bottom: 1px solid color-mix(in srgb, var(--pm-cream) 14%, transparent); }
	.pm-site-footer__news { grid-column: auto; border-bottom: 0; padding-bottom: 0; }
	.pm-site-footer__title { margin-bottom: 12px; font-size: 17px; }
	.pm-site-footer__menu a { display: inline-flex; align-items: center; min-height: 38px; }
	.pm-site-footer__news-sub { margin-bottom: 18px; }
	.pm-site-footer__bottom {
		gap: 14px;
		padding-top: 26px;
		padding-bottom: calc(24px + env(safe-area-inset-bottom));
	}
	.pm-site-footer__contact { flex-direction: column; gap: 8px; }
	.pm-page-tpl { padding: 28px 0 50px; }
	.pm-page-tpl__title { font-size: 27px; }
	.pm-prose { font-size: 14.5px; line-height: 24px; }
	.pm-prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.pm-index__grid { gap: 24px 10px; }
}

@media (max-width: 420px) {
	.pm-logo-area__inner { grid-template-columns: 92px minmax(0, 1fr) 46px; }
	.pm-site-logo { max-width: 42vw; }
	.pm-hero { min-height: 440px; }
	.pm-hero__content { width: calc(100% - 36px); }
	.pm-shop__toolbar { gap: 8px; }
	.pm-filter-toggle { gap: 5px; }
	.pm-sort__select { width: 122px; }
	.pm-lines--page .pm-line {
		grid-template-columns: 72px minmax(0, 1fr);
		grid-template-areas: "thumb info" "qty qty" "pieces pieces";
		gap: 10px 14px;
	}
	.pm-lines--page .pm-line__thumb { width: 72px; height: 90px; }
	.pm-lines--page .pm-line__col--qty { justify-content: space-between; width: 100%; }
	.pm-lines--page .pm-line__col--pieces { align-items: flex-start; text-align: left; }
}

@media (max-width: 350px) {
	:root { --container-pad: 14px; }
	.pm-logo-area__inner { grid-template-columns: 88px minmax(0, 1fr) 44px; }
	.pm-hbtn,
	.pm-hlink { min-width: 44px; }
	.pm-site-logo { font-size: 16px; }
	.pm-sort__select { width: 112px; }
	.pm-filter-toggle span:not(.pm-filter-toggle__count) { max-width: 58px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 767px) and (orientation: landscape) and (max-height: 520px) {
	.pm-hero { height: calc(100svh - var(--pm-header-h)); min-height: 360px; }
	.pm-hero__content { bottom: 22px; }
	.pm-hero__text { display: none; }
	.pm-menu-drawer__foot { padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.pm-shop__toolbar { backdrop-filter: none; }
}
