/* ===== INVIA — cart page + cart sidebar drawer ===== */

body.invia-cart-drawer-active {
	overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   Desktop cart PAGE styles (kept from before)
   ══════════════════════════════════════════════════════ */

body.woocommerce-cart .invia-wc-cart-shell,
body.woocommerce-cart .woocommerce {
	max-width: 1080px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

body.woocommerce-cart .invia-wc-cart-shell {
	padding: 40px 24px 72px;
	direction: rtl;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
	color: #151515;
}

body.woocommerce-cart .entry-header,
body.woocommerce-cart .page-header {
	margin-bottom: 28px;
	text-align: right;
}

body.woocommerce-cart .entry-title,
body.woocommerce-cart h1.page-title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 700;
	margin: 0 0 8px;
	letter-spacing: 0.02em;
}

body.woocommerce-cart table.shop_table.cart {
	width: 100%;
	border: 1px solid #e8e8e8;
	border-radius: 16px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	background: #fff;
	font-size: 15px;
}

body.woocommerce-cart table.shop_table.cart thead th {
	background: #fafafa;
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #555;
	padding: 16px 18px;
	border-bottom: 1px solid #e8e8e8;
	text-align: right;
}

body.woocommerce-cart table.shop_table.cart tbody td {
	padding: 20px 18px;
	vertical-align: middle;
	border-bottom: 1px solid #f0f0f0;
}

body.woocommerce-cart table.shop_table.cart tbody tr:last-child td {
	border-bottom: none;
}

body.woocommerce-cart table.shop_table.cart .product-thumbnail img {
	width: 72px;
	height: auto;
	border-radius: 8px;
	display: block;
}

body.woocommerce-cart table.shop_table.cart .product-name {
	font-weight: 500;
	line-height: 1.45;
}

body.woocommerce-cart table.shop_table.cart .product-name a {
	color: #151515;
	text-decoration: none;
}

body.woocommerce-cart table.shop_table.cart .product-name a:hover {
	opacity: 0.7;
}

body.woocommerce-cart table.shop_table.cart .product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #f5f5f5;
	color: #151515 !important;
	font-size: 20px;
	line-height: 1;
	text-decoration: none !important;
	transition: background 0.15s ease;
}

body.woocommerce-cart table.shop_table.cart .product-remove a.remove:hover {
	background: #ebebeb;
}

body.woocommerce-cart table.shop_table.cart .quantity .qty {
	border: 1px solid #d6d6d6;
	border-radius: 999px;
	padding: 8px 14px;
	font-family: 'Ploni', sans-serif;
	font-size: 15px;
	text-align: center;
	min-width: 56px;
}

body.woocommerce-cart table.shop_table.cart td.actions {
	padding: 20px 18px;
	background: #fafafa;
	border-top: 1px solid #e8e8e8;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon input.input-text {
	border: 1px solid #d6d6d6;
	border-radius: 999px;
	padding: 10px 16px;
	font-family: 'Ploni', sans-serif;
	min-width: 200px;
}

body.woocommerce-cart table.shop_table.cart td.actions .button,
body.woocommerce-cart table.shop_table.cart td.actions button.button {
	border-radius: 999px !important;
	padding: 10px 20px !important;
	font-family: 'Ploni', sans-serif !important;
	font-weight: 500 !important;
}

body.woocommerce-cart table.shop_table.cart td.actions button[name='update_cart'] {
	background: #fff !important;
	color: #151515 !important;
	border: 1px solid #d6d6d6 !important;
}

body.woocommerce-cart .cart-collaterals {
	display: flex;
	flex-direction: column;
	gap: 40px;
	margin-top: 8px;
}

@media screen and (min-width: 900px) {
	body.woocommerce-cart .cart-collaterals {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		justify-content: space-between;
		gap: 48px;
	}

	body.woocommerce-cart .cart-collaterals .cross-sells {
		flex: 1 1 55%;
		min-width: 0;
		order: 2;
	}

	body.woocommerce-cart .cart-collaterals .cart_totals {
		flex: 0 0 340px;
		max-width: 100%;
		order: 1;
	}
}

body.woocommerce-cart .cart_totals {
	border: 1px solid #e8e8e8;
	border-radius: 16px;
	padding: 24px 22px 28px;
	background: #fff;
}

body.woocommerce-cart .cart_totals h2 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 18px;
	text-align: right;
}

