/**
 * Mağaza mobil: WC yan panel + product_filters (cd-*) + 2 sütun ürün grid
 */

/* ─── WooCommerce arşiv: 2 sütun (≤767) ─── */
@media screen and (max-width: 767px) {
	body.woocommerce.archive ul.products,
	body.woocommerce-page.post-type-archive-product ul.products {
		display: flex !important;
		flex-wrap: wrap !important;
		justify-content: space-between !important;
		align-items: stretch !important;
		gap: 10px 8px !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		width: 100% !important;
	}

	body.woocommerce.archive ul.products::before,
	body.woocommerce.archive ul.products::after,
	body.woocommerce-page.post-type-archive-product ul.products::before,
	body.woocommerce-page.post-type-archive-product ul.products::after {
		display: none !important;
	}

	body.woocommerce.archive ul.products li.product,
	body.woocommerce-page.post-type-archive-product ul.products li.product {
		float: none !important;
		width: calc(50% - 4px) !important;
		max-width: calc(50% - 4px) !important;
		flex: 0 0 calc(50% - 4px) !important;
		margin: 0 0 14px 0 !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
		box-sizing: border-box !important;
	}

	body.woocommerce.archive ul.products li.product img,
	body.woocommerce-page.post-type-archive-product ul.products li.product img {
		width: 100%;
		height: auto;
		object-fit: cover;
	}

	body.woocommerce.archive ul.products li.product .archive-product-title,
	body.woocommerce-page.post-type-archive-product ul.products li.product .archive-product-title,
	body.woocommerce.archive ul.products li.product .woocommerce-title-metas,
	body.woocommerce-page.post-type-archive-product ul.products li.product .woocommerce-title-metas {
		font-size: 13px;
		line-height: 1.35;
		padding-left: 4px;
		padding-right: 4px;
	}
}

