/*
 * FLOW responsive layer.
 *
 * The source theme predates the current FLOW page templates, so these rules
 * establish one fluid layout contract for informational pages, WooCommerce
 * archives, product pages, checkout, and the footer. Breakpoints follow the
 * Alexander reference project: laptop 1440, tablet 1024, mobile 768, small
 * mobile 481.
 */

html {
	overflow-x: hidden;
}

body,
.site-header,
.site-footer,
.site-main,
.container,
.row,
[class*="col-"] {
	min-width: 0;
}

.container {
	width: 100%;
}

.site-header .container,
.site-footer .container {
	max-width: 1720px;
}

/* Desktop dropdown: the dark header state must not make white-on-white links. */
.site-header .submenu-block {
	background: #fff;
	color: #111;
	border: 1px solid #eee;
	box-shadow: 0 14px 30px rgba(17, 17, 17, 0.12);
}

.site-header .submenu-block li a,
.site-header.scrolled .site-header__bottom .submenu-block li a {
	color: #111 !important;
}

.site-header .submenu-block li a {
	min-height: 44px;
	display: flex;
	align-items: center;
}

/* Price ranges remain one readable unit at every catalog width. */
.product-card__price,
.product-card__price .woocommerce-Price-amount,
.product-card__price .price,
.flow-home-product-card__price {
	flex-wrap: nowrap;
	white-space: nowrap;
}

.flow-mobile-filter-toggle {
	display: none;
}

@media (min-width: 992px) {
	#favorites-grid ul.products.fs-products-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (max-width: 1199.98px) {
	.site-header__bottom .row {
		margin-left: 0;
		margin-right: 0;
	}

	.site-header__bottom .col-lg-12 {
		padding-left: 0;
		padding-right: 0;
	}

	.site-header .mobile-menu {
		box-sizing: border-box;
		width: 100vw;
		max-width: 100vw;
		padding: 72px 20px 32px;
	}

	.site-header .mobile-menu .menu-item > a {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		max-width: calc(100% - 46px);
	}

	/* The current FLOW mobile template uses .submenu-block. */
	.site-header .mobile-menu .submenu-block {
		position: static;
		min-width: 0;
		margin-top: 10px;
		padding: 0 0 0 15px;
		box-shadow: none;
		border: 0;
		top: auto;
		left: auto;
		transform: none;
		opacity: 1;
		visibility: visible;
		display: none;
	}

	.site-header .mobile-menu .menu-item.open .submenu-block {
		display: block;
	}

	.site-header .mobile-menu .submenu-block ul {
		padding: 0;
	}

	.site-header .mobile-menu .submenu-block li a {
		font-size: 16px;
		font-weight: 400;
		padding: 8px 0;
		min-height: 40px;
	}
}