body.woocommerce-cart .cart_totals table.shop_table_responsive tr th,
body.woocommerce-cart .cart_totals table.shop_table_responsive tr td {
	padding: 10px 0;
	border: none;
	text-align: right;
}

body.woocommerce-cart .wc-proceed-to-checkout {
	padding-top: 16px;
	margin: 0;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
	display: block !important;
	width: 100%;
	text-align: center;
	background: #151515 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 16px 24px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	font-family: 'Ploni', sans-serif !important;
	text-decoration: none !important;
	transition: opacity 0.2s ease !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
	opacity: 0.88 !important;
	color: #fff !important;
}

body.woocommerce-cart .cross-sells > h2 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 20px;
	text-align: right;
}

body.woocommerce-cart .cross-sells ul.products {
	margin: 0;
}

/* Empty page */
.invia-cart-empty-page {
	max-width: 420px;
	margin: 48px auto 80px;
	padding: 0 24px;
	text-align: center;
	direction: rtl;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
}

.invia-cart-empty-page__icon {
	color: #151515;
	margin-bottom: 24px;
	display: flex;
	justify-content: center;
}

.invia-cart-empty-page__title {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 28px;
	color: #151515;
}

.invia-cart-empty-page__cta-wrap {
	margin: 0 0 40px;
}

.invia-cart-empty-page__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 36px;
	background: #151515;
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transition: opacity 0.2s ease;
}

.invia-cart-empty-page__cta:hover {
	opacity: 0.88;
	color: #fff !important;
}

.invia-cart-empty-page__account {
	border-top: 1px solid #e0e0e0;
	padding-top: 28px;
	margin-top: 8px;
}

.invia-cart-empty-page__account-q {
	margin: 0 0 8px;
	font-size: 16px;
	color: #151515;
}

.invia-cart-empty-page__account-hint {
	margin: 0;
	font-size: 15px;
	color: #444;
	line-height: 1.5;
}

.invia-cart-empty-page__account-link {
	color: #151515;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Responsive cart page table */
@media screen and (max-width: 782px) {
	body.woocommerce-cart .invia-wc-cart-shell {
		padding: 24px 16px 56px;
	}

	body.woocommerce-cart table.shop_table_responsive.cart thead {
		display: none;
	}

	body.woocommerce-cart table.shop_table_responsive.cart tbody tr {
		display: block;
		padding: 18px 0;
		border-bottom: 1px solid #eee;
	}

	body.woocommerce-cart table.shop_table_responsive.cart tbody td {
		display: block;
		width: 100% !important;
		text-align: right !important;
		padding: 8px 0 !important;
		border: none !important;
	}

	body.woocommerce-cart table.shop_table_responsive.cart tbody td::before {
		content: attr(data-title) ': ';
		font-weight: 600;
		font-size: 12px;
		color: #666;
		display: inline-block;
		margin-left: 8px;
	}

	body.woocommerce-cart table.shop_table_responsive.cart tbody td.product-remove::before,
	body.woocommerce-cart table.shop_table_responsive.cart tbody td.actions::before {
		display: none;
	}

	body.woocommerce-cart table.shop_table.cart {
		border: none;
		border-radius: 0;
	}

	body.woocommerce-cart table.shop_table.cart tbody td.actions {
		background: transparent;
		padding-top: 16px !important;
	}
}


/* ══════════════════════════════════════════════════════
   CART SIDEBAR DRAWER
   ══════════════════════════════════════════════════════ */

.invia-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 100001;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.invia-cart-drawer.invia-cart-drawer--open {
	pointer-events: auto;
	visibility: visible;
	opacity: 1;
}

/* Backdrop */
.invia-cart-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	cursor: pointer;
}

/* Panel */
.invia-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 480px;
	background: #fff;
	display: flex;
	flex-direction: column;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
	direction: rtl;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
	color: #151515;
}

.invia-cart-drawer.invia-cart-drawer--open .invia-cart-drawer__panel {
	transform: translateX(0);
}

/* ── Header ── */
.invia-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.invia-cart-drawer__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #151515;
	letter-spacing: 0.01em;
}

.invia-cart-drawer__close {
	border: none;
	background: none;
	padding: 4px;
	margin: 0;
	cursor: pointer;
	color: #151515 !important;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.invia-cart-drawer__close svg {
	stroke: #151515 !important;
	color: #151515 !important;
}

.invia-cart-drawer__close:hover {
	background: #f5f5f5;
}

