﻿/**
 * Channel catalog grid layout (permanent + rent).
 * Shared contract for .agora-channel-catalog-row and full-grid channel pages.
 * Loaded via inc/catalog-mode/bootstrap.php on channel catalog pages only.
 */
body.agora-channel-rent #content .row-main,
body.agora-channel-rent #content .row-main > .col,
body.agora-channel-rent #content .row-main > .col > .col-inner,
body.agora-channel-permanent #content .row-main,
body.agora-channel-permanent #content .row-main > .col,
body.agora-channel-permanent #content .row-main > .col > .col-inner {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.agora-catalog-full-grid .category-page-row,
body.agora-channel-rent .category-page-row,
body.agora-channel-permanent.agora-catalog-grid-mode .category-page-row {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

body.agora-catalog-full-grid .category-page-row .products.row,
body.agora-channel-rent .category-page-row .products.row,
body.agora-catalog-full-grid .agora-shop-grid .woocommerce .products.row,
body.agora-channel-rent .agora-shop-grid .woocommerce .products.row,
body.agora-catalog-full-grid .category-page-row .row.agora-shop-grid .woocommerce .products.row,
body.agora-channel-rent .category-page-row .row.agora-shop-grid .woocommerce .products.row {
	display: grid !important;
	grid-template-columns: repeat(var(--agora-shop-desktop-cols, 5), minmax(0, 1fr)) !important;
	width: 100% !important;
	gap: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
	flex-wrap: unset !important;
	flex: unset !important;
}

/* Flatsome shortcode adds large-columns-* flex widths â€” disable on channel catalog grids */
body.agora-catalog-full-grid .category-page-row .products.row[class*="large-columns"] > .product-small.col,
body.agora-channel-rent .category-page-row .products.row[class*="large-columns"] > .product-small.col,
body.agora-catalog-full-grid .agora-shop-grid .products.row[class*="large-columns"] > .product-small.col,
body.agora-channel-rent .agora-shop-grid .products.row[class*="large-columns"] > .product-small.col {
	flex: none !important;
	max-width: none !important;
	width: 100% !important;
}

@media screen and (max-width: 849px) {
	body.agora-catalog-full-grid .category-page-row .products.row,
	body.agora-channel-rent .category-page-row .products.row,
	body.agora-catalog-full-grid .agora-shop-grid .woocommerce .products.row,
	body.agora-channel-rent .agora-shop-grid .woocommerce .products.row,
	body.agora-catalog-full-grid .category-page-row .row.agora-shop-grid .woocommerce .products.row,
	body.agora-channel-rent .category-page-row .row.agora-shop-grid .woocommerce .products.row {
		grid-template-columns: repeat(var(--agora-shop-mobile-cols, 2), minmax(0, 1fr)) !important;
	}
}

body.agora-catalog-full-grid .category-page-row .products.row > .product-small.col,
body.agora-channel-rent .category-page-row .products.row > .product-small.col,
body.agora-catalog-full-grid .agora-shop-grid .products.row > .product-small.col,
body.agora-channel-rent .agora-shop-grid .products.row > .product-small.col {
	padding: 0 !important;
	margin: 0 !important;
	float: none !important;
	width: 100% !important;
	max-width: none !important;
}

/* Channel pages: match native /shop/ shop-container grid (UX block may omit wrapper). */
body.agora-catalog-full-grid .shop-container .products.row,
body.agora-channel-rent .shop-container .products.row,
body.agora-channel-permanent.agora-catalog-grid-mode .shop-container .products.row,
body.agora-channel-permanent.agora-permanent-editorial-disabled .agora-channel-catalog-row .agora-shop-grid .woocommerce .products.row,
body.agora-catalog-grid-mode .agora-channel-catalog-row .agora-shop-grid .woocommerce .products.row,
body.agora-catalog-grid-mode .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid,
body.agora-channel-permanent.agora-permanent-editorial-disabled .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid {
	display: grid !important;
	grid-template-columns: repeat(var(--agora-shop-desktop-cols, 5), minmax(0, 1fr)) !important;
	width: 100% !important;
	max-width: none !important;
	gap: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	flex-wrap: unset !important;
}

/* Permanent channel catalog: square thumbs after filter/sort handoff. */
body.agora-catalog-grid-mode.agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .box-image,
body[data-agora-catalog-grid-active="1"].agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .box-image {
	aspect-ratio: 1 / 1 !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	position: relative !important;
	overflow: hidden !important;
}

body.agora-catalog-grid-mode.agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .box-image .image-none,
body.agora-catalog-grid-mode.agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .box-image .image-fade-out,
body[data-agora-catalog-grid-active="1"].agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .box-image .image-none,
body[data-agora-catalog-grid-active="1"].agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .box-image .image-fade-out {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
}

body.agora-catalog-grid-mode.agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .agora-card-media,
body[data-agora-catalog-grid-active="1"].agora-channel-permanent .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid > .product-small.col .agora-card-media {
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
}

body.agora-catalog-full-grid #content.content-area.page-wrapper,
body.agora-channel-rent #content.content-area.page-wrapper,
body.agora-channel-permanent #content.content-area.page-wrapper {
	width: 100% !important;
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Flatsome columns-N flex widths on shortcode grids â€” neutralize on channel catalogs. */
body.agora-catalog-full-grid .woocommerce[class*="columns-"] .products.row > .product-small.col,
body.agora-channel-rent .woocommerce[class*="columns-"] .products.row > .product-small.col,
body.agora-channel-permanent.agora-catalog-grid-mode .woocommerce[class*="columns-"] .products.row > .product-small.col {
	flex: none !important;
	max-width: none !important;
	width: 100% !important;
}

@media screen and (max-width: 849px) {
	body.agora-catalog-full-grid .shop-container .products.row,
	body.agora-channel-rent .shop-container .products.row,
	body.agora-channel-permanent.agora-catalog-grid-mode .shop-container .products.row,
	body.agora-channel-permanent.agora-permanent-editorial-disabled .agora-channel-catalog-row .agora-shop-grid .woocommerce .products.row,
	body.agora-catalog-grid-mode .agora-channel-catalog-row .agora-shop-grid .woocommerce .products.row,
	body.agora-catalog-grid-mode .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid,
	body[data-agora-catalog-grid-active="1"] .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid {
		grid-template-columns: repeat(var(--agora-shop-mobile-cols, 2), minmax(0, 1fr)) !important;
	}
}

/* Channel catalogs: drop empty hero gap once toolbar controls are portaled out of .shop-page-title */
body.agora-shop-mobile-toolbar-active.agora-channel-rent .shop-page-title.page-title[data-agora-toolbar-portaled="1"],
body.agora-shop-mobile-toolbar-active.agora-channel-permanent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] {
	margin-bottom: 0 !important;
}

