.forberries-tiles {
	width: 100%;
	max-width: 100%;
}

.forberries-tiles__swiper {
	overflow-x: auto;
	overflow-y: hidden;
	width: 100%;
	/* Miejsce na uniesienie + cień (overflow clipuje do padding edge) */
	padding: 50px 3% 70px;
	margin: -20px 0 -70px;
	box-sizing: border-box;
}

.forberries-tiles__swiper.swiper-initialized {
	overflow: hidden;
}

.forberries-tiles__swiper .swiper-wrapper {
	align-items: stretch;
}

.forberries-tiles__swiper:not(.swiper-initialized) .swiper-wrapper {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: stretch;
	gap: var(--fb-tiles-gap, 25px);
}

.forberries-tiles__swiper:not(.swiper-initialized) .forberries-tiles__slide {
	margin: 0 !important;
}

.forberries-tiles__slide {
	width: 275px;
	height: auto;
	box-sizing: border-box;
}

.forberries-tiles__tile {
	display: flex;
	flex-direction: column;
	width: 275px;
	height: 100%;
	min-height: 100%;
	padding: 25px;
	border: 1px solid transparent;
	border-radius: 22px;
	box-sizing: border-box;
	box-shadow: 0px 4px 40px 0px #A0B71800;
	background: var(--fb-tiles-bg, #24314F);
	color: #FDFEFF;
	text-decoration: none;
	transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.forberries-tiles__media {
	flex: 0 0 auto;
}

.forberries-tiles__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.forberries-tiles__tile:hover,
.forberries-tiles__tile:focus {
	text-decoration: none;
	color: #FDFEFF;
	transform: translateY(-5px);
	box-shadow: 0px 4px 40px 0px #A0B71833;
}

.forberries-tiles__tile:focus-visible {
	outline: 2px solid #A0B718;
	outline-offset: 3px;
}

/* Border wyłącznie na pojedynczych kafelkach — nie na wrapperze bloku */
.forberries-tiles--border .forberries-tiles__tile {
	border: 1px solid var(--fb-tiles-stroke, #1A2641);
}

.forberries-tiles--border .forberries-tiles__tile:hover,
.forberries-tiles--border .forberries-tiles__tile:focus {
	border-color: #A0B718;
}

.forberries-tiles--custom-text .forberries-tiles__tile {
	color: var(--fb-tiles-ink, #FDFEFF);
}

.forberries-tiles--custom-text .forberries-tiles__tile:hover,
.forberries-tiles--custom-text .forberries-tiles__tile:focus {
	color: var(--fb-tiles-ink, #FDFEFF);
}

.forberries-tiles--custom-text .forberries-tiles__title,
.forberries-tiles--custom-text .forberries-tiles__text {
	color: var(--fb-tiles-ink, #FDFEFF);
}

.forberries-tiles--custom-text .forberries-tiles__cta {
	border-top-color: color-mix(
		in srgb,
		var(--fb-tiles-ink, #FDFEFF) 20%,
		transparent
	);
}

.forberries-tiles__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 70px;
	height: 70px;
	padding: var(--fb-tiles-icon-pad, 15px);
	border-radius: 16px;
	box-sizing: border-box;
	flex-shrink: 0;
	overflow: hidden;
	background: var(--fb-tiles-icon-bg, #1A2641);
	transition: background-color 0.3s ease;
}

.forberries-tiles--layout-columns .forberries-tiles__tile {
	display: grid;
	grid-template-columns: minmax(35px, var(--fb-tiles-icon-column-width, 100px)) minmax(0, 1fr);
	column-gap: 20px;
	align-items: start;
}

.forberries-tiles--layout-columns.forberries-tiles--columns-middle .forberries-tiles__tile {
	align-items: center;
}

.forberries-tiles--layout-columns .forberries-tiles__media {
	width: var(--fb-tiles-icon-column-width, 100px);
	min-width: 35px;
}

.forberries-tiles--layout-columns .forberries-tiles__icon {
	width: 100%;
	height: auto;
	min-height: 35px;
	aspect-ratio: 1 / 1;
}

.forberries-tiles__icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: filter 0.3s ease;
}

.forberries-tiles__tile:hover .forberries-tiles__icon,
.forberries-tiles__tile:focus .forberries-tiles__icon {
	background: #A0B718;
}

.forberries-tiles__tile:hover .forberries-tiles__icon img,
.forberries-tiles__tile:focus .forberries-tiles__icon img {
	/* Przybliżenie koloru ikony do #1A2641 (dla jasnych / białych ikon) */
	filter: brightness(0) saturate(100%) invert(11%) sepia(22%) saturate(1600%) hue-rotate(190deg) brightness(95%) contrast(92%);
}

.forberries-tiles__icon-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 8px;
	background: rgba(253, 254, 255, 0.08);
}

.forberries-tiles--numbers .forberries-tiles__icon {
	border-radius: 50%;
	padding: 0;
}

.forberries-tiles__number {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 36px;
	font-weight: 700;
	line-height: 1;
	color: inherit;
}

.forberries-tiles--numbers .forberries-tiles__tile:hover .forberries-tiles__icon,
.forberries-tiles--numbers .forberries-tiles__tile:focus .forberries-tiles__icon {
	color: #1A2641;
}

.forberries-tiles--custom-text.forberries-tiles--numbers .forberries-tiles__number {
	color: #A0B718;
}

.forberries-tiles--custom-text.forberries-tiles--numbers .forberries-tiles__tile:hover .forberries-tiles__number,
.forberries-tiles--custom-text.forberries-tiles--numbers .forberries-tiles__tile:focus .forberries-tiles__number {
	color: #1A2641;
}

.forberries-tiles__title {
	margin: 0 !important;
	padding: 0;
	line-height: 1.3;
	color: #FDFEFF;
}

h3.forberries-tiles__title {
	font-size: 28px;
	font-weight: 500;
}

h4.forberries-tiles__title {
	font-size: 20px;
	font-weight: 600;
}

@media screen and (max-width: 1200px) {
	h3.forberries-tiles__title {
		font-size: 25px;
	}

	h4.forberries-tiles__title {
		font-size: 20px;
	}
}

.forberries-tiles--layout-columns.forberries-tiles--no-media .forberries-tiles__tile {
	display: flex;
	flex-direction: column;
}

.forberries-tiles__kicker {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	color: var(--fb-tiles-kicker, #A0B718);
}

.forberries-tiles__kicker-icon {
	display: block;
	flex-shrink: 0;
	width: 26px;
	height: 13px;
	color: inherit;
}

.forberries-tiles__kicker-text {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: inherit;
}

.forberries-tiles__kicker + .forberries-tiles__title {
	margin-top: 10px !important;
}

.forberries-tiles__kicker + .forberries-tiles__text {
	margin-top: 10px;
}

.forberries-tiles__kicker + .forberries-tiles__cta {
	margin-top: 20px;
}

/* Odstęp od ikony tylko gdy jest treść (układ pionowy) */
.forberries-tiles:not(.forberries-tiles--layout-columns)
	.forberries-tiles__media
	+ .forberries-tiles__content
	> .forberries-tiles__kicker:first-child {
	margin-top: 20px;
}

.forberries-tiles:not(.forberries-tiles--layout-columns)
	.forberries-tiles__media
	+ .forberries-tiles__content
	> .forberries-tiles__title:first-child {
	margin-top: 30px !important;
}

.forberries-tiles:not(.forberries-tiles--layout-columns)
	.forberries-tiles__media
	+ .forberries-tiles__content
	> h4.forberries-tiles__title:first-child {
	margin-top: 20px !important;
}

.forberries-tiles:not(.forberries-tiles--layout-columns)
	.forberries-tiles__media
	+ .forberries-tiles__content
	> .forberries-tiles__text:first-child,
.forberries-tiles:not(.forberries-tiles--layout-columns)
	.forberries-tiles__media
	+ .forberries-tiles__content
	> .forberries-tiles__cta:first-child {
	margin-top: 20px;
}

.forberries-tiles__text {
	margin: 0;
	padding: 0;
	flex: 1 1 auto;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	color: #FDFEFF;
}

.forberries-tiles__title + .forberries-tiles__text {
	margin-top: 10px;
}

.forberries-tiles__content:empty {
	display: none;
}

.forberries-tiles__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 0;
	padding-top: 15px;
	border-top: 1px solid #FDFEFF20;
	flex-shrink: 0;
	transition: border-color 0.3s ease;
}

.forberries-tiles__title + .forberries-tiles__cta,
.forberries-tiles__text + .forberries-tiles__cta {
	margin-top: 20px;
}

.forberries-tiles--layout-columns .forberries-tiles__cta {
	margin-top: auto;
}

.forberries-tiles--layout-columns .forberries-tiles__title + .forberries-tiles__cta,
.forberries-tiles--layout-columns .forberries-tiles__text + .forberries-tiles__cta {
	margin-top: auto;
}

.forberries-tiles__tile:hover .forberries-tiles__cta,
.forberries-tiles__tile:focus .forberries-tiles__cta {
	border-top-color: #A0B718;
}

.forberries-tiles__cta-label {
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	color: #A0B718;
}

.forberries-tiles__cta-arrow {
	display: block;
	flex-shrink: 0;
	width: 11px;
	height: 9px;
}

/* Tryb rozciągania: max 1500px, padding 0 3%, równy podział */
.forberries-tiles--stretch {
	width: 100%;
	max-width: 1550px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.forberries-tiles--stretch .forberries-tiles__swiper {
	padding-left: 3%;
	padding-right: 3%;
}

.forberries-tiles--stretch .forberries-tiles__swiper:not(.swiper-initialized) .swiper-wrapper {
	width: 100%;
	justify-content: stretch;
	gap: var(--fb-tiles-gap, 25px);
}

.forberries-tiles--stretch .forberries-tiles__slide {
	width: auto;
	flex: 1 0 275px;
	min-width: 275px;
}

.forberries-tiles--stretch .forberries-tiles__swiper.swiper-initialized .forberries-tiles__slide {
	width: 275px;
	flex: 0 0 auto;
	min-width: 275px;
}

.forberries-tiles--stretch .forberries-tiles__tile {
	width: 100%;
}

@media screen and (max-width: 1000px) {
	.forberries-intro__inner .wp-block-buttons {
		margin-top: 0 !important;
	}
	
	.forberries-tiles--layout-columns.forberries-tiles--columns-middle .forberries-tiles__tile {
		text-align: center;
	}
}

@media screen and (max-width: 700px) {
	.forberries-tiles--layout-columns .forberries-tiles__tile {
		display: flex;
		flex-direction: column;
	}

	.forberries-tiles--layout-columns .forberries-tiles__media {
		width: auto;
	}

	.forberries-tiles--layout-columns .forberries-tiles__icon {
		width: 70px;
		height: 70px;
		aspect-ratio: auto;
	}

	.forberries-tiles--layout-columns
		.forberries-tiles__media
		+ .forberries-tiles__content
		> .forberries-tiles__kicker:first-child,
	.forberries-tiles--layout-columns
		.forberries-tiles__media
		+ .forberries-tiles__content
		> .forberries-tiles__title:first-child,
	.forberries-tiles--layout-columns
		.forberries-tiles__media
		+ .forberries-tiles__content
		> .forberries-tiles__text:first-child,
	.forberries-tiles--layout-columns
		.forberries-tiles__media
		+ .forberries-tiles__content
		> .forberries-tiles__cta:first-child {
		margin-top: 20px !important;
	}
	
}

/* Tryb zawijania: max N w wierszu, dalsze w dół (bez slidera) */
.forberries-tiles--wrap .forberries-tiles__swiper {
	overflow: visible;
	padding: 0 0 0;
	margin: 0 0 00px;
}

.forberries-tiles--wrap .forberries-tiles__swiper .swiper-wrapper,
.forberries-tiles--wrap .forberries-tiles__swiper:not(.swiper-initialized) .swiper-wrapper {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: var(--fb-tiles-gap, 25px);
	width: 100%;
}

.forberries-tiles--wrap .forberries-tiles__slide {
	flex: 0 0 calc(
		(100% - (var(--forberries-tiles-per-row, 4) - 1) * var(--fb-tiles-gap, 25px)) /
			var(--forberries-tiles-per-row, 4)
	);
	width: calc(
		(100% - (var(--forberries-tiles-per-row, 4) - 1) * var(--fb-tiles-gap, 25px)) /
			var(--forberries-tiles-per-row, 4)
	);
	max-width: none;
	margin: 0 !important;
	box-sizing: border-box;
}

.forberries-tiles--wrap .forberries-tiles__tile {
	width: 100%;
}

@media screen and (max-width: 900px) {
	.forberries-tiles--wrap .forberries-tiles__slide {
		flex: 0 1 calc((100% - var(--fb-tiles-gap, 25px)) / 2);
		width: calc((100% - var(--fb-tiles-gap, 25px)) / 2);
		max-width: none;
	}
}

@media screen and (max-width: 600px) {
	.forberries-tiles--wrap .forberries-tiles__slide {
		flex: 0 1 100%;
		width: 100%;
		max-width: none;
	}
}

/* Edytor */
.editor-styles-wrapper .forberries-tiles-editor {
	width: 100%;
}

.editor-styles-wrapper .forberries-tiles__editor-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: var(--fb-tiles-gap, 25px);
}

.editor-styles-wrapper .forberries-tiles__editor-item {
	position: relative;
	width: 275px;
}

.editor-styles-wrapper .forberries-tiles--stretch .forberries-tiles__editor-list {
	flex-wrap: nowrap;
	justify-content: stretch;
	width: 100%;
}

.editor-styles-wrapper .forberries-tiles--stretch .forberries-tiles__editor-item {
	width: auto;
	flex: 1 0 275px;
	min-width: 275px;
}

.editor-styles-wrapper .forberries-tiles--stretch .forberries-tiles__tile {
	width: 100%;
}

.editor-styles-wrapper .forberries-tiles--stretch .forberries-tiles__add-tile {
	width: auto;
	flex: 0 0 100px;
	min-height: 180px;
}

.editor-styles-wrapper .forberries-tiles--wrap .forberries-tiles__editor-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: stretch;
	gap: var(--fb-tiles-gap, 25px);
	width: 100%;
}

.editor-styles-wrapper .forberries-tiles--wrap .forberries-tiles__editor-item {
	flex: 0 0 calc(
		(100% - (var(--forberries-tiles-per-row, 4) - 1) * var(--fb-tiles-gap, 25px)) /
			var(--forberries-tiles-per-row, 4)
	);
	width: calc(
		(100% - (var(--forberries-tiles-per-row, 4) - 1) * var(--fb-tiles-gap, 25px)) /
			var(--forberries-tiles-per-row, 4)
	);
	max-width: none;
	box-sizing: border-box;
}

.editor-styles-wrapper .forberries-tiles--wrap .forberries-tiles__tile {
	width: 100%;
}

.editor-styles-wrapper .forberries-tiles--wrap .forberries-tiles__add-tile {
	flex: 0 0 calc(
		(100% - (var(--forberries-tiles-per-row, 4) - 1) * var(--fb-tiles-gap, 25px)) /
			var(--forberries-tiles-per-row, 4)
	);
	width: calc(
		(100% - (var(--forberries-tiles-per-row, 4) - 1) * var(--fb-tiles-gap, 25px)) /
			var(--forberries-tiles-per-row, 4)
	);
	max-width: none;
	min-height: 180px;
	box-sizing: border-box;
}

.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__empty,
.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__add-tile {
	color: rgba(26, 38, 65, 0.75);
}

.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__add-tile {
	border-color: rgba(26, 38, 65, 0.35);
}

.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__add-tile:hover,
.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__add-tile:focus {
	border-color: #A0B718;
	color: #A0B718;
}

.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__link-hint {
	color: rgba(26, 38, 65, 0.55);
}

.editor-styles-wrapper .forberries-tiles--tile-clear .forberries-tiles__cta--button {
	border-top-color: #1A264133;
}

.editor-styles-wrapper .forberries-tiles__editor-item.is-selected .forberries-tiles__tile {
	outline: 2px solid #A0B718;
	outline-offset: 3px;
}

.editor-styles-wrapper .forberries-tiles__editor-toolbar {
	position: absolute;
	top: -42px;
	left: 50%;
	z-index: 5;
	transform: translateX(-50%);
	background: #fff;
	border: 1px solid #1e1e1e;
	border-radius: 2px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.editor-styles-wrapper .forberries-tiles__editor-toolbar .components-toolbar-group {
	border: 0;
}

.editor-styles-wrapper .forberries-tiles__icon--button {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	text-align: inherit;
}

.editor-styles-wrapper .forberries-tiles__icon--button:hover,
.editor-styles-wrapper .forberries-tiles__icon--button:focus {
	outline: 2px solid #A0B718;
	outline-offset: 2px;
}

.editor-styles-wrapper .forberries-tiles__cta--button {
	appearance: none;
	width: 100%;
	border: 0;
	border-top: 1px solid #FDFEFF;
	background: transparent;
	cursor: pointer;
	font: inherit;
	text-align: left;
}

.editor-styles-wrapper .forberries-tiles__cta--button:hover,
.editor-styles-wrapper .forberries-tiles__cta--button:focus {
	opacity: 0.9;
}

.editor-styles-wrapper .forberries-tiles__link-hint {
	display: block;
	margin-top: 8px;
	overflow: hidden;
	font-size: 11px;
	line-height: 1.3;
	color: rgba(253, 254, 255, 0.55);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.editor-styles-wrapper .forberries-tiles__add-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 270px;
	min-height: 220px;
	padding: 15px;
	border: 2px dashed rgba(253, 254, 255, 0.35);
	border-radius: 22px;
	background: transparent;
	color: rgba(253, 254, 255, 0.8);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.editor-styles-wrapper .forberries-tiles__add-tile:hover,
.editor-styles-wrapper .forberries-tiles__add-tile:focus {
	border-color: #A0B718;
	color: #A0B718;
	outline: none;
}

.editor-styles-wrapper .forberries-tiles__add-tile-plus {
	font-size: 32px;
	line-height: 1;
	font-weight: 400;
}

.editor-styles-wrapper .forberries-tiles__empty-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 24px;
}

.editor-styles-wrapper .forberries-tiles__empty {
	margin: 0;
	text-align: center;
	color: rgba(253, 254, 255, 0.7);
}

.editor-styles-wrapper .forberries-tiles__sidebar-hint {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: #757575;
}

.editor-styles-wrapper .forberries-tiles__title.rich-text,
.editor-styles-wrapper .forberries-tiles__text.rich-text {
	min-height: 1.2em;
}