.invia-cart-drawer__close:focus,
.invia-cart-drawer__close:focus-visible {
	outline: none !important;
	box-shadow: none !important;
	background: none !important;
}

/* ── Free shipping bar ── */
.invia-cart-shipping-bar {
	padding: 14px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.invia-cart-shipping-bar__text {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	text-align: right;
}

.invia-cart-shipping-bar__track {
	width: 100%;
	height: 4px;
	border-radius: 999px;
	background: #e8e8e8;
	overflow: hidden;
}

.invia-cart-shipping-bar__fill {
	height: 100%;
	border-radius: 999px;
	background: #151515;
	transition: width 0.4s ease;
}

/* ── Scrollable items area ── */
.invia-cart-drawer__scroll {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 0;
}

.invia-cart-drawer__scroll .widget_shopping_cart_content {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

/* ── Item list ── */
.invia-mini-cart-list,
.woocommerce ul.cart_list,
.woocommerce ul.product_list_widget,
.invia-cart-drawer .invia-mini-cart-list.cart_list.product_list_widget {
	list-style: none outside !important;
	padding: 14px 24px 16px !important;
	margin: 0 !important;
	flex: 1 1 auto;
}

.invia-cart-item {
	display: grid;
	grid-template-columns: 100px 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 16px;
	row-gap: 10px;
	align-items: center;
	padding: 20px 32px;
	border-bottom: 1px solid #f0f0f0;
}

.invia-cart-item:last-child {
	border-bottom: none;
}

/* Item image — column 1, spans both rows */
.invia-cart-item__img {
	grid-column: 1;
	grid-row: 1 / 3;
	width: 100px;
}

.invia-cart-item__img img {
	width: 100px !important;
	height: 100px !important;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}

.invia-cart-item__img a {
	display: block;
	text-decoration: none;
}

/* Item body — flatten children into parent grid */
.invia-cart-item__body {
	display: contents;
}

/* Name — row 1, column 2 */
.invia-cart-item__name {
	grid-column: 2 / 4;
	grid-row: 1;
	align-self: end;
	font-size: 15px;
	font-weight: 400 !important;
	color: #151515;
	text-decoration: none;
	line-height: 1.4;
	display: block;
}

.invia-cart-item__name:hover {
	opacity: 0.7;
}

/* Qty row + delete — row 2, column 2, inline with price */
.invia-cart-item__qty-row {
	grid-column: 2;
	grid-row: 2;
	align-self: center;
	display: flex;
	align-items: center;
	gap: 12px;
}

.invia-cart-item__qty-ctrl {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	border: 1px solid #d6d6d6;
	border-radius: 999px;
	overflow: hidden;
	height: 38px;
}

.invia-cart-item__qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: none;
	background: transparent;
	cursor: pointer;
	font-size: 18px;
	color: #151515;
	padding: 0;
	margin: 0;
	font-family: inherit;
	transition: background 0.15s ease;
	line-height: 1;
}

.invia-cart-item__qty-btn:hover {
	background: #f5f5f5;
}

.invia-cart-item__qty-val {
	min-width: 26px;
	text-align: center;
	font-size: 15px;
	font-weight: 500;
	color: #151515;
	user-select: none;
}

/* Remove (trash) button */
.invia-cart-item__remove {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: #888;
	padding: 0;
	border-radius: 8px;
	transition: color 0.15s ease, background 0.15s ease;
	text-decoration: none !important;
}

.invia-cart-item__remove:hover,
.invia-cart-item__remove:focus,
.invia-cart-item__remove:active,
.invia-cart-drawer a.invia-cart-item__remove:hover,
.invia-cart-drawer a.remove.invia-cart-item__remove:hover {
	color: #888 !important;
	background: transparent !important;
	outline: none;
}

/* Item price — row 2, far right */
.invia-cart-item__price {
	grid-column: 3;
	grid-row: 2;
	align-self: center;
	text-align: left;
	font-size: 15px;
	font-weight: 400;
	color: #151515;
	white-space: nowrap;
}

.invia-cart-item__price del {
	display: block;
	color: #999;
	font-weight: 400;
	font-size: 12px;
	text-decoration: line-through;
}

.invia-cart-item__price ins {
	display: block;
	color: #b91c1c;
	text-decoration: none;
	font-weight: 600;
}

/* ── Footer (subtotal + checkout) — прибит к низу ── */
.invia-mini-cart-footer {
	flex-shrink: 0;
	position: sticky;
	bottom: 0;
	border-top: 1px solid #e8e8e8;
	padding: 20px 24px 24px;
	background: #fafafa;
	z-index: 1;
}

.invia-mini-cart-footer__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 4px;
}