body.agora-shop-mobile-toolbar-active.agora-channel-rent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .page-title-inner,
body.agora-shop-mobile-toolbar-active.agora-channel-permanent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .page-title-inner {
	min-height: 0 !important;
	padding-top: 0.35rem !important;
	padding-bottom: 0.35rem !important;
}

body.agora-shop-mobile-toolbar-active.agora-channel-rent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .category-filter-row > .filter-button,
body.agora-shop-mobile-toolbar-active.agora-channel-permanent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .category-filter-row > .filter-button,
body.agora-shop-mobile-toolbar-active.agora-channel-rent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .category-filter-row > .agora-header-filters-clear,
body.agora-shop-mobile-toolbar-active.agora-channel-permanent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .category-filter-row > .agora-header-filters-clear,
body.agora-shop-mobile-toolbar-active.agora-channel-rent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .form-flat,
body.agora-shop-mobile-toolbar-active.agora-channel-permanent .shop-page-title.page-title[data-agora-toolbar-portaled="1"] .form-flat {
	display: none !important;
}

/* Channel catalogs: no large page title â€” breadcrumb + active filter chips only */
body.agora-channel-rent .shop-page-title .page-title.uppercase,
body.agora-channel-permanent .shop-page-title .page-title.uppercase,
body.agora-channel-rent .shop-page-title h1.page-title,
body.agora-channel-permanent .shop-page-title h1.page-title {
	display: none !important;
}

