/*
 * Category / shop pages — matches the live site (snippets 43, 67, 68, 96, 97 + load more).
 * Replaces category.css on these pages.
 */

.bma-main {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 15px 20px;
	direction: rtl;
	text-align: right;
	color: #333;
}

/* Breadcrumb */
.bma-main .woocommerce-breadcrumb {
	font-size: 14.72px;
	color: #767676;
	margin: 0 0 14.72px;
}
.bma-main .woocommerce-breadcrumb a { color: #767676; text-decoration: none; }
.bma-main .woocommerce-breadcrumb a:hover { color: #6B21A8; }

/* Title */
.bma-head .page-title {
	font-size: 40px;
	font-weight: 500;
	color: #333;
	margin: 8px 0 16px;
	line-height: 1.2;
}

/* Description with "קרא עוד" */
.bma-desc { font-size: 16px; line-height: 24px; color: #333; }
.bma-desc a { color: #6A1B9A; }
.bma-desc.is-long { position: relative; max-height: 4.6em; overflow: hidden; transition: max-height .3s; }
.bma-desc.is-long::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 2.2em;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}
.bma-desc.is-long.open { max-height: none; }
.bma-desc.is-long.open::after { display: none; }
.bma-more {
	background: none;
	border: 0;
	padding: 4px 0;
	margin: 2px 0 14px;
	color: #6A1B9A;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	text-decoration: underline;
	font-family: inherit;
	box-shadow: none;
	min-height: 0;
}
.bma-more:focus-visible { outline: 2px solid #FF6A00; outline-offset: 2px; }

/* Subcategory tiles (one compact row, swipe on mobile) */
.bma-subcats { position: relative; margin: 4px 0 18px; }
.bma-subcats-row {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: 12px;
}
.bma-subcat {
	flex: 1 1 0;
	max-width: 124px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	background: #fff;
	border: 1px solid #ECE6F3;
	border-radius: 14px;
	padding: 8px 8px 10px;
	box-sizing: border-box;
	transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bma-subcat:hover,
.bma-subcat:focus-visible {
	border-color: #6A1B9A;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(106, 27, 154, .12);
	outline: none;
}
.bma-subcat img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 10px;
	margin: 0;
}
.bma-subcat span {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: clamp(11.5px, 1vw, 13.5px);
	font-weight: 600;
	line-height: 1.3;
	color: #2B2238;
	text-align: center;
}

/* Filter bar (admins only for now) */
.bma-filt { margin: 6px 0 14px; }
.bma-filt-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 6px; }
.bma-filt details { position: relative; flex: 0 0 auto; }
.bma-filt summary {
	list-style: none;
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border: 1.5px solid #D9CDEA;
	border-radius: 999px;
	background: #fff;
	color: #1F1530;
	font-weight: 600;
	font-size: 14.5px;
	cursor: pointer;
	white-space: nowrap;
}
.bma-filt summary::-webkit-details-marker { display: none; }
.bma-filt summary::after {
	content: "";
	width: 7px;
	height: 7px;
	border-right: 2px solid #6B21A8;
	border-bottom: 2px solid #6B21A8;
	transform: rotate(45deg) translateY(-2px);
	display: inline-block;
}
.bma-filt summary.on { background: #6B21A8; color: #fff; border-color: #6B21A8; }
.bma-filt summary.on::after { border-color: #fff; }
.bma-filt details[open] summary { border-color: #6B21A8; }
.bma-filt details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
@media (hover: hover) { .bma-filt summary:hover { border-color: #6B21A8; } }
.bma-filt-pop {
	position: absolute;
	top: 44px;
	right: 0;
	z-index: 50;
	background: #fff;
	border: 1px solid #E6DCF2;
	border-radius: 14px;
	box-shadow: 0 12px 30px rgba(40, 10, 70, .18);
	padding: 40px 8px 8px;
	min-width: 190px;
	max-height: 60vh;
	overflow: auto;
}
.bma-filt-pop a { display: block; padding: 9px 12px; border-radius: 9px; color: #1F1530; text-decoration: none; font-size: 15px; }
.bma-filt-pop a:hover { background: #F6F0FC; }
.bma-filt-pop a.sel { background: #F6F0FC; color: #6B21A8; font-weight: 800; }
.bma-filt-pop a.sel::after { content: " ✓"; }
.bma-filt-x {
	position: absolute;
	top: 8px;
	left: 8px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 0;
	background: #F5EFFC;
	color: #1F1530;
	font-size: 18px;
	line-height: 30px;
	text-align: center;
	cursor: pointer;
	padding: 0;
	min-height: 0;
	box-shadow: none;
}
.bma-filt-x:hover { background: #EC4899; color: #fff; }
.bma-sheet-t { display: none; }
.bma-filt-clear { display: inline-flex; align-items: center; height: 38px; padding: 0 6px; color: #6B21A8; font-weight: 800; font-size: 14px; white-space: nowrap; text-decoration: none; }
.bma-clear-big { display: inline-block; margin: 12px 0 0; padding: 10px 18px; background: #7B2CBF; color: #fff; border-radius: 999px; font-weight: 700; text-decoration: none; }

/* Result count (sorting is hidden, like the live site) */
.bma-main .woocommerce-result-count { font-size: 14px; color: #666; margin: 0 0 20px; }
.bma-main .woocommerce-ordering { display: none; }

/* Product grid */
.bma-main ul.products,
.bma-main ul.products:has(> li) {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px 16px;
	align-items: stretch;
	clear: both;
}
.bma-main ul.products::before,
.bma-main ul.products::after { display: none; }
.bma-main ul.products li.product {
	display: flex;
	width: auto;
	float: none;
	margin: 0;
	padding: 0;
}
.bma-main ul.products.bma-busy { opacity: .45; transition: opacity .2s; }

/* "טען עוד מוצרים" */
.bma-lm { display: flex; flex-direction: column; align-items: center; width: 100%; margin: 28px 0 36px; }
.bma-lm[hidden] { display: none; }
.bma-lm-btn {
	background: #9C27B0;
	color: #fff;
	border: 0;
	border-radius: 30px;
	padding: 12px 32px;
	min-width: 220px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
	font-family: inherit;
}
@media (hover: hover) { .bma-lm-btn:hover { background: #7B1FA2; } }
.bma-lm-btn[disabled] { opacity: .75; cursor: wait; }
.bma-lm-err { margin-top: 10px; font-size: 14px; color: #B00020; text-align: center; }
.bma-main .woocommerce-pagination.bma-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
.bma-main .woocommerce-pagination ul { list-style: none; display: flex; gap: 6px; justify-content: center; padding: 0; }
.bma-main .woocommerce-pagination .page-numbers { display: inline-block; padding: 6px 12px; border-radius: 8px; border: 1px solid #E5DFF0; color: #1F1530; text-decoration: none; }
.bma-main .woocommerce-pagination .current { background: #6B21A8; color: #fff; border-color: #6B21A8; }

/* Category text + accordion */
.bma-extra { margin: 30px 0 10px; }
.bma-extra-text { font-size: 16px; line-height: 1.7; color: #333; margin-bottom: 20px; }
.bma-acc { border-top: 1px solid #ECE6F3; }
.bma-acc-item { border-bottom: 1px solid #ECE6F3; }
.bma-acc-item summary {
	list-style: none;
	cursor: pointer;
	padding: 16px 4px;
	font-size: 17px;
	font-weight: 700;
	color: #1F1530;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}
.bma-acc-item summary::-webkit-details-marker { display: none; }
.bma-acc-item summary::after { content: "+"; font-size: 22px; color: #6B21A8; line-height: 1; }
.bma-acc-item[open] summary::after { content: "−"; }
.bma-acc-body { padding: 0 4px 16px; line-height: 1.7; color: #3B3347; }

/* Swipe hint (live: snippet 68) */
.bma-hsc-w { position: relative; }
.bma-hsc {
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 48px);
	mask-image: linear-gradient(to left, transparent 0, #000 48px);
}
.bma-hsc.bma-hsc-end { -webkit-mask-image: none; mask-image: none; }
.bma-hsc-a {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #EADFF7;
	color: #6B21A8;
	box-shadow: 0 3px 10px rgba(31, 21, 48, .18);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	padding: 0;
	cursor: pointer;
	min-height: 0;
	animation: bmaHscP 1.6s ease-in-out 3;
}
.bma-hsc-a svg { width: 16px; height: 16px; stroke: #6B21A8; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bma-hsc-w.bma-at-end .bma-hsc-a { opacity: 0; pointer-events: none; }
@keyframes bmaHscP { 0%, 100% { transform: translateY(-50%); } 50% { transform: translateY(-50%) translateX(-4px); } }

/* ======================================================
   MOBILE
   ====================================================== */
@media (max-width: 767px) {
	.bma-main { padding: 0 10px 20px; }

	.bma-subcats-row {
		justify-content: flex-start;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 2px 2px 8px;
		gap: 10px;
	}
	.bma-subcats-row::-webkit-scrollbar { display: none; }
	.bma-subcat { flex: 0 0 104px; min-width: 104px; scroll-snap-align: start; }
	.bma-subcat span { font-size: 12.5px; }

	.bma-filt-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
	.bma-filt-row::-webkit-scrollbar { display: none; }
	.bma-filt details[open] .bma-filt-pop {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		width: 100%;
		max-height: 70vh;
		overflow-y: auto;
		border-radius: 20px 20px 0 0;
		z-index: 100001;
		padding: 56px 16px 24px;
		box-shadow: 0 -10px 30px rgba(31, 21, 48, .2);
		animation: bmaSheet .22s ease-out;
	}
	.bma-filt details[open] .bma-filt-pop a { padding: 14px 6px; font-size: 16px; border-bottom: 1px solid #F1EBF8; }
	.bma-filt details[open] .bma-filt-x { top: 12px; left: 12px; width: 36px; height: 36px; line-height: 36px; }
	.bma-sheet-t { display: block; position: absolute; top: 18px; right: 18px; font-size: 17px; font-weight: 700; color: #1F1530; }
	.bma-sheet-ov { position: fixed; inset: 0; background: rgba(31, 21, 48, .45); z-index: 100000; }

	.bma-main ul.products,
	.bma-main ul.products:has(> li) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }

	.bma-lm-btn { width: calc(100% - 32px); max-width: 360px; padding: 14px 20px; }
}
@keyframes bmaSheet { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.bma-subcat, .bma-desc.is-long { transition: none; }
	.bma-subcat:hover { transform: none; }
	.bma-hsc-a, .bma-filt-pop { animation: none; }
}
