/*
 * RR Group – bazowy CSS frontu.
 * Tylko układ i czytelność. Kolory, fonty, przyciski i zaokrąglenia dziedziczone
 * z Elementora (Global Colors / Global Fonts) lub motywu. Nadpisuj przez zmienne:
 *
 *   --rrg-accent, --rrg-text, --rrg-muted, --rrg-border, --rrg-bg-soft,
 *   --rrg-gap, --rrg-radius, --rrg-columns
 *
 * Można wyłączyć w Panel → Ustawienia → "Ładuj bazowy CSS".
 */

:where(.rrg-catalog, .rrg-product, .rrg-add-to-inquiry, .rrg-inquiry, .rrg-price-table-wrap, .rrg-gallery-public, .rrg-inquiry-count) {
	--rrg-accent: var(--e-global-color-accent, var(--e-global-color-primary, currentColor));
	--rrg-on-accent: var(--rrg-on-accent-color, #fff); /* kolor tekstu na tle akcentu – ustaw --rrg-on-accent-color w motywie */
	--rrg-text: var(--e-global-color-text, inherit);
	--rrg-muted: color-mix(in srgb, currentColor 60%, transparent);
	--rrg-border: color-mix(in srgb, currentColor 15%, transparent);
	--rrg-bg-soft: color-mix(in srgb, currentColor 4%, transparent);
	--rrg-gap: 1.5rem;
	--rrg-radius: 0;
}

/* Katalog */
:where(.rrg-catalog__filter) {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: var(--rrg-gap);
}
:where(.rrg-catalog__filter-item) {
	padding: .35em .9em;
	border: 1px solid var(--rrg-border);
	border-radius: var(--rrg-radius);
	text-decoration: none;
}
:where(.rrg-catalog__filter-item.is-active) {
	border-color: var(--rrg-accent);
	background: var(--rrg-accent);
	color: var(--rrg-on-accent);
}
/* Kolumny: --rrg-columns (np. z widżetu Elementora) ma pierwszeństwo,
   w przeciwnym razie atrybut columns (desktop) + automatyczne 2/1 kolumny. */
:where(.rrg-catalog) { --rrg-cols: var(--rrg-columns-desktop, 3); }
@media (max-width: 1024px) { :where(.rrg-catalog) { --rrg-cols: min(var(--rrg-columns-desktop, 3), 2); } }
@media (max-width: 600px) { :where(.rrg-catalog) { --rrg-cols: 1; } }
.rrg-catalog__grid {
	display: grid;
	grid-template-columns: repeat(var(--rrg-columns, var(--rrg-cols)), minmax(0, 1fr));
	gap: var(--rrg-gap);
}
:where(.rrg-catalog__pagination) {
	display: flex;
	gap: .5rem;
	justify-content: center;
	margin-top: var(--rrg-gap);
}
:where(.rrg-catalog__page) {
	padding: .3em .8em;
	border: 1px solid var(--rrg-border);
	text-decoration: none;
}
:where(.rrg-catalog__page.is-active) { border-color: var(--rrg-accent); background: var(--rrg-accent); color: var(--rrg-on-accent); }

/* Karta produktu */
.rrg-product-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}
:where(.rrg-product-card) { border: 1px solid var(--rrg-border); border-radius: var(--rrg-radius); }
.rrg-product-card .rrg-product-image {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}
.rrg-product-card .rrg-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
:where(.rrg-product-image__placeholder) {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--rrg-bg-soft);
}
.rrg-product-card__body {
	display: flex;
	flex-direction: column;
	gap: .4rem;
	flex: 1;
}
:where(.rrg-product-card__body) { padding: 1rem; }
:where(.rrg-product-category) { font-size: .8em; color: var(--rrg-muted); text-transform: uppercase; letter-spacing: .04em; }
:where(.rrg-product-title) { margin: 0; font-size: 1.1em; }
:where(.rrg-product-title a) { color: inherit; text-decoration: none; }
:where(.rrg-product-price__amount) { font-weight: 700; }
:where(.rrg-product-price__prefix, .rrg-product-price__suffix, .rrg-product-price__unit) { font-size: .85em; color: var(--rrg-muted); }
.rrg-product-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: auto;
	padding-top: .5rem;
}

/* Przyciski – tylko gdy motyw/Elementor nic nie ustawia. */
:where(.rrg-product-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .6em 1.1em;
	border: 1px solid var(--rrg-accent);
	background: var(--rrg-accent);
	color: var(--rrg-on-accent);
	border-radius: var(--rrg-radius);
	cursor: pointer;
	text-decoration: none;
	font: inherit;
	line-height: 1.2;
}
:where(.rrg-product-button--secondary) { background: transparent; color: inherit; }
:where(.rrg-product-button[disabled]) { opacity: .6; cursor: wait; }