body.agora-channel-rent #content .row-main > .col > .col-inner,
body.agora-channel-permanent #content .row-main > .col > .col-inner {
	padding-top: 0 !important;
	min-height: 0 !important;
}

body.agora-shop-mobile-toolbar-active.agora-channel-rent #main.dark-page-wrapper,
body.agora-shop-mobile-toolbar-active.agora-channel-permanent #main.dark-page-wrapper {
	padding-top: 0 !important;
	min-height: 0 !important;
}

body.agora-channel-rent .shop-page-title .woocommerce-result-count,
body.agora-channel-permanent .shop-page-title .woocommerce-result-count {
	display: none !important;
}

body.agora-channel-rent .shop-container > .woocommerce-notices-wrapper:empty,
body.agora-channel-permanent .shop-container > .woocommerce-notices-wrapper:empty,
body.agora-channel-rent .shop-container > .woocommerce > .woof_products_top_panel_content:empty,
body.agora-channel-permanent .shop-container > .woocommerce > .woof_products_top_panel_content:empty,
body.agora-channel-rent .shop-container > .woocommerce > .woof_products_top_panel:empty,
body.agora-channel-permanent .shop-container > .woocommerce > .woof_products_top_panel:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
}

/* Permanent collection (editorial on): hide canonical catalog until filters/grid activate it. */
body.agora-channel-permanent.agora-catalog-editorial-mode:not(.agora-permanent-editorial-disabled) .agora-channel-catalog-row {
	display: none !important;
}

body.agora-channel-permanent.agora-catalog-editorial-mode:has(.agora-editorial-suppressed-for-grid) .agora-channel-catalog-row,
body[data-agora-catalog-grid-active="1"] .agora-channel-catalog-row,
body.agora-channel-permanent.agora-catalog-grid-mode .agora-channel-catalog-row {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: stretch !important;
	visibility: visible !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 1px !important;
}

body[data-agora-catalog-grid-active="1"] .agora-channel-catalog-row > .col,
body.agora-channel-permanent.agora-catalog-grid-mode .agora-channel-catalog-row > .col {
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 1px !important;
}

body.agora-channel-permanent.agora-catalog-grid-mode .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid,
body[data-agora-catalog-grid-active="1"] .agora-channel-catalog-row .products.row.agora-channel-catalog-products-grid {
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	min-height: 1px !important;
}

body[data-agora-catalog-grid-active="1"] #content.content-area.page-wrapper,
body[data-agora-catalog-grid-active="1"] #content .row-main,
body[data-agora-catalog-grid-active="1"] #content .row-main > .col,
body[data-agora-catalog-grid-active="1"] #content .row-main > .col > .col-inner,
body.agora-channel-permanent.agora-catalog-grid-mode #content.content-area.page-wrapper,
body.agora-channel-permanent.agora-catalog-grid-mode #content .row-main,
body.agora-channel-permanent.agora-catalog-grid-mode #content .row-main > .col,
body.agora-channel-permanent.agora-catalog-grid-mode #content .row-main > .col > .col-inner {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	min-height: 1px !important;
}

body.agora-catalog-grid-mode.agora-channel-rent #content.content-area.page-wrapper,
body.agora-catalog-grid-mode.agora-channel-permanent #content.content-area.page-wrapper,
body.agora-catalog-grid-mode.agora-channel-rent #content .row-main,
body.agora-catalog-grid-mode.agora-channel-permanent #content .row-main,
body.agora-catalog-grid-mode.agora-channel-rent #content .row-main > .col,
body.agora-catalog-grid-mode.agora-channel-permanent #content .row-main > .col {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.agora-catalog-grid-mode.agora-channel-rent .shop-container > .woocommerce[class*="columns-"],
body.agora-catalog-grid-mode.agora-channel-permanent .shop-container > .woocommerce[class*="columns-"] {
	margin-top: 0 !important;
	padding-top: 0 !important;
}
