/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Author: Brainstorm Force
Author URI: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
Description: Astra Child Theme z własnym layoutem wpisów blogowych (przepisy) i panelem produktów WooCommerce po prawej stronie, zasilanym przez ACF.
Version: 2.5.0
*/

/* =========================================================
   RECIPE POST LAYOUT
   Dwukolumnowy układ wpisu: treść (70%) + produkty (30%).
   Aktywny tylko na single.php dla wpisów typu "post".
   ========================================================= */

.recipe-post-layout {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
	gap: 48px;
	align-items: start;
	width: 100%;
}

/* Brak przypisanych produktów - treść na pełną szerokość. */
.recipe-post-layout.no-products {
	grid-template-columns: 1fr;
}

.recipe-post-content {
	min-width: 0; /* zabezpieczenie przed rozpychaniem grida przez długie słowa/obrazki */
}

/* Obrazek wyróżniający wpisu */
.recipe-post-thumbnail {
	margin: 0 0 28px;
}

.recipe-post-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 16px;
}

/* =========================================================
   PANEL PRODUKTÓW (prawa kolumna)
   ========================================================= */

.recipe-post-products {
	position: sticky;
	/* Strona ma własny przyklejony (sticky) nagłówek zrobiony w Elementorze
	   (ok. 120px wysokości) - panel produktów musi zaczynać się PONIŻEJ
	   niego, inaczej chowa się pod nim podczas scrolla. */
	top: 136px;
	align-self: start;
}

/* Gdy jesteś zalogowany, WordPress dokłada u góry pasek admina (32px) -
   trzeba o tyle więcej odsunąć panel, żeby nie chował się i pod nim. */
body.admin-bar .recipe-post-products {
	top: 168px;
}

.recipe-post-products-inner {
	width: 100%;
	background: #faf8f6;
	border: 1px solid #eee;
	border-radius: 20px;
	padding: 28px;
	box-sizing: border-box;
}

.recipe-products-title {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 12px;
}

.recipe-products-description {
	font-size: 14px;
	color: #666;
	line-height: 1.6;
	margin: 0 0 26px;
}

/* =========================================================
   KARTA PRODUKTU
   ========================================================= */

.recipe-product {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 16px;
	padding: 24px;
	width: 100%;
	margin: 0 0 20px;
	text-align: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recipe-post-products-inner .recipe-product:last-child {
	margin-bottom: 0;
}

.recipe-product:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

/* Zdjęcie produktu */
.recipe-product-image {
	display: block;
	margin-bottom: 16px;
}

.recipe-product-image img {
	display: block;
	width: 100%;
	max-width: 180px;
	height: auto;
	margin: 0 auto;
}

/* Tytuł produktu */
.recipe-product-title {
	font-size: 18px;
	line-height: 1.35;
	margin: 0 0 12px;
	font-weight: 700;
}

.recipe-product-title a {
	color: #222;
	text-decoration: none;
}

.recipe-product-title a:hover,
.recipe-product-title a:focus {
	color: #8b0000;
}

/* Cena */
.recipe-product-price {
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 18px;
	color: #222;
	line-height: 1;
}

.recipe-product-price del {
	font-size: 16px;
	font-weight: 400;
	color: #999;
	opacity: 1;
	margin-right: 8px;
	text-decoration: line-through;
}

.recipe-product-price ins {
	text-decoration: none;
}

/* =========================================================
   PRZYCISK „DODAJ DO KOSZYKA”
   Reset stylów WooCommerce/Astry, żeby tekst i ewentualny
   spinner ładowania AJAX były zawsze idealnie wyśrodkowane.
   ========================================================= */

.recipe-product-button {
	width: 100%;
}

/* Astra doklleja własne style do wrappera WooCommerce
   (<p class="product woocommerce add_to_cart_inline">) - padding i
   margin z tamtych reguł mają wyższą specyficzność niż nasze, więc
   trzeba je jawnie wyzerować z !important, żeby przycisk był naprawdę
   na pełną szerokość karty. */
.recipe-product-button p.add_to_cart_inline,
.recipe-product-button p.product {
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	display: block !important;
}

.recipe-product-button a.button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100% !important;
	min-height: 50px;
	margin: 0 !important;
	padding: 0 20px;
	border: none;
	border-radius: 10px;
	background: #8b0000;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.2px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	box-sizing: border-box;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.recipe-product-button a.button:hover,
.recipe-product-button a.button:focus {
	background: #6e0000;
	color: #fff;
	transform: translateY(-1px);
}

/* Spinner AJAX WooCommerce - wyśrodkowany, nie rozjeżdża tekstu */
.recipe-product-button a.button.loading::after {
	content: "";
	width: 14px;
	height: 14px;
	margin-left: 4px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: recipe-btn-spin 0.6s linear infinite;
}

@keyframes recipe-btn-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Komunikat „Dodano do koszyka” pod przyciskiem */
.recipe-product-button .added_to_cart {
	display: block;
	margin-top: 10px;
	font-size: 13px;
	text-align: center;
	color: #8b0000;
}

/* =========================================================
   MOBILE / TABLET
   Poniżej 921px (breakpoint Astry dla tabletów) kolumny
   przechodzą jedna pod drugą, panel produktów przestaje
   być sticky.
   ========================================================= */

@media (max-width: 921px) {
	.recipe-post-layout {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.recipe-post-products {
		position: static;
		top: auto;
	}

	.recipe-post-products-inner {
		max-width: 460px;
		margin: 0 auto;
	}
}