/* Tabela cen */
:where(.rrg-price-table) { width: 100%; border-collapse: collapse; }
:where(.rrg-price-table th, .rrg-price-table td) { padding: .5em .75em; border-bottom: 1px solid var(--rrg-border); text-align: left; }
:where(.rrg-price-table td + td, .rrg-price-table th + th) { text-align: right; }
.rrg-price-table tr.is-unavailable { opacity: .5; }
:where(.rrg-price-table__note) { font-size: .85em; color: var(--rrg-muted); }

/* Dodaj do zapytania */
.rrg-add-to-inquiry {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1rem;
	margin-top: var(--rrg-gap, 1.5rem);
}
.rrg-add-to-inquiry .rrg-field { display: flex; flex-direction: column; gap: .25rem; }
.rrg-add-to-inquiry input[type="number"] { max-width: 8em; }
.rrg-add-to-inquiry__estimate { flex-basis: 100%; font-size: .9em; color: var(--rrg-muted); }
.rrg-add-to-inquiry__estimate:empty { display: none; }
.rrg-add-to-inquiry .rrg-message { flex-basis: 100%; }

/* Komunikaty */
.rrg-message:empty { display: none; }
:where(.rrg-message) { font-size: .9em; }
:where(.rrg-message--success) { color: #1a7f37; }
:where(.rrg-message--error) { color: #c62828; }
:where(.rrg-message__link) { font-weight: 600; }

/* Galeria */
.rrg-gallery-public__main img { width: 100%; height: auto; display: block; }
.rrg-gallery-public__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	list-style: none;
	margin: .5rem 0 0;
	padding: 0;
}
.rrg-gallery-public__thumb {
	padding: 0;
	border: 2px solid transparent;
	background: none;
	cursor: pointer;
	width: 72px;
	line-height: 0;
}
.rrg-gallery-public__thumb img { width: 100%; height: auto; }
.rrg-gallery-public__thumb.is-active { border-color: var(--rrg-accent); }

/* Zapytanie */
.rrg-inquiry { display: flex; flex-direction: column; gap: var(--rrg-gap); }
.rrg-inquiry__items.is-loading { opacity: .5; pointer-events: none; }
:where(.rrg-inquiry-table) { width: 100%; border-collapse: collapse; }
:where(.rrg-inquiry-table th, .rrg-inquiry-table td) { padding: .6em .5em; border-bottom: 1px solid var(--rrg-border); text-align: left; vertical-align: middle; }
.rrg-inquiry-item__product { display: flex; gap: .75rem; align-items: center; }
.rrg-inquiry-item__image img { width: 56px; height: 56px; object-fit: cover; display: block; }
.rrg-inquiry-item__qty input { width: 6.5em; }
:where(.rrg-inquiry-item__remove) { background: none; border: 0; font-size: 1.4em; line-height: 1; cursor: pointer; color: var(--rrg-muted); }
:where(.rrg-inquiry-item__variants) { color: var(--rrg-muted); }
:where(.rrg-inquiry-table__total) { font-size: 1.1em; }
.rrg-inquiry__form { display: flex; flex-direction: column; gap: var(--rrg-gap); }
.rrg-inquiry__form[hidden] { display: none; }
:where(.rrg-inquiry__section) { border: 0; padding: 0; margin: 0; }
:where(.rrg-inquiry__heading) { font-size: 1.15em; font-weight: 600; margin-bottom: .75rem; padding: 0; }
.rrg-inquiry__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.rrg-inquiry__fields .rrg-field { display: flex; flex-direction: column; gap: .25rem; }
.rrg-inquiry__fields .rrg-field--wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .rrg-inquiry__fields { grid-template-columns: minmax(0, 1fr); } }
.rrg-inquiry .rrg-field input:not([type="checkbox"]):not([type="radio"]),
.rrg-inquiry .rrg-field textarea { width: 100%; box-sizing: border-box; }
.rrg-check, .rrg-radio { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .6rem; cursor: pointer; }
.rrg-check input, .rrg-radio input { margin-top: .25em; flex: none; }
:where(.rrg-inquiry__disclaimer) { padding: 1rem 1.25rem; border-left: 3px solid var(--rrg-accent); background: var(--rrg-bg-soft); font-weight: 600; }
:where(.rrg-inquiry__disclaimer p) { margin: 0; }
:where(.rrg-inquiry__fee) { white-space: nowrap; }
.rrg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
:where(.rrg-inquiry__success) { padding: 1.5rem; border: 1px solid var(--rrg-border); }
:where(.rrg-inquiry__number) { font-size: 1.3em; }

.rrg-inquiry-count { text-decoration: none; }
:where(.rrg-inquiry-count__number) {
	display: inline-flex;
	min-width: 1.5em;
	height: 1.5em;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--rrg-accent);
	color: var(--rrg-on-accent);
	font-size: .8em;
	padding: 0 .35em;
}

.rrg-elementor-placeholder { padding: 1rem; border: 1px dashed currentColor; opacity: .6; text-align: center; }

