/**
 * Koszyk — stroble.ai
 *
 * Layout 1:1 ze stroble.pl. Spec: dokumentacja/visual-spec-koszyk-checkout.md
 *
 *   Lewa: .stroble-cart-products 770 + Gap 50 + Prawa: .stroble-cart-summary 380 = 1200
 *
 * @package stroble
 */

/* ====================================================================
 * 1. CONTAINER + LAYOUT
 * ==================================================================== */

/* Override Woo content wrapper żeby koszyk zajmował pełną szerokość strony. */
.woocommerce-page .woocommerce,
.woocommerce-cart .woocommerce {
	max-width: none !important;
	width: 100% !important;
}

.stroble-cart {
	padding: 35px 0 60px;
	width: 100%;
}

/* === Loader spinner przy zmianie metody dostawy (port z page-zamowienie.css) === */
.stroble-cart.is-updating {
	pointer-events: none;
	opacity: 0.6;
	position: relative;
}

.stroble-cart.is-updating::after {
	content: '';
	position: fixed;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border: 3px solid #E5E5E8;
	border-top-color: #B38271;
	border-radius: 50%;
	animation: stroble-cart-spin 0.8s linear infinite;
	z-index: 9999;
}

@keyframes stroble-cart-spin {
	to { transform: rotate(360deg); }
}

.stroble-cart .stroble-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 13px;
}

.stroble-cart__layout {
	display: grid;
	grid-template-columns: 770px 380px;
	gap: 50px;
	align-items: start;
}

/* ====================================================================
 * 2. EMPTY CART
 * ==================================================================== */

.stroble-cart-empty {
	max-width: 480px;
	margin: 80px auto;
	padding: 40px 30px;
	text-align: center;
	background: #fff;
}

.stroble-cart-empty__icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	fill: #B38271;
}

.stroble-cart-empty__title {
	margin: 0 0 12px;
	font-family: Poppins, sans-serif;
	font-size: 24px;
	line-height: 32px;
	font-weight: 600;
	color: #151515;
}

.stroble-cart-empty__text {
	margin: 0 0 24px;
	font-family: Poppins, sans-serif;
	font-size: 16px;
	line-height: 24px;
	font-weight: 300;
	color: #5E6573;
}

