/* Etik Bakkal Çekirdek — mobilde alt sepet çubuğu. Masaüstünde gösterilmez (sabit başlıkta sepet var). */

.etik-cartbar {
	display: none;
}

@media (max-width: 849px) {
	.etik-cartbar:not([hidden]) {
		display: block;
		position: fixed;
		left: 8px;
		right: 8px;
		bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		z-index: 990; /* Sayfa içeriğinin üstünde, temanın açılır panellerinin (1000+) altında. */
		overflow: hidden;
		border-radius: 14px;
		background: #fff;
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
		animation: etik-cartbar-in 0.22s ease-out;
	}

	/* Çubuk sayfanın son satırlarını ve alt bilgiyi örtmesin. */
	body.etik-has-cartbar {
		padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
	}

	/* Ürün sayfasında ürünün kendi alt çubuğu açıkken sepet çubuğu çekilir (o çubukta sepet simgesi var). */
	body.etik-pdp-bar-on .etik-cartbar {
		display: none !important;
	}

	/* Alt boşluk ürün çubuğununki kadar olsun (product.css: 72px). */
	body.etik-pdp-bar-on.etik-has-cartbar {
		padding-bottom: 72px;
	}

	/* WhatsApp düğmesi çubuğun üstüne çıkar. */
	body.etik-has-cartbar:not(.etik-pdp-bar-on) .wa__btn_popup {
		bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
		transition: bottom 0.22s ease-out;
	}

	body.etik-has-cartbar:not(.etik-pdp-bar-on) .wa__popup_chat_box {
		bottom: calc(172px + env(safe-area-inset-bottom, 0px)) !important;
	}
}

.etik-cartbar__progress {
	position: relative;
	padding: 7px 14px 6px;
	background: #f3f7ec;
	font-size: 13px;
	line-height: 1.3;
	color: #2f4a00;
	text-align: center;
}

.etik-cartbar__progress.is-done {
	background: #e8f3d6;
}

.etik-cartbar__bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(77, 119, 1, 0.15);
}

.etik-cartbar__bar > span {
	display: block;
	height: 100%;
	background: #4d7701;
	transition: width 0.3s ease-out;
}

.etik-cartbar__link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	padding: 8px 8px 8px 14px;
	color: #1d2433;
	text-decoration: none;
}

.etik-cartbar__link:hover,
.etik-cartbar__link:focus {
	color: #1d2433;
}

.etik-cartbar__link:focus-visible {
	outline: 2px solid #4d7701;
	outline-offset: -4px;
	border-radius: 12px;
}

.etik-cartbar__icon {
	position: relative;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
}

.etik-cartbar__icon svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.etik-cartbar__count {
	position: absolute;
	top: -7px;
	right: -9px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border: 2px solid #fff;
	border-radius: 99px;
	background: var(--etik-orange, #f58300);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.etik-cartbar__sum {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}

.etik-cartbar__label {
	font-size: 13px;
	color: #4b5563;
}

.etik-cartbar__total {
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.etik-cartbar__go {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	height: 44px;
	padding: 0 16px;
	border-radius: 10px;
	background: #4d7701;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
}

.etik-cartbar__go svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.etik-cartbar.is-bump .etik-cartbar__count {
	animation: etik-cartbar-bump 0.35s ease-out;
}

/* Masaüstü başlıkta sepet: tutar ve simge tek bir düğme olarak okunur. Sepet boşken
   ("₺0,00") tutar ve zemin gizlenir, yalnızca simge kalır. */
@media (min-width: 850px) {
	.header-main .cart-item .header-cart-link {
		gap: 8px;
		height: 40px;
		margin: 0;
		padding: 0 14px 0 16px;
		border-radius: var(--etik-btn-radius, 10px); /* Sitedeki düğmelerle aynı köşe. */
		background: #f1f6e8;
		color: #2f4a00 !important; /* Temanın menü bağlantı renkleri (hover'da beyaz) ezmesin. */
		transition: background-color 0.15s;
	}

	.header-main .cart-item .header-cart-link:hover,
	.header-main .cart-item.current-dropdown .header-cart-link {
		background: #e3eed0;
	}

	.header-main .cart-item .header-cart-link:focus-visible {
		outline: 2px solid #4d7701;
		outline-offset: 2px;
	}

	.header-main .cart-item .header-cart-title {
		margin: 0;
		font-size: 15px;
		font-weight: 600;
		line-height: 1;
		letter-spacing: 0;
		color: inherit;
		font-variant-numeric: tabular-nums;
	}

	.header-main .cart-item .header-cart-title,
	.header-main .cart-item .header-cart-title .amount {
		color: #2f4a00 !important;
	}

	.header-main .cart-item .header-cart-link i {
		color: #4d7701 !important;
	}

	.header-main .cart-item .header-cart-link:has(i[data-icon-label="0"]) i {
		color: inherit !important;
	}

	.header-main .cart-item .header-cart-link:has(i[data-icon-label="0"]) {
		color: inherit !important;
	}

	.header-main .cart-item .header-cart-link:has(i[data-icon-label="0"]) {
		padding: 0 10px;
		background: transparent;
	}

	.header-main .cart-item .header-cart-link:has(i[data-icon-label="0"]) .header-cart-title {
		display: none;
	}
}

/* Ürün sayfasının alt çubuğundaki sepet simgesi. */
.etik-pdp-bar__cart {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid #e4e4e4;
	border-radius: 10px;
	color: #1d2433;
}

.etik-pdp-bar__cart[hidden] {
	display: none;
}

.etik-pdp-bar__cart:focus-visible {
	outline: 2px solid #4d7701;
	outline-offset: 2px;
}

.etik-pdp-bar__cart svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.etik-pdp-bar__count {
	position: absolute;
	top: -7px;
	right: -7px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border: 2px solid #fff;
	border-radius: 99px;
	background: var(--etik-orange, #f58300);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}

@keyframes etik-cartbar-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

@keyframes etik-cartbar-bump {
	40% {
		transform: scale(1.3);
	}
}

@media (prefers-reduced-motion: reduce) {
	.etik-cartbar:not([hidden]),
	.etik-cartbar.is-bump .etik-cartbar__count {
		animation: none;
	}
}