/* Menu pracownika w stopce ([rrg_staff_menu]) – kontener widżetu "znika" z układu,
   więc menu jest bezpośrednim elementem kontenera kolumn, a dla gości nie zostawia pustego miejsca. */
.elementor-widget:has(.rrg-staff-menu-slot),
.elementor-widget:has(.rrg-staff-menu-slot) > .elementor-widget-container,
.elementor-shortcode:has(.rrg-staff-menu-slot) { display: contents; }
/* Pasek pracownika: pełna szerokość pod kolumnami stopki, linki w jednym wierszu. */
.rrg-footer-bar.rrg-footer-bar {
	flex: 1 1 100%;
	max-width: 100%;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 1.25em;
	row-gap: .5em;
	padding: 1em 0 0;
	margin-top: .25em;
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.rrg-footer-bar > p:first-child { margin-right: .5em; }
.rrg-footer-bar .is-active a { text-decoration: underline; text-underline-offset: .25em; }
.rrg-catalog-menu__count[hidden] { display: none; }
/* Dwa paski pod rząd – bez podwójnej linii. */
.elementor-widget:has(.rrg-staff-menu-slot) + .elementor-widget:has(.rrg-staff-menu-slot) .rrg-footer-bar { border-top: 0; padding-top: .25em; }
:where(.rrg-staff-menu__badge) {
	display: inline-flex;
	min-width: 1.5em;
	height: 1.5em;
	align-items: center;
	justify-content: center;
	margin-left: .3em;
	padding: 0 .35em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: .75em;
	line-height: 1;
	vertical-align: middle;
}
:where(.rrg-staff-menu__logout) { opacity: .7; }
/* ---------- Dymek RR-Bota (jak na errorstudio.pl) ---------- */
@keyframes rrgBotPop {
	0% { opacity: 0; transform: translateY(10px) scale(.92); }
	70% { opacity: 1; transform: translateY(-2px) scale(1.02); }
	100% { opacity: 1; transform: none; }
}
.rrg-botbubble {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 26rem;
	padding: 1rem 1.25rem 1.1rem;
	background: #fff;
	color: #5f5f5f;
	border-radius: 20px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
	font-family: var(--e-global-typography-text-font-family, "Lato"), sans-serif;
	font-size: 1rem;
	line-height: 1.45;
	text-align: left;
	transform-origin: 50% 100%;
	animation: rrgBotPop .6s .4s both;
	transition: opacity .16s ease;
}
/* Ogonek skierowany w dół, na maskotkę. */
.rrg-botbubble::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -9px;
	width: 20px;
	height: 20px;
	margin-left: -10px;
	background: #fff;
	border-radius: 3px;
	transform: rotate(45deg);
}
.rrg-botbubble.is-changing { opacity: 0; }
.rrg-botbubble.is-popping { animation: rrgBotPop .45s both; }
.rrg-botbubble__title { margin: 0; font-family: var(--e-global-typography-primary-font-family, "Baloo 2"), sans-serif; font-style: normal; font-weight: 600; font-size: 1rem; line-height: 1.3; color: #000; }
.rrg-botbubble__title b, .rrg-botbubble__title strong { font-weight: 700; }
.rrg-botbubble__text { margin: .3rem 0 0; font-size: .875rem; line-height: 1.5; color: #5f5f5f; }
.rrg-botbubble__actions { display: flex; align-items: center; gap: .5rem; margin-top: .9rem; }
html body .rrg-botbubble__btn {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .625rem 1.25rem; border: 0; border-radius: 999px;
	background: var(--e-global-color-accent, #C4D62B); color: #000;
	font-family: var(--e-global-typography-primary-font-family, "Baloo 2"), sans-serif; font-weight: 600; font-size: 1rem; line-height: 1.2;
	text-decoration: none; transition: background-color .2s, color .2s, transform .2s;
}
html body .rrg-botbubble__btn:hover { background: #000; color: var(--e-global-color-accent, #C4D62B); transform: translateY(-1px); }
.rrg-botbubble__btn[hidden] { display: none; }
.rrg-botbubble__icon { width: 14px; height: 14px; flex: 0 0 auto; }
html body .rrg-botbubble__next {
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.4rem; height: 2.4rem; min-height: 0; padding: 0; margin-left: auto;
	border: 1px solid #e5e5e5; border-radius: 999px; background: #f4f4f5; color: #000;
	font-size: 1.1rem; line-height: 1; cursor: pointer; transition: background-color .2s, transform .3s;
}
html body .rrg-botbubble__next:hover { background: var(--e-global-color-accent, #C4D62B); transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
	.rrg-botbubble, .rrg-botbubble.is-popping { animation: none; }
}
html body .rrg-botbubble .rrg-botbubble__title { margin: 0; }
html body .rrg-botbubble .rrg-botbubble__text { margin: .3rem 0 0; }
