/**
 * Category archive blocks — minimal layout; colors/typography from Storefront theme.
 */

.asc-cat-archive-blocks,
.asc-cat-archive-blocks * {
	box-sizing: border-box;
}

.asc-cat-archive-blocks {
	direction: rtl;
	text-align: right;
	clear: both;
	margin: 1.5em 0;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
	word-wrap: break-word;
	overflow-x: clip;
}

.asc-cat-archive-blocks img,
.asc-cat-archive-blocks video,
.asc-cat-archive-blocks iframe {
	max-width: 100%;
	height: auto;
}

/* Prevent editor-injected fixed widths (caption/figure/image wrappers) from overflowing mobile viewport. */
.asc-cat-archive-blocks .wp-caption,
.asc-cat-archive-blocks figure,
.asc-cat-archive-blocks .wp-block-image,
.asc-cat-archive-blocks .wp-block-gallery {
	max-width: 100% !important;
}

.asc-cat-archive-blocks .wp-caption {
	width: 100% !important;
}

.asc-cat-archive-blocks .wp-caption img {
	width: 100%;
	height: auto;
}

.asc-cat-archive-blocks table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.asc-cat-archive-blocks pre {
	max-width: 100%;
	overflow-x: auto;
}

.asc-cat-archive-blocks .asc-cat-section {
	margin-bottom: 1.75em;
	min-width: 0;
	max-width: 100%;
}

.asc-cat-archive-blocks > .asc-cat-section:not(:last-child) {
	padding-bottom: 10px;
	border-bottom: 1px solid var(--asc-color-border);
}

.asc-cat-archive-blocks .asc-cat-section__head {
	margin-bottom: 0.75em;
	min-width: 0;
}

/* Title row: h2 uses theme/customizer heading color & typography (do not set color/font-size here). */
.asc-cat-archive-blocks .asc-cat-section__head .asc-cat-section__title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1em;
	flex-wrap: wrap;
	margin: 0 0 0.5em;
	min-width: 0;
	max-width: 100%;
	width: 100%;
}

.asc-cat-archive-blocks .asc-cat-section__title-text {
	flex: 1 1 auto;
	min-width: 0;
}

.asc-cat-archive-blocks .asc-cat-section__title .asc-cat-badge {
	flex-shrink: 0;
}

.asc-cat-archive-blocks .asc-cat-badge {
	font-weight: 600;
	opacity: 0.85;
}

.asc-cat-archive-blocks .asc-cat-badge em {
	font-style: normal;
	font-weight: 400;
	font-size: 0.92em;
	margin-right: 0.2em;
}

/* Intro: clamp long excerpt; JS adds .is-short when content fits, .is-expanded when “more” is open */
.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__excerpt {
	min-width: 0;
	max-width: 100%;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__excerpt:not(.is-short):not(.is-expanded) {
	overflow: hidden;
	max-height: 320px;
	transition: max-height 0.35s ease, -webkit-mask-image 0.35s ease, mask-image 0.35s ease;
}

/* بریده‌شده: بیشتر متن واضح؛ فقط حدود ۲۰٪ پایین محو می‌شود */
.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__excerpt:not(.is-short):not(.is-expanded) {
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 78%, rgba(0, 0, 0, 0.12) 100%);
	mask-image: linear-gradient(to bottom, #000 0%, #000 78%, rgba(0, 0, 0, 0.12) 100%);
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__excerpt.is-expanded {
	max-height: none;
	overflow: visible;
	-webkit-mask-image: none;
	mask-image: none;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__excerpt.is-short {
	max-height: none;
	overflow: visible;
	-webkit-mask-image: none;
	mask-image: none;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__body {
	margin: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__body > p:first-child {
	margin-top: 0;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__body > p:last-child {
	margin-bottom: 0;
}

.asc-cat-archive-blocks .asc-cat-intro .asc-cat-intro__toggle {
	margin-top: 0.75em;
	max-width: 100%;
}

/* دکمه‌های «نمایش بیشتر» / «ادامهٔ تصاویر» — همان الگوی دکمه پیام‌های WooCommerce (typography.css) */
.asc-cat-archive-blocks .button.asc-cat-intro__toggle,
.asc-cat-archive-blocks .button.asc-cat-customer-gallery__more {
	float: none !important;
	font-family: var(--asc-font-family) !important;
	padding: var(--asc-spacing-xs) var(--asc-spacing-lg) !important;
	min-height: var(--asc-touch-min) !important;
	background: var(--asc-color-bg-alt) !important;
	color: var(--asc-color-primary) !important;
	box-shadow: none !important;
	line-height: 1.618 !important;
	border-width: 0 !important;
	border-radius: 0 !important;
	border-style: solid !important;
	cursor: pointer;
}

.asc-cat-archive-blocks .button.asc-cat-intro__toggle:hover,
.asc-cat-archive-blocks .button.asc-cat-intro__toggle:focus-visible,
.asc-cat-archive-blocks .button.asc-cat-customer-gallery__more:hover,
.asc-cat-archive-blocks .button.asc-cat-customer-gallery__more:focus-visible {
	background: var(--asc-color-primary) !important;
	color: #fff !important;
}

.asc-cat-archive-blocks .button.asc-cat-customer-gallery__more:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* FAQ — structure only; buttons use theme .button where applicable */
.asc-cat-faq__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.asc-cat-faq__item {
	margin-bottom: 0.5em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
}

.asc-cat-faq__trigger {
	display: flex;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	text-align: right;
	padding: 0.75em 1em;
	background: transparent;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 500;
	color: inherit;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
}

.asc-cat-faq__trigger > span {
	min-width: 0;
	flex: 1 1 auto;
	text-align: right;
	overflow-wrap: anywhere;
}

.asc-cat-faq__panel {
	padding: 1em 1em;
	display: none;
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
}

.asc-cat-faq__panel.is-open {
	display: block;
}

.asc-cat-faq__panel-inner {
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
}

.asc-cat-faq__panel p:first-child {
	margin-top: 0;
}

.asc-cat-faq__panel p:last-child {
	margin-bottom: 0;
}

/* Customer images grid — tracks never force wider than the column */
.asc-cat-customer-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(4.5rem, 100%), 1fr));
	gap: 0.5em;
	margin-top: 0.35em;
	min-width: 0;
	max-width: 100%;
}

.asc-cat-customer-gallery__item {
	display: block;
	line-height: 0;
	min-width: 0;
	max-width: 100%;
}

.asc-cat-customer-gallery__item img {
	width: 100%;
	max-width: 100%;
	height: auto;
	vertical-align: middle;
	object-fit: cover;
	aspect-ratio: 1;
}

.asc-cat-customer-gallery__more-wrap {
	margin: 0.75em 0 0;
}

/* Review-image lightbox (same behavior as تب نظرات — matches single-product lightbox markup) */
.asc-review-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
}

.asc-review-lightbox.is-open {
	display: block;
}

.asc-review-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.asc-review-lightbox__dialog {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-width: min(92vw, 1000px);
	max-height: 92vh;
	padding: 0;
}

.asc-review-lightbox__image {
	display: block;
	max-width: 92vw;
	max-height: 92vh;
	width: auto;
	height: auto;
	border-radius: 10px;
	background: #fff;
}

.asc-review-lightbox__close {
    position: absolute;
    top: -12px;
    left: -12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 32px;
    padding: 0px 16px;
    cursor: pointer;
}

.asc-review-lightbox__close:hover {
	background: rgba(0, 0, 0, 0.7);
}

html.asc-review-lightbox-open {
	overflow: hidden;
}
