/* =============================================================================
   Alfagaz – Fejléc gombok: Fiók + Kosár
   Desktop: hover dropdown  |  Mobil (≤768px): side cart
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Search row in header
   ----------------------------------------------------------------------------- */

   header .et_pb_searchform > div {
	height: 28px;
	}

/* -----------------------------------------------------------------------------
   Fiók / Belépés gomb  [alfagaz_account_button]
   ----------------------------------------------------------------------------- */

.alfagaz-account-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: inherit;
	white-space: nowrap;
	line-height: 1;
}

.alfagaz-account-btn:hover,
.alfagaz-account-btn:focus {
	text-decoration: none;
	color: inherit;
	opacity: .85;
}

.alfagaz-account-icon-wrap {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

/* Eredeti méret, semmi átméretezés */
.alfagaz-account-icon-wrap img.alfagaz-account-icon {
	display: block;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
}

.alfagaz-account-label {
	white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Kosár gomb  [alfagaz_cart_button]
   ----------------------------------------------------------------------------- */

.alfagaz-cart-wrap {
	position: relative;
	display: inline-block;
}

.alfagaz-cart-btn {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	line-height: 1;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.alfagaz-cart-btn:hover,
.alfagaz-cart-btn:focus {
	text-decoration: none;
	color: inherit;
	outline: none;
}

/* Ikon + lebegő badge együtt */
.alfagaz-cart-icon-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* PNG ikon */
.alfagaz-cart-icon-img {
	display: block;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
}

/* SVG fallback */
.alfagaz-cart-icon-wrap > svg {
	display: block;
}

/* Lebegő badge – jobb felső sarokba */
.alfagaz-cart-count {
	position: absolute;
	top: -2px;
	right: -7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: .68em;
	font-weight: 600;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: #c0392b;
	color: #fff;
	border-radius: 4px;
	line-height: 1;
	pointer-events: none;
}

.alfagaz-cart-count[data-count="0"] {
	background: #bbb;
	display: none;
}

/* =============================================================================
   DESKTOP: hover dropdown (CSS :hover – nincs JS szükség)
   ============================================================================= */

.alfagaz-cart-dropdown {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 9999;
	min-width: 300px;
	max-width: 380px;
	width: max-content;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
	pointer-events: none;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease;
	padding: 16px;
}

/* Kis nyíl a dropdown tetején */
.alfagaz-cart-dropdown::before {
	content: '';
	position: absolute;
	top: -7px;
	right: 14px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-left: 1px solid #e2e2e2;
	border-top: 1px solid #e2e2e2;
	transform: rotate(45deg);
}

/* CSS hover (azonnali nyitás) + JS dropdown-open osztály (késleltetett zárás) */
.alfagaz-cart-wrap:hover .alfagaz-cart-dropdown,
.alfagaz-cart-wrap.dropdown-open .alfagaz-cart-dropdown {
	pointer-events: auto;
	opacity: 1;
	transform: translateY(0);
}

/* A mobil panel legyen rejtve desktopon */
.alfagaz-side-cart,
.alfagaz-side-cart-overlay {
	display: none;
}

/* =============================================================================
   WooCommerce mini-cart sablon stílusa a dropdown-ban
   ----------------------------------------------------------------------------- */

/* Görgethetőség */
.alfagaz-cart-dropdown .woocommerce-mini-cart {
	max-height: 320px;
	overflow-y: auto;
	overflow-x: hidden;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.alfagaz-cart-dropdown .woocommerce-mini-cart__empty-message {
	color: #999;
	font-size: .88em;
	text-align: center;
	padding: 16px 0;
	margin: 0;
}

/* Cart item */
.alfagaz-cart-dropdown .woocommerce-mini-cart-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 8px 0;
	border-bottom: 1px solid #f2f2f2;
}

.alfagaz-cart-dropdown .woocommerce-mini-cart-item:last-child {
	border-bottom: none;
}

.alfagaz-cart-dropdown .woocommerce-mini-cart-item img {
	width: 52px;
	height: 52px;
	object-fit: contain;
	border-radius: 4px;
	border: 1px solid #ebebeb;
	flex-shrink: 0;
}

.alfagaz-cart-dropdown .woocommerce-mini-cart-item .remove_from_cart_button {
	display: none; /* dropdown-ban nem mutatjuk az eltávolítás gombot */
}

/* Összesítő sor */
.alfagaz-cart-dropdown .woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: .9em;
	padding-top: 10px;
	border-top: 2px solid #f0f0f0;
	margin: 0 0 12px;
}

.alfagaz-cart-dropdown .woocommerce-mini-cart__total .woocommerce-Price-amount {
	color: #c0392b;
	font-weight: 700;
}

/* Kosár / Pénztár gombok */
.alfagaz-cart-dropdown .wc-mini-cart__buttons,
.alfagaz-cart-dropdown .woocommerce-mini-cart__buttons {
	display: flex;
	gap: 8px;
}

.alfagaz-cart-dropdown .wc-mini-cart__buttons .button,
.alfagaz-cart-dropdown .woocommerce-mini-cart__buttons .button {
	flex: 1;
	text-align: center;
	padding: 8px 10px;
	border-radius: 4px;
	font-size: .8em;
	font-weight: 700;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
	display: block;
}

/* Első gomb (Kosár megtekintése) */
.alfagaz-cart-dropdown .wc-mini-cart__buttons .button:not(.checkout),
.alfagaz-cart-dropdown .woocommerce-mini-cart__buttons .button:not(.checkout) {
	background: #efefef;
	color: #333;
}

.alfagaz-cart-dropdown .wc-mini-cart__buttons .button:not(.checkout):hover,
.alfagaz-cart-dropdown .woocommerce-mini-cart__buttons .button:not(.checkout):hover {
	background: #e0e0e0;
}

/* Pénztár gomb */
.alfagaz-cart-dropdown .wc-mini-cart__buttons .checkout,
.alfagaz-cart-dropdown .woocommerce-mini-cart__buttons .checkout {
	background: #c0392b;
	color: #fff;
}

.alfagaz-cart-dropdown .wc-mini-cart__buttons .checkout:hover,
.alfagaz-cart-dropdown .woocommerce-mini-cart__buttons .checkout:hover {
	background: #a93226;
	color: #fff;
}

/* =============================================================================
   MOBIL (≤768px): side cart
   ============================================================================= */

@media (max-width: 768px) {

	/* Desktop dropdownt elrejtjük mobilon */
	.alfagaz-cart-dropdown {
		display: none !important;
	}

	/* Overlay */
	.alfagaz-side-cart-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, .5);
		z-index: 10000;
		opacity: 0;
		pointer-events: none;
		transition: opacity .25s ease;
	}

	.alfagaz-side-cart-overlay.is-visible {
		opacity: 1;
		pointer-events: auto;
	}

	/* Side cart panel */
	.alfagaz-side-cart {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(340px, 90vw);
		background: #fff;
		z-index: 10001;
		transform: translateX(100%);
		transition: transform .28s cubic-bezier(.4, 0, .2, 1);
		box-shadow: -4px 0 24px rgba(0, 0, 0, .18);
	}

	.alfagaz-side-cart.is-open {
		transform: translateX(0);
	}

	/* Fejléc */
	.alfagaz-side-cart-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 20px;
		border-bottom: 1px solid #ebebeb;
		flex-shrink: 0;
	}

	.alfagaz-side-cart-title {
		font-size: 1em;
		font-weight: 700;
		color: #222;
	}

	.alfagaz-side-cart-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background: none;
		border: none;
		cursor: pointer;
		padding: 4px;
		color: #555;
		border-radius: 4px;
		transition: color .15s, background .15s;
		line-height: 1;
	}

	.alfagaz-side-cart-close:hover {
		color: #c0392b;
		background: #fdf0ee;
	}

	/* Görgethetőség */
	.alfagaz-side-cart-body {
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
		padding: 16px 20px;
	}

	/* WC mini-cart stílusa a side cart-ban */
	.alfagaz-side-cart-body .woocommerce-mini-cart {
		margin: 0 0 16px;
		padding: 0;
		list-style: none;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart__empty-message {
		color: #999;
		font-size: .9em;
		text-align: center;
		padding: 24px 0;
		margin: 0;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart-item {
		display: flex;
		gap: 12px;
		align-items: flex-start;
		padding: 10px 0;
		border-bottom: 1px solid #f2f2f2;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart-item:last-child {
		border-bottom: none;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart-item img {
		width: 60px;
		height: 60px;
		object-fit: contain;
		border-radius: 4px;
		border: 1px solid #ebebeb;
		flex-shrink: 0;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart-item .remove_from_cart_button {
		display: inline-block;
		color: #aaa;
		font-size: 1.1em;
		text-decoration: none;
		margin-left: auto;
		padding: 0 4px;
		flex-shrink: 0;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart-item .remove_from_cart_button:hover {
		color: #c0392b;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart__total {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: .95em;
		padding: 12px 0;
		border-top: 2px solid #f0f0f0;
		margin: 0 0 12px;
	}

	.alfagaz-side-cart-body .woocommerce-mini-cart__total .woocommerce-Price-amount {
		color: #c0392b;
		font-weight: 700;
	}

	.alfagaz-side-cart-body .wc-mini-cart__buttons,
	.alfagaz-side-cart-body .woocommerce-mini-cart__buttons {
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.alfagaz-side-cart-body .wc-mini-cart__buttons .button,
	.alfagaz-side-cart-body .woocommerce-mini-cart__buttons .button {
		display: block;
		text-align: center;
		padding: 12px;
		border-radius: 5px;
		font-size: .88em;
		font-weight: 700;
		text-decoration: none;
		transition: background .15s ease;
	}

	.alfagaz-side-cart-body .wc-mini-cart__buttons .button:not(.checkout),
	.alfagaz-side-cart-body .woocommerce-mini-cart__buttons .button:not(.checkout) {
		background: #efefef;
		color: #333;
	}

	.alfagaz-side-cart-body .wc-mini-cart__buttons .button:not(.checkout):hover,
	.alfagaz-side-cart-body .woocommerce-mini-cart__buttons .button:not(.checkout):hover {
		background: #e0e0e0;
	}

	.alfagaz-side-cart-body .wc-mini-cart__buttons .checkout,
	.alfagaz-side-cart-body .woocommerce-mini-cart__buttons .checkout {
		background: #c0392b;
		color: #fff;
	}

	.alfagaz-side-cart-body .wc-mini-cart__buttons .checkout:hover,
	.alfagaz-side-cart-body .woocommerce-mini-cart__buttons .checkout:hover {
		background: #a93226;
		color: #fff;
	}
}

/* Body scroll lock (JS rakja rá) */
body.alfagaz-side-cart-open {
	overflow: hidden;
}