/* ─── product_filters shortcode: cd-gallery 2 sütun (≤767) ─── */
@media screen and (max-width: 767px) {
	.cd-main-content .cd-gallery ul {
		display: flex !important;
		flex-wrap: wrap !important;
		justify-content: space-between !important;
		gap: 10px 8px !important;
		text-align: left !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.cd-main-content .cd-gallery ul::after {
		display: none !important;
	}

	.cd-main-content .cd-gallery li.mix {
		width: calc(50% - 4px) !important;
		max-width: calc(50% - 4px) !important;
		flex: 0 0 calc(50% - 4px) !important;
		margin-bottom: 12px !important;
		box-sizing: border-box !important;
		vertical-align: top !important;
	}

	.cd-main-content .cd-gallery li .post,
	.cd-main-content .cd-gallery li .product-wrapper {
		width: 100% !important;
	}

	.cd-main-content .cd-gallery .woocommerce-title-metas {
		padding: 12px 6px 16px !important;
	}

	.cd-main-content .cd-gallery .archive-product-title {
		font-size: 13px !important;
		line-height: 1.35 !important;
	}
}

/* ─── WC yan panel (ibid): buton + bottom sheet (≤991) ─── */
@media screen and (max-width: 991px) {
	body.woocommerce.archive .ibid-shop-filters-button.hide-on-desktops {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 10px;
		width: 100%;
		max-width: 100%;
		margin: 12px 0 4px !important;
		padding: 14px 20px !important;
		font-size: 15px !important;
		font-weight: 700 !important;
		letter-spacing: 0.02em;
		border: none !important;
		border-radius: 14px !important;
		background: linear-gradient(135deg, #f5a623 0%, #e89410 100%) !important;
		color: #1a1206 !important;
		box-shadow: 0 4px 18px rgba(245, 166, 35, 0.35) !important;
		transition: transform 0.2s ease, box-shadow 0.2s ease;
	}

	body.woocommerce.archive .ibid-shop-filters-button.hide-on-desktops:active {
		transform: scale(0.98);
		box-shadow: 0 2px 10px rgba(245, 166, 35, 0.25) !important;
	}

	body.woocommerce.archive .ibid-shop-filters-button.hide-on-desktops i {
		font-size: 16px;
		opacity: 0.9;
	}

	.mzk-shop-filter-backdrop,
	.mzk-cd-filter-backdrop {
		position: fixed;
		inset: 0;
		z-index: 2230;
		background: rgba(12, 10, 8, 0.52);
		-webkit-backdrop-filter: blur(6px);
		backdrop-filter: blur(6px);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	.mzk-shop-filter-backdrop.mzk-is-visible,
	.mzk-cd-filter-backdrop.mzk-is-visible {
		opacity: 1;
		visibility: visible;
	}

	body.woocommerce.archive .sidebar-content.ibid-shop-sidebar {
		left: 0 !important;
		right: 0 !important;
		top: auto !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		height: min(88vh, 620px);
		margin: 0 auto !important;
		padding: 0 !important;
		border-radius: 22px 22px 0 0;
		box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22);
		transform: translate3d(0, 105%, 0);
		transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
		will-change: transform;
	}

	body.woocommerce.archive .sidebar-content.ibid-shop-sidebar.is-active {
		transform: translate3d(0, 0, 0);
	}

	body.woocommerce.archive .ibid-shop-sidebar .ibid-shop-sidebar-content-inner {
		position: relative;
		padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
		max-height: min(88vh, 620px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	body.woocommerce.archive .ibid-shop-sidebar .ibid-shop-sidebar-content-inner::before {
		content: "";
		display: block;
		width: 44px;
		height: 5px;
		margin: 0 auto 18px;
		background: rgba(0, 0, 0, 0.12);
		border-radius: 100px;
	}

	body.woocommerce.archive .ibid-shop-sidebar .ibid-shop-sidebar-content-inner::after {
		content: "Filtreler";
		display: block;
		font-size: 1.15rem;
		font-weight: 800;
		color: #1a1a1a;
		text-align: center;
		margin: -4px 48px 16px;
		letter-spacing: -0.02em;
	}

	body.woocommerce.archive .ibid-shop-sidebar-close-btn {
		top: 16px !important;
		right: 16px !important;
		width: 44px;
		height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 22px !important;
		color: #444 !important;
		background: rgba(0, 0, 0, 0.05);
		border-radius: 50%;
		z-index: 3;
		transition: background 0.2s ease, color 0.2s ease;
	}

	body.woocommerce.archive .ibid-shop-sidebar-close-btn:hover {
		background: rgba(245, 166, 35, 0.2);
		color: #1a1a1a !important;
	}

	body.admin-bar.woocommerce.archive .ibid-shop-sidebar-close-btn {
		top: 16px !important;
	}

	body.woocommerce.archive .ibid-shop-sidebar .widget {
		border-radius: 12px;
		padding: 4px 0;
	}

	body.woocommerce.archive .ibid-shop-sidebar .widget-title {
		font-size: 0.95rem;
		font-weight: 700;
		color: #333;
	}
}

/* ─── product_filters (cd-*): yapışkan araç çubuğu + alt popup (≤991) ─── */
@media screen and (max-width: 991px) {
	.mzk-cd-filter-toolbar {
		position: sticky;
		top: 0;
		z-index: 2140;
		display: flex;
		flex-direction: row;
		align-items: stretch;
		gap: 10px;
		padding: 10px 12px;
		margin: 0 -5px 8px;
		background: rgba(255, 255, 255, 0.97);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
	}

	.mzk-cd-filter-toolbar .cd-tab-filter-wrapper {
		flex: 1;
		min-width: 0;
		background: transparent !important;
		box-shadow: none !important;
		margin: 0 !important;
	}

	.mzk-cd-filter-toolbar .cd-tab-filter {
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		height: 44px !important;
	}

	.mzk-cd-filter-toolbar .cd-tab-filter a {
		height: 44px !important;
		line-height: 44px !important;
	}

	.mzk-cd-filter-toolbar .cd-filter-trigger {
		position: static !important;
		flex: 0 0 auto;
		align-self: center;
		height: 42px !important;
		line-height: 38px !important;
		width: auto !important;
		min-width: 108px;
		padding: 0 18px !important;
		margin: 0 !important;
		text-indent: 0 !important;
		color: #f5a623 !important;
		white-space: nowrap;
		font-size: 13px !important;
		font-weight: 800 !important;
		letter-spacing: 0.02em;
		text-transform: none !important;
		background: #fff !important;
		border: 2px solid #f5a623 !important;
		border-radius: 999px !important;
		box-shadow: 0 2px 12px rgba(245, 166, 35, 0.2);
		background-image: none !important;
		overflow: visible !important;
		z-index: 2;
	}

	/* Panel: tam genişlik alt sayfa */
	.cd-main-content .cd-filter {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		top: auto !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		height: min(88vh, 600px) !important;
		margin: 0 !important;
		padding: 0 !important;
		border-radius: 22px 22px 0 0 !important;
		box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.2) !important;
		z-index: 2240 !important;
		transform: translate3d(0, 108%, 0) !important;
		transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1) !important;
		opacity: 1 !important;
		-webkit-transform: translate3d(0, 108%, 0) !important;
		pointer-events: none;
		overflow: hidden;
	}

	body.mzk-cd-filter-open .cd-main-content .cd-filter {
		transform: translate3d(0, 0, 0) !important;
		-webkit-transform: translate3d(0, 0, 0) !important;
		pointer-events: auto !important;
	}

	.cd-main-content .cd-filter::before {
		height: 52px !important;
		background: linear-gradient(90deg, #f5a623, #e89410) !important;
		border-radius: 22px 22px 0 0 !important;
	}

	.cd-main-content .cd-filter form {
		padding: 64px 18px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
		max-height: calc(min(88vh, 600px) - 52px);
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
	}

	.cd-main-content .cd-filter .cd-close {
		top: 0 !important;
		right: 0 !important;
		height: 52px !important;
		line-height: 52px !important;
		width: 64px !important;
		background: transparent !important;
		opacity: 1 !important;
		font-size: 15px !important;
		font-weight: 700 !important;
	}

	.cd-main-content .cd-filter-block h4 {
		padding-left: 0 !important;
		font-size: 13px !important;
		border-radius: 10px;
	}

	/* Galeri her zaman tam genişlik */
	.cd-main-content .cd-gallery.filter-is-visible,
	.cd-main-content .cd-gallery {
		width: 100% !important;
		float: none !important;
		padding: 12px 3% 32px !important;
	}
}

@media screen and (max-width: 991px) and (prefers-reduced-motion: reduce) {
	body.woocommerce.archive .sidebar-content.ibid-shop-sidebar,
	.mzk-shop-filter-backdrop,
	.mzk-cd-filter-backdrop,
	.cd-main-content .cd-filter {
		transition: none !important;
	}
}

/* =============================================================================
   WooCommerce blok vitrin (Elementor / Gutenberg)
   WC: <600px varsayılan tek sütun — Mezatika’da 2 sütun.
   Filtre popup: z-index Mezatika header (9999) / alt nav (10000) ile çakışmasın.
   ============================================================================= */

@media screen and (max-width: 599px) {
	.wp-block-woocommerce-product-collection:not(:has(.is-product-collection-layout-carousel))
		ul.wc-block-product-template.is-flex-container {
		gap: 0.75em !important;
	}

	.wp-block-woocommerce-product-collection:not(:has(.is-product-collection-layout-carousel))
		ul.wc-block-product-template.is-flex-container
		> li {
		width: calc(50% - 0.375em) !important;
		max-width: calc(50% - 0.375em) !important;
		flex: 0 0 calc(50% - 0.375em) !important;
		box-sizing: border-box !important;
	}
}

@media screen and (max-width: 600px) {
	:where(.wc-block-product-filters) {
		position: sticky;
		top: 56px;
		z-index: 9985;
		display: flex !important;
		width: 100%;
		box-sizing: border-box;
		margin: 0 0 12px;
		padding: 10px 12px;
		background: rgba(255, 255, 255, 0.97);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
	}

	:where(.wc-block-product-filters) .wc-block-product-filters__open-overlay {
		flex: 1 1 auto;
		justify-content: center;
		min-height: 46px;
		padding: 0 16px !important;
		border: 2px solid #f2a900;
		border-radius: 12px;
		background: #fff;
		font-weight: 700;
		font-size: 14px;
		color: #1a1a1a;
		gap: 8px;
	}

	:where(.wc-block-product-filters).is-overlay-opened .wc-block-product-filters__overlay {
		z-index: 100060 !important;
	}

	:where(.wc-block-product-filters) .wc-block-product-filters__overlay-dialog {
		border-radius: 20px 20px 0 0;
		max-height: 88vh !important;
	}

	:where(.wc-block-product-filters) .wc-block-product-filters__apply {
		background: linear-gradient(135deg, #f2a900, #e89410) !important;
		color: #1a1206 !important;
		border: none !important;
		border-radius: 12px !important;
		font-weight: 800 !important;
	}

	body.admin-bar .wc-block-product-filters {
		top: calc(56px + var(--wp-admin--admin-bar--height, 32px));
	}
}

/* =============================================================================
   Kategori seçim listesi (page-category-selection.php)
   Şablondaki inline CSS 480px’te tek sütuna geçiyor; burada 2 sütun + alt filtre sayfası.
   ============================================================================= */

@media screen and (max-width: 991px) {
	body.mzk-kategori-secim--listing .product-list-container {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding-left: 12px;
		padding-right: 12px;
		max-width: 100%;
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-toolbar {
		order: 0;
		flex: 0 0 auto;
		display: flex;
		position: sticky;
		top: 88px;
		z-index: 9990;
		margin: 0 0 4px;
		padding: 10px 0;
		background: rgba(255, 255, 255, 0.97);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
	}

	body.admin-bar.mzk-kategori-secim--listing .mzk-ksec-filter-toolbar {
		top: calc(88px + var(--wp-admin--admin-bar--height, 32px));
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-open-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		width: 100%;
		min-height: 46px;
		padding: 12px 20px;
		border: 2px solid #f2a900;
		border-radius: 14px;
		background: #fff;
		color: #1a1a1a;
		font-size: 15px;
		font-weight: 800;
		letter-spacing: 0.02em;
		cursor: pointer;
		box-shadow: 0 2px 12px rgba(242, 169, 0, 0.2);
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-open-btn:active {
		transform: scale(0.99);
	}

	body.mzk-kategori-secim--listing .filter-section > h3.mzk-ksec-filter-heading-hidden {
		display: none !important;
	}

	body.mzk-kategori-secim--listing .product-sidebar {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		top: auto !important;
		width: 100% !important;
		max-width: 100% !important;
		height: min(88vh, 620px) !important;
		margin: 0 !important;
		padding: 0 !important;
		z-index: 100050 !important;
		transform: translate3d(0, 108%, 0) !important;
		transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1) !important;
		will-change: transform;
		box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22) !important;
		border-radius: 22px 22px 0 0 !important;
		overflow: hidden;
		background: #fff;
	}

	body.mzk-kategori-secim--listing.mzk-ksec-filter-open .product-sidebar {
		transform: translate3d(0, 0, 0) !important;
	}

	body.mzk-kategori-secim--listing .product-sidebar .filter-section {
		display: flex;
		flex-direction: column;
		height: 100%;
		max-height: min(88vh, 620px);
		padding: 12px 18px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		border-radius: 22px 22px 0 0;
		box-shadow: none;
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-sheet-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: -4px 0 14px;
		padding-bottom: 12px;
		border-bottom: 2px solid #fff3d3;
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-sheet-head h3 {
		margin: 0;
		font-size: 1.1rem;
		font-weight: 800;
		border: none;
		padding: 0;
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-close {
		flex: 0 0 auto;
		width: 44px;
		height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
		border: none;
		border-radius: 50%;
		background: rgba(0, 0, 0, 0.06);
		color: #333;
		font-size: 22px;
		line-height: 1;
		cursor: pointer;
	}

	body.mzk-kategori-secim--listing .product-content {
		order: 1;
		flex: 1 1 auto;
		min-width: 0;
		width: 100%;
	}

	body.mzk-kategori-secim--listing .mzk-ksec-filter-backdrop {
		position: fixed;
		inset: 0;
		z-index: 100040;
		background: rgba(12, 10, 8, 0.52);
		-webkit-backdrop-filter: blur(6px);
		backdrop-filter: blur(6px);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	body.mzk-kategori-secim--listing.mzk-ksec-filter-open .mzk-ksec-filter-backdrop {
		opacity: 1;
		visibility: visible;
	}
}

@media screen and (min-width: 992px) {
	body.mzk-kategori-secim--listing .mzk-ksec-filter-toolbar,
	body.mzk-kategori-secim--listing .mzk-ksec-filter-backdrop,
	body.mzk-kategori-secim--listing .mzk-ksec-filter-sheet-head {
		display: none !important;
	}

	body.mzk-kategori-secim--listing .product-sidebar {
		position: relative !important;
		transform: none !important;
		height: auto !important;
		width: 280px !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		overflow: visible !important;
	}
}

/* Ürün kartları: şablondaki 480px tek sütunu ezip iki sütun (dar ekranda da) */
@media screen and (max-width: 767px) {
	body.mzk-kategori-secim--listing .product-content .products-grid {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 10px 8px !important;
	}

	body.mzk-kategori-secim--listing .product-card .product-title {
		font-size: 14px;
		line-height: 1.3;
	}

	body.mzk-kategori-secim--listing .product-card .product-details {
		padding: 10px 8px 12px;
	}

	body.mzk-kategori-secim--listing .product-card .current-bid,
	body.mzk-kategori-secim--listing .product-card .product-price {
		font-size: 15px;
	}

	body.mzk-kategori-secim--listing .product-card .bid-button,
	body.mzk-kategori-secim--listing .product-card .add-to-cart {
		padding: 8px 10px;
		font-size: 13px;
	}
}

@media screen and (max-width: 360px) {
	body.mzk-kategori-secim--listing .product-content .products-grid {
		grid-template-columns: 1fr !important;
	}
}

@media screen and (max-width: 991px) and (prefers-reduced-motion: reduce) {
	body.mzk-kategori-secim--listing .product-sidebar {
		transition: none !important;
	}
}
