/*
 * Organik Pazar Core — block styles (front end + editor).
 * Uses the theme's CSS variables when present, with neutral fallbacks for other themes.
 */

/* Ürün Vitrini */
.op-showcase {
	margin-block: 48px;
}

.op-showcase__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.op-showcase__title {
	margin: 0;
	font-size: clamp(20px, 2.6vw, 28px);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.op-showcase__subtitle {
	margin: 4px 0 0;
	color: var(--op-color-muted, #6b6c66);
	font-size: 14px;
}

.op-showcase__all {
	flex-shrink: 0;
	color: var(--op-color-primary, #2d5a3d);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.op-showcase__all:hover {
	text-decoration: underline;
}

.op-showcase__empty,
.op-catgrid__empty {
	padding: 24px;
	border: 1px dashed var(--op-color-border, #dcdcdc);
	border-radius: 12px;
	color: var(--op-color-muted, #6b6c66);
	text-align: center;
}

/* Kategori Vitrini */
.op-catgrid {
	margin-block: 48px;
}

.op-catgrid__title {
	margin: 0 0 18px;
	font-size: clamp(20px, 2.6vw, 28px);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.op-catgrid__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.op-catgrid__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 16px;
	}
}

@media (min-width: 1100px) {
	.op-catgrid__list {
		grid-template-columns: repeat(var(--op-catgrid-cols, 6), minmax(0, 1fr));
		gap: 20px;
	}
}

.op-catgrid__item {
	margin: 0;
}

.op-catgrid__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: var(--op-color-text, #1c1d1a);
	text-align: center;
	text-decoration: none;
}

.op-catgrid__media {
	display: block;
	width: 100%;
	max-width: 170px;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 50%;
	background: var(--op-color-surface, #f7f6f2);
}

.op-catgrid__media img {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.op-catgrid__link:hover .op-catgrid__media img {
	transform: scale(1.06);
}

.op-catgrid__name {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.op-catgrid__count {
	margin-top: -6px;
	color: var(--op-color-muted, #6b6c66);
	font-size: 12px;
}

/* Slider */
.op-slider {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	background: var(--op-color-surface, #eeeeea);
}

.op-slider__track {
	display: flex;
	aspect-ratio: var(--op-slider-ratio-m, 4/3);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.op-slider__track::-webkit-scrollbar {
	display: none;
}

.op-slider__track:focus-visible {
	outline: 3px solid var(--op-color-primary, #128a5e);
	outline-offset: -3px;
}

.op-slider__slide {
	flex: 0 0 100%;
	height: 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.op-slider__slide > * {
	width: 100%;
	max-width: none !important;
	height: 100%;
	margin: 0 !important;
}

.op-slider__slide .wp-block-image a {
	display: block;
	height: 100%;
}

.op-slider__slide .wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.op-slider__slide > .wp-block-cover {
	min-height: 100% !important;
}

/* Phones: swipe + dots only; arrows would cover slide content. */
.op-slider__arrow {
	display: none;
}

@media (max-width: 767px) {
	.op-slider .wp-block-cover {
		padding: 20px;
	}

	.op-slider .wp-block-cover .has-hero-font-size {
		font-size: clamp(24px, 7.5vw, 34px) !important;
	}

	.op-slider .wp-block-cover .has-large-font-size {
		font-size: 15px !important;
	}
}

.op-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 24, 20, 0.45);
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.2s;
}

.op-slider__arrow:hover {
	background: rgba(20, 24, 20, 0.7);
}

.op-slider__arrow--prev {
	left: 12px;
}

.op-slider__arrow--next {
	right: 12px;
}

.op-slider__dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	z-index: 2;
	display: flex;
	gap: 6px;
	transform: translateX(-50%);
}

.op-slider__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.55);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	transition: width 0.25s, background-color 0.25s;
}

/* White active pill: visible on photos and on brand-colored slides alike. */
.op-slider__dot[aria-current="true"] {
	width: 26px;
	background: #fff;
}

@media (min-width: 768px) {
	.op-slider {
		border-radius: 22px;
	}

	.op-slider__track {
		aspect-ratio: var(--op-slider-ratio, 16/9);
	}

	.op-slider__arrow {
		display: inline-flex;
		width: 46px;
		height: 46px;
	}

	.op-slider__arrow--prev {
		left: 20px;
	}

	.op-slider__arrow--next {
		right: 20px;
	}
}

/* Slider in the editor: slides stacked for easy editing */
.op-slider-editor > .block-editor-inner-blocks > .block-editor-block-list__layout > * + * {
	margin-top: 12px;
}

/* Kategori Hapları */
.op-pills {
	margin-block: 16px;
}

.op-pills__list {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 4px 2px;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.op-pills__list::-webkit-scrollbar {
	display: none;
}

.op-pills__list > li {
	flex: 0 0 auto;
	margin: 0;
	scroll-snap-align: start;
}

.op-pills__pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 16px 0 12px;
	border: 1px solid var(--op-color-border, #e5e5e0);
	border-radius: 999px;
	background: #fff;
	color: var(--op-color-muted, #5f605b);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.op-pills__pill:hover {
	border-color: var(--op-color-primary, #128a5e);
	color: var(--op-color-primary, #128a5e);
}

.op-pills__pill.is-active {
	border: 2px solid var(--op-color-primary, #128a5e);
	background: var(--op-color-primary-soft, #eaf6f0);
	color: var(--op-color-primary, #128a5e);
	font-weight: 700;
}

.op-pills__icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

.op-pills__img {
	width: 26px;
	height: 26px;
	margin: 0;
	border-radius: 6px;
	object-fit: cover;
}

@media (min-width: 992px) {
	.op-pills__list {
		flex-wrap: wrap;
		justify-content: center;
		overflow: visible;
	}
}

.op-block-loading {
	display: flex;
	justify-content: center;
	padding: 32px;
}

@media (prefers-reduced-motion: reduce) {
	.op-catgrid__media img,
	.op-slider__dot {
		transition: none;
	}
}