@media (max-width: 767.98px) {
	.container {
		padding-left: 16px;
		padding-right: 16px;
	}

	.row > [class*="col-"] {
		min-width: 0;
	}

	/* Informational pages and stores. */
	.section[style*="padding-top"],
	.catalog-archive-section,
	.product-hero {
		padding-top: 88px !important;
		padding-bottom: 32px !important;
	}

	.header-page-block,
	.header-page-block.header-page-block__archive-woo {
		display: block;
		padding: 16px 0 24px;
	}

	.header-page-block h1,
	.catalog-archive-section .catalog-header h1 {
		font-size: clamp(34px, 10vw, 48px);
		line-height: 1.04;
		margin-bottom: 0;
		overflow-wrap: anywhere;
	}

	.info-page-block,
	.page-content-block,
	.flow-filter-wrapper,
	.catalog-sidebar-cooperation__content,
	.attrib-block,
	.advantages-blocks,
	.checkout-block,
	.order-review-card {
		max-width: 100%;
		min-width: 0;
	}

	.page-content-block,
	.info-page-block {
		padding: 18px;
	}

	.store-card {
		min-width: 0;
	}

	.store-wysiwyg-content,
	.store-wysiwyg-content * {
		max-width: 100%;
		overflow-wrap: anywhere;
	}

	.store-logo-wrapper {
		height: 72px;
	}

	.store-logo {
		max-width: 100%;
		height: 56px;
	}

	/* Catalog heading, result count, and ordering become one vertical rhythm. */
	.catalog-archive-section .catalog-header {
		display: block;
		width: 100%;
		margin-top: 16px;
	}

	.catalog-archive-section .catalog-header .fh-catalog-toolbar {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		align-items: stretch;
		gap: 12px;
		width: 100%;
	}

	.catalog-archive-section .catalog-header .fh-catalog-toolbar > *,
	.catalog-archive-section .custom-select-wrapper,
	.catalog-archive-section .woocommerce-ordering,
	.catalog-archive-section .custom-select-trigger {
		box-sizing: border-box;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
	}

	.catalog-archive-section .custom-select-trigger {
		min-height: 44px;
	}

	.catalog-archive-section .custom-options {
		max-width: 100%;
		white-space: normal;
	}

	.catalog-archive-section .col-lg-3,
	.catalog-archive-section .col-lg-9 {
		width: 100%;
	}

	.catalog-archive-section .flow-filter-wrapper {
		padding: 20px !important;
	}

	/* Filters stay available on mobile without pushing the product grid below the fold. */
	.catalog-archive-section .catalog-sidebar {
		min-width: 0;
	}

	.catalog-archive-section .flow-mobile-filter-toggle {
		align-items: center;
		background: #fff;
		border: 1px solid #d8d8d8;
		border-radius: 8px;
		color: #151515;
		display: flex;
		font: inherit;
		font-size: 14px;
		justify-content: space-between;
		min-height: 48px;
		padding: 12px 16px;
		text-align: left;
		width: 100%;
	}

	.catalog-archive-section .flow-mobile-filter-toggle::after {
		content: '+';
		font-size: 22px;
		font-weight: 300;
		line-height: 1;
	}

	.catalog-archive-section .flow-mobile-filter-toggle[aria-expanded='true']::after {
		content: '−';
	}

	.catalog-archive-section .flow-filter-wrapper {
		display: none !important;
	}

	.catalog-archive-section .flow-filter-wrapper.is-open {
		display: block !important;
	}

	.catalog-archive-section .col-lg-9 {
		padding-top: 24px;
	}

	.catalog-archive-section ul.products.fs-products-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 28px 12px;
		width: 100%;
	}

	.catalog-archive-section ul.products.fs-products-grid > li,
	.catalog-archive-section ul.products.fs-products-grid .product-card,
	.catalog-archive-section ul.products.fs-products-grid .product-card__content {
		min-width: 0;
		max-width: 100%;
	}

	.catalog-archive-section .product-card__title,
	.catalog-archive-section .product-card__meta-specs {
		overflow-wrap: anywhere;
	}

	.catalog-archive-section .product-card__title {
		font-size: 15px;
		line-height: 1.25;
	}

	.catalog-archive-section .product-card .favorite-btn,
	.catalog-archive-section .product-card .btn-more {
		min-width: 40px;
		min-height: 40px;
	}

	/* Product page: the gallery and its thumbnail rail stay inside the column. */
	.product-hero .row > [class*="col-"] {
		width: 100%;
		min-width: 0;
	}

	.custom-product-gallery,
	.gallery-main-area,
	.gallery-thumbs-area,
	.gallery-thumbs-area .thumbs-swiper,
	.product-hero__info,
	.product-hero__short-description,
	.modern-tab-content {
		min-width: 0;
		max-width: 100%;
	}

	.custom-product-gallery,
	.gallery-thumbs-area,
	.gallery-thumbs-area .thumbs-swiper,
	.gallery-thumbs-area .swiper-wrapper {
		overflow: hidden;
	}

	.gallery-thumbs-area .swiper-slide {
		flex: 0 0 72px;
		width: 72px !important;
		max-width: 72px;
		height: 72px !important;
	}

	.gallery-thumbs-area .thumb-image-wrapper,
	.gallery-thumbs-area .thumb-image-wrapper img {
		width: 100%;
		height: 100%;
	}

	.product-hero__info {
		padding-top: 24px;
	}

	.product-hero__title,
	.product-hero__sub-title,
	.product-hero__short-description,
	.product-description-formatted,
	.product-hero__attributes-table,
	.product-hero__attributes-table td {
		max-width: 100%;
		overflow-wrap: anywhere;
	}

	.product-hero__title {
		font-size: clamp(30px, 9vw, 44px) !important;
		line-height: 1.06;
	}

	.attrib-block,
	.advantages-blocks {
		padding: 18px;
	}

	.attrib-block .product-hero__attributes-table .attrib-label {
		width: 42%;
		padding-right: 10px;
	}

	.attrib-block .product-hero__attributes-table td {
		vertical-align: top;
	}

	.advantages-blocks .advantages-blocks__content {
		gap: 12px;
		align-items: flex-start;
	}

	.modern-tabs-wrapper {
		justify-content: flex-start;
		max-width: 100%;
		overflow: hidden;
	}

	.modern-tabs {
		width: max-content;
		max-width: 100%;
		gap: 14px;
		overflow-x: auto;
		justify-content: flex-start;
		scrollbar-width: none;
	}

	.modern-tabs::-webkit-scrollbar {
		display: none;
	}

	.tab-btn {
		min-height: 48px;
		white-space: nowrap;
		font-size: 14px;
	}

	/* Checkout and cart surfaces. */
	.custom-checkout-grid {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 16px !important;
	}

	.order-review-card {
		position: static !important;
		top: auto !important;
		padding: 18px !important;
	}

	.checkout-block {
		padding: 18px !important;
	}

	.checkout-cart-item,
	.summary-row,
	.order-review-header {
		min-width: 0;
	}

	.checkout-cart-item {
		gap: 12px !important;
	}

	.cart-item-details,
	.cart-item-title,
	.summary-row span {
		min-width: 0;
		overflow-wrap: anywhere;
	}

	/* The reference footer becomes a readable two-column rhythm on small screens. */
	.site-footer .row {
		row-gap: 28px;
	}

	.site-footer .footer-copyright {
		align-items: flex-start;
		flex-direction: column;
		gap: 14px;
		line-height: 1.5;
	}

	.site-footer .footer-copyright--links {
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.site-footer .footer-copyright--links a {
		margin-right: 0 !important;
	}

	/* The mobile feature image keeps its source ratio instead of leaving a blank frame. */
	.flow-home-feature__image,
	.flow-home-feature__inner--reverse .flow-home-feature__image {
		height: auto;
		min-height: 0;
	}

	.flow-home-feature__image img {
		height: auto;
		min-height: 0;
		object-fit: cover;
	}

	/* Contacts use compact cards with a calmer text rhythm on narrow screens. */
	.flow-contacts-page {
		padding-bottom: 48px;
		padding-top: 72px;
	}

	.flow-contacts-breadcrumbs {
		padding-top: 16px;
	}

	.flow-contacts-heading {
		display: block;
		padding: 48px 0 32px;
	}

	.flow-contacts-heading h1 {
		font-size: clamp(42px, 12vw, 56px);
		line-height: 1;
	}

	.flow-contacts-heading > p {
		margin-top: 16px;
		padding-bottom: 0;
	}

	.flow-contacts-overview {
		display: block;
	}

	.flow-contacts-card {
		min-height: 0;
		padding: 20px;
	}

	.flow-contacts-card__eyebrow {
		margin-bottom: 24px;
	}

	.flow-contacts-card h2 {
		font-size: clamp(30px, 9vw, 38px);
		line-height: 1.08;
	}

	.flow-contacts-list {
		margin-top: 32px;
	}

	.flow-contacts-list div {
		display: block;
	}

	.flow-contacts-list div + div {
		margin-top: 20px;
	}

	.flow-contacts-list dt {
		margin-bottom: 6px;
	}

	.flow-contacts-list dd {
		line-height: 1.5;
	}

	.flow-contacts-card--address address {
		line-height: 1.18;
		margin-top: 12px;
	}

	.flow-contacts-map {
		margin-top: 24px;
	}
}