.invia-mini-cart-footer__label {
	font-size: 16px;
	font-weight: 600;
	color: #151515;
}

.invia-mini-cart-footer__amount {
	font-size: 18px;
	font-weight: 700;
	color: #151515;
}

.invia-mini-cart-footer__note {
	margin: 0 0 16px;
	font-size: 12px;
	color: #888;
	text-align: left;
}

.invia-mini-cart-footer__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 16px 24px;
	background: #151515;
	color: #fff !important;
	border: none;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	font-family: 'Ploni', -apple-system, BlinkMacSystemFont, sans-serif;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none !important;
	cursor: pointer;
	transition: opacity 0.2s ease;
	box-sizing: border-box;
}

.invia-mini-cart-footer__checkout svg {
	flex-shrink: 0;
}

.invia-mini-cart-footer__checkout:hover {
	opacity: 0.88;
	color: #fff !important;
	background: #151515;
}

/* ── Empty state inside drawer ── */
.invia-mini-cart-empty {
	text-align: center;
	padding: 48px 24px 32px;
}

.invia-mini-cart-empty__icon {
	color: #151515;
	display: flex;
	justify-content: center;
	margin-bottom: 20px;
}

.invia-mini-cart-empty__title {
	margin: 0 0 24px;
	font-size: 1.05rem;
	font-weight: 600;
	color: #151515;
}

.invia-mini-cart-empty__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	background: #151515;
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.invia-mini-cart-empty__cta:hover {
	opacity: 0.88;
	color: #fff !important;
	background: #151515;
}

/* ── Mobile tweaks ── */
@media screen and (max-width: 600px) {
	.invia-cart-drawer__panel {
		max-width: 100%;
	}

	.invia-cart-item {
		padding: 14px 18px;
		column-gap: 12px;
		grid-template-columns: 80px 1fr auto;
		row-gap: 8px;
	}

	.invia-cart-item__img {
		width: 80px;
	}

	.invia-cart-item__img img {
		width: 80px;
		height: 80px;
	}

	.invia-cart-shipping-bar,
	.invia-cart-drawer__header,
	.invia-mini-cart-footer {
		padding-left: 18px;
		padding-right: 18px;
	}
}

/* ============================================================
   LTR overrides — English (html[lang|="en"])
   ============================================================ */

html[lang|="en"] body.woocommerce-cart .invia-wc-cart-shell {
	direction: ltr;
}

html[lang|="en"] body.woocommerce-cart .entry-header,
html[lang|="en"] body.woocommerce-cart .page-header {
	text-align: left;
}

html[lang|="en"] body.woocommerce-cart table.shop_table.cart thead th {
	text-align: left;
}

html[lang|="en"] body.woocommerce-cart .cart_totals h2 {
	text-align: left;
}

html[lang|="en"] body.woocommerce-cart .cart_totals table.shop_table_responsive tr th,
html[lang|="en"] body.woocommerce-cart .cart_totals table.shop_table_responsive tr td {
	text-align: left;
}

html[lang|="en"] body.woocommerce-cart .cross-sells > h2 {
	text-align: left;
}

html[lang|="en"] .invia-cart-empty-page {
	direction: ltr;
}

/* Cart drawer: slide in from left instead of right */
html[lang|="en"] .invia-cart-drawer__panel {
	right: auto;
	left: 0;
	direction: ltr;
	transform: translateX(-100%);
	box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
}

html[lang|="en"] .invia-cart-shipping-bar__text {
	text-align: left;
}

/* ── Checkout page: #place_order button ── */
body.woocommerce-checkout #place_order {
	display: block !important;
	width: 100% !important;
	background: #151515 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 16px 24px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	font-family: 'Ploni', sans-serif !important;
	text-align: center !important;
	cursor: pointer !important;
	transition: opacity 0.2s ease !important;
	box-sizing: border-box !important;
}

body.woocommerce-checkout #place_order:hover {
	opacity: 0.88 !important;
	color: #fff !important;
}

@media screen and (max-width: 782px) {
	html[lang|="en"] body.woocommerce-cart table.shop_table_responsive.cart tbody td {
		text-align: left !important;
	}

	html[lang|="en"] body.woocommerce-cart table.shop_table_responsive.cart tbody td::before {
		margin-left: 0;
		margin-right: 8px;
	}
}