.stroble-cart-empty__button {
	display: inline-block;
	padding: 14px 32px;
	background: #151515;
	border-radius: 4px;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: #fff;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Sesja 44 (2026-05-04): rollout Wariant A z Sesji 43 — spójność hero empty states
 * z orders-empty (Sesja 42-43). Odejście od signature `bg → #B38271` na rzecz
 * uplift czarnego + lift + shadow drop (WCAG AA-safe contrast white-on-#2d2d2d 14:1). */
.stroble-cart-empty__button:hover {
	background: #2d2d2d;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ====================================================================
 * 3. LEWA: lista produktów
 * ==================================================================== */

.stroble-cart-products {
	min-width: 0;
}

.stroble-cart-products__header {
	margin: 0 0 24px;
	padding: 0 0 16px;
	border-bottom: 1px solid #C5CBD5;
}

.stroble-cart-products__title {
	margin: 0;
	font-family: Poppins, sans-serif;
	font-size: 22px;
	line-height: 30px;
	font-weight: 600;
	color: #151515;
}

.stroble-cart-products__list {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* === Pojedynczy item === */

.stroble-cart-item {
	display: grid;
	grid-template-columns: 100px 1fr 120px 30px;
	gap: 20px;
	align-items: center;
	padding: 24px 0;
	border-bottom: 1px solid #C5CBD5;
}

/* Ukryta kolumna quantity — zachowujemy input hidden dla WC update_cart,
   ale NIE pokazujemy kontrolek bo każdy wariant rozmiaru to 1 szt. stock. */
.stroble-cart-item__qty {
	display: none;
}

.stroble-cart-item:last-child {
	border-bottom: 0;
}

.stroble-cart-item__image {
	width: 100px;
	height: 100px;
	overflow: hidden;
}

.stroble-cart-item__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.stroble-cart-item__body {
	min-width: 0;
}

.stroble-cart-item__cat {
	margin: 0 0 4px;
	font-family: Poppins, sans-serif;
	font-size: 12px;
	line-height: 18px;
	font-weight: 600;
	color: #B38271;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.stroble-cart-item__title {
	margin: 0 0 6px;
	font-family: Poppins, sans-serif;
	font-size: 16px;
	line-height: 22px;
	font-weight: 500;
	color: #151515;
}

.stroble-cart-item__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.stroble-cart-item__title a:hover {
	color: #B38271;
}

.stroble-cart-item__variation {
	font-family: Poppins, sans-serif;
	font-size: 13px;
	line-height: 19px;
	font-weight: 300;
	color: #5E6573;
}

.stroble-cart-item__variation dl {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.stroble-cart-item__variation dt {
	font-weight: 500;
	margin: 0;
}

.stroble-cart-item__variation dd {
	margin: 0;
}

.stroble-cart-item__variation p {
	margin: 0;
}

/* === Quantity controls === */

.stroble-qty {
	display: inline-flex;
	align-items: center;
	gap: 0;
	border: 1px solid #E5E5E8;
	border-radius: 4px;
	overflow: hidden;
}

.stroble-qty__btn {
	width: 36px;
	height: 36px;
	padding: 0;
	background: #fff;
	border: 0;
	font-family: Poppins, sans-serif;
	font-size: 18px;
	font-weight: 400;
	color: #151515;
	cursor: pointer;
	transition: background 0.2s ease;
}

.stroble-qty__btn:hover {
	background: #F6F6F8;
}

.stroble-qty__input {
	width: 40px;
	height: 36px;
	padding: 0;
	border: 0;
	border-left: 1px solid #E5E5E8;
	border-right: 1px solid #E5E5E8;
	background: #fff;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: #151515;
	text-align: center;
	-moz-appearance: textfield;
}

.stroble-qty__input::-webkit-outer-spin-button,
.stroble-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.stroble-qty--single {
	display: inline-block;
	padding: 8px 16px;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: #151515;
}

/* === Cena + remove === */

.stroble-cart-item__price {
	font-family: Poppins, sans-serif;
	font-size: 17px;
	line-height: 25.5px;
	font-weight: 600;
	color: #292C32;
	text-align: right;
}

.stroble-cart-item__remove-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: transparent;
	border: 0;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	color: #878D9D;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease;
}

.stroble-cart-item__remove-btn:hover {
	color: #fff;
	background: #B38271;
}

/* ====================================================================
 * 4. PRAWA: sidebar podsumowanie
 * ==================================================================== */

.stroble-cart-summary {
	position: sticky;
	top: 120px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.stroble-cart-summary__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.stroble-cart-summary__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 24px;
	background: #151515;
	border-radius: 4px;
	font-family: Poppins, sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: #fff;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Sesja 44 (2026-05-04): rollout Wariant A z Sesji 43 — checkout CTA pozostaje
 * jako primary action z premium hover (lift + shadow). Zachowane color: #fff
 * (1:1 z poprzednim, brand-safe). */
.stroble-cart-summary__checkout:hover {
	background: #2d2d2d;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stroble-cart-summary__back {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	background: transparent;
	border: 1px solid #E5E5E8;
	border-radius: 4px;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	font-weight: 400;
	color: #393D46;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.stroble-cart-summary__back:hover {
	border-color: #B38271;
	color: #B38271;
}

/* === Box podsumowania === */

.stroble-summary-box {
	padding: 24px;
	background: #F6F6F8;
	border-radius: 6px;
}

.stroble-summary-box__title {
	margin: 0 0 20px;
	padding: 0 0 16px;
	border-bottom: 1px solid #E5E5E8;
	font-family: Poppins, sans-serif;
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	color: #151515;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.stroble-summary-box__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	line-height: 21px;
}

.stroble-summary-box__label {
	font-weight: 300;
	color: #5E6573;
}

.stroble-summary-box__value {
	font-weight: 500;
	color: #151515;
	text-align: right;
}

.stroble-summary-box__value bdi,
.stroble-summary-box__value .amount {
	font-weight: 500;
}

.stroble-summary-box__row--shipping {
	border-top: 1px solid #E5E5E8;
	margin-top: 8px;
	padding-top: 16px;
}

/* === Metoda dostawy (radio buttons w koszyku) === */

.stroble-summary-box__shipping {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #E5E5E8;
}

.stroble-summary-box__shipping-label {
	margin-bottom: 12px;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #151515;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.stroble-shipping-methods {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.stroble-shipping-methods__item {
	border: 2px solid #E5E5E8;
	border-radius: 8px;
	background: #FFFFFF;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	overflow: hidden;
}

.stroble-shipping-methods__item:hover {
	border-color: #B38271;
	background: #FCFAF9;
}

.stroble-shipping-methods__item.is-chosen {
	border-color: #B38271;
	background: #FCFAF9;
	box-shadow: 0 0 0 3px rgba(179, 130, 113, 0.12);
}

.stroble-shipping-methods__label {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	cursor: pointer;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	line-height: 19px;
	color: #393D46;
	margin: 0;
}

/* Hide native radio visually — ale BEZ pointer-events:none i BEZ width:0, żeby pierwszy klik
   na labelu propagował natywnie na radio (native label→input binding) i od razu ustawiał
   `checked=true`, odpalając `change`. Fix race condition podwójnego klika. */
.stroble-shipping-methods__radio {
	position: absolute;
	opacity: 0;
	width: 18px;
	height: 18px;
	margin: 0;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	cursor: pointer;
}

.stroble-shipping-methods__radio-fake {
	display: block;
	align-self: center;
	width: 18px;
	height: 18px;
	border: 2px solid #C5CBD5;
	border-radius: 50%;
	background: #FFFFFF;
	flex-shrink: 0;
	position: relative;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.stroble-shipping-methods__radio-fake::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #B38271;
	transform: translate(-50%, -50%) scale(0);
	transition: transform 0.2s ease;
}

.stroble-shipping-methods__item.is-chosen .stroble-shipping-methods__radio-fake {
	border-color: #B38271;
}

.stroble-shipping-methods__item.is-chosen .stroble-shipping-methods__radio-fake::after {
	transform: translate(-50%, -50%) scale(1);
}

.stroble-shipping-methods__name {
	font-size: 14px;
	font-weight: 500;
	color: #151515;
	line-height: 1.35;
}

.stroble-shipping-methods__price {
	font-size: 14px;
	font-weight: 700;
	color: #151515;
	white-space: nowrap;
}

.stroble-shipping-methods__price .amount {
	color: inherit;
	font-weight: inherit;
}

.stroble-shipping-methods__price .woocommerce-Price-currencySymbol {
	color: #5E6573;
	font-weight: 600;
	margin-left: 3px;
}

/* "Bezpłatna" — gdy koszt wysyłki = 0 zł */
.stroble-shipping-free {
	color: #10B981;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.stroble-summary-box__row--total {
	margin-top: 12px;
	padding: 16px 0 0;
	border-top: 1px solid #E5E5E8;
}

.stroble-summary-box__row--total .stroble-summary-box__label {
	font-weight: 600;
	color: #151515;
	font-size: 16px;
	text-transform: uppercase;
}

.stroble-summary-box__row--total .stroble-summary-box__value {
	font-weight: 700;
	color: #B38271;
	font-size: 20px;
}

/* === Coupon === */

.stroble-summary-box__coupon {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #E5E5E8;
}

.stroble-summary-box__coupon-toggle {
	width: 100%;
	padding: 8px 0;
	background: transparent;
	border: 0;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	font-weight: 400;
	color: #5E6573;
	text-align: left;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.stroble-summary-box__coupon-toggle:hover {
	color: #B38271;
}

.stroble-summary-box__coupon-form {
	margin-top: 12px;
}

.stroble-summary-box__coupon-form[hidden] {
	display: none;
}

.stroble-summary-box__coupon-fields {
	display: flex;
	gap: 8px;
	width: 100%;
}

.stroble-summary-box__coupon-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #E5E5E8;
	border-radius: 4px;
	background: #fff;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	color: #151515;
}

.stroble-summary-box__coupon-input:focus {
	outline: none;
	border-color: #B38271;
}

.stroble-summary-box__coupon-apply {
	padding: 10px 18px;
	background: #151515;
	border: 0;
	border-radius: 4px;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}

.stroble-summary-box__coupon-apply:hover {
	background: #B38271;
}

.stroble-summary-box__coupon-message {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 4px;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	line-height: 18px;
	font-weight: 400;
}

.stroble-summary-box__coupon-message[hidden] {
	display: none;
}

.stroble-summary-box__coupon-message--error {
	background: #FDECEC;
	color: #A12525;
	border: 1px solid #F4C7C7;
}

.stroble-summary-box__coupon-message--success {
	background: #E9F5EC;
	color: #1E6B3A;
	border: 1px solid #C6E4CE;
}

/* Toggle open state */
.stroble-summary-box__coupon-toggle[aria-expanded="true"] {
	color: #B38271;
}

/* ====================================================================
 * 4b. BUTTONS SPACING (po podsumowaniu)
 * ==================================================================== */

.stroble-cart-summary .stroble-cart-summary__buttons {
	margin-top: 4px;
}

/* ====================================================================
 * 5. MOBILE
 * ==================================================================== */

@media (max-width: 1024px) {
	.stroble-cart__layout {
		grid-template-columns: 1fr 320px;
		gap: 30px;
	}
}

@media (max-width: 768px) {
	.stroble-cart {
		padding: 20px 0 40px;
	}

	.stroble-cart__layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.stroble-cart-summary {
		position: relative;
		top: 0;
	}

	.stroble-cart-item {
		grid-template-columns: 80px 1fr 30px;
		grid-template-areas:
			"image body remove"
			"image price price";
		gap: 12px;
	}

	.stroble-cart-item__image { grid-area: image; width: 80px; height: 80px; }
	.stroble-cart-item__body { grid-area: body; }
	.stroble-cart-item__price { grid-area: price; text-align: right; }
	.stroble-cart-item__remove { grid-area: remove; text-align: right; }

	.stroble-cart-item__title {
		font-size: 14px;
	}
}