@media (max-width: 480.98px) {
	.container {
		padding-left: 12px;
		padding-right: 12px;
	}

	.site-header .mobile-menu {
		padding-left: 16px;
		padding-right: 16px;
	}

	.catalog-archive-section ul.products.fs-products-grid {
		gap: 32px 0;
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.catalog-archive-section .flow-filter-wrapper {
		padding: 16px !important;
	}

	.catalog-archive-section .col-lg-9 {
		padding-top: 20px;
	}

	.product-card__price,
	.product-card__price .woocommerce-Price-amount,
	.product-card__price .price,
	.flow-home-product-card__price {
		flex-wrap: nowrap !important;
		white-space: nowrap !important;
	}

	.flow-contacts-card {
		padding: 16px;
	}

	.flow-contacts-card__eyebrow {
		margin-bottom: 20px;
	}

	.flow-contacts-list {
		margin-top: 28px;
	}

	.attrib-block,
	.advantages-blocks,
	.page-content-block,
	.info-page-block {
		padding: 16px;
	}

	.gallery-thumbs-area .swiper-slide {
		flex-basis: 64px;
		width: 64px !important;
		max-width: 64px;
		height: 64px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header *,
	.flow-home-draft *,
	.site-footer *,
	.custom-product-gallery *,
	.modern-tabs * {
		animation: none !important;
		transition: none !important;
	}

	html {
		scroll-behavior: auto !important;
	}
}
