/**
 * Cart drawer modernization + Product Bundle accordion (mini-cart / cart / checkout).
 */

:root {
	--ngs-cart-green: #84b928;
	--ngs-cart-green-dark: #5f8f17;
	--ngs-cart-ink: #172018;
	--ngs-cart-muted: #68706b;
	--ngs-cart-line: #e4e8e3;
	--ngs-cart-soft: #f5f7f4;
	--ngs-cart-radius: 12px;
}

/* -------------------------------------------------------------------------- */
/* Bundle toggle + children                                                    */
/* -------------------------------------------------------------------------- */

.ngs-bundle-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.55rem;
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--ngs-cart-line);
	border-radius: 999px;
	background: var(--ngs-cart-soft);
	color: var(--ngs-cart-ink);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ngs-bundle-toggle:hover,
.ngs-bundle-toggle:focus-visible {
	background: #eef5e3;
	border-color: #c5dba0;
	color: var(--ngs-cart-green-dark);
	outline: none;
}

.ngs-bundle-toggle.is-open {
	background: #eef5e3;
	border-color: #c5dba0;
}

.ngs-bundle-toggle__icon {
	display: inline-flex;
	transition: transform 0.2s ease;
}

.ngs-bundle-toggle.is-open .ngs-bundle-toggle__icon {
	transform: rotate(180deg);
}

.ngs-bundle-child.is-collapsed {
	display: none !important;
}

/* Mini-cart children */
.shoptimizer-mini-cart-wrap .ngs-bundle-child {
	padding-left: 48px !important;
	background: var(--ngs-cart-soft);
	border-left: 3px solid var(--ngs-cart-green);
	font-size: 12px;
}

.shoptimizer-mini-cart-wrap .ngs-bundle-child .remove,
.shoptimizer-mini-cart-wrap .ngs-bundle-child .remove_from_cart_button {
	display: none !important;
}

.shoptimizer-mini-cart-wrap .ngs-bundle-child img {
	max-width: 42px !important;
	width: 42px !important;
}

.shoptimizer-mini-cart-wrap .ngs-bundle-parent {
	border-bottom-color: transparent;
}

.shoptimizer-mini-cart-wrap .ngs-bundle-parent + .ngs-bundle-child,
.shoptimizer-mini-cart-wrap .ngs-bundle-child + .ngs-bundle-child {
	border-top: 0;
}

/* Cart / checkout table children */
.woocommerce-cart-form__cart-item.ngs-bundle-child,
.woocommerce-checkout-review-order-table .ngs-bundle-child {
	background: var(--ngs-cart-soft);
}

.woocommerce-cart-form__cart-item.ngs-bundle-child td,
.woocommerce-checkout-review-order-table .ngs-bundle-child td {
	border-color: var(--ngs-cart-line);
	font-size: 0.92em;
	color: var(--ngs-cart-muted);
}

.woocommerce-cart-form__cart-item.ngs-bundle-child .product-name,
.woocommerce-checkout-review-order-table .ngs-bundle-child .product-name {
	padding-left: 1.5rem;
	border-left: 3px solid var(--ngs-cart-green);
}

.woocommerce-cart-form__cart-item.ngs-bundle-child .product-remove,
.woocommerce-cart-form__cart-item.ngs-bundle-child .product-quantity input,
.woocommerce-cart-form__cart-item.ngs-bundle-child .product-quantity .quantity {
	visibility: hidden;
	pointer-events: none;
}

.woocommerce-cart-form__cart-item.ngs-bundle-parent .product-name,
.woocommerce-checkout-review-order-table .ngs-bundle-parent .product-name {
	font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Modern Shoptimizer cart drawer                                              */
/* -------------------------------------------------------------------------- */

.shoptimizer-mini-cart-wrap {
	box-shadow: -12px 0 40px rgba(23, 32, 24, 0.14);
	border-left: 1px solid var(--ngs-cart-line);
}

.cart-drawer-heading {
	margin: 16px 20px !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	letter-spacing: -0.02em;
	color: var(--ngs-cart-ink) !important;
}

.shoptimizer-mini-cart-wrap .close-drawer {
	top: 14px !important;
	right: 14px !important;
	width: 36px !important;
	height: 36px !important;
	border-radius: 50%;
	background: var(--ngs-cart-soft) !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.shoptimizer-mini-cart-wrap .close-drawer:hover {
	background: #e8ece6 !important;
	transform: rotate(90deg);
}

.shoptimizer-mini-cart-wrap .close-drawer span {
	width: 20px !important;
	height: 20px !important;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart {
	margin-top: 56px !important;
	height: calc(100% - 56px) !important;
	padding: 0 16px !important;
	background: #fff;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart_content {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart .product_list_widget {
	flex: 1 1 auto;
	min-height: 0;
	padding: 4px 4px 12px 0 !important;
	scrollbar-width: thin;
	scrollbar-color: #c5cbc3 transparent;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart .product_list_widget::-webkit-scrollbar {
	width: 6px;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart .product_list_widget::-webkit-scrollbar-thumb {
	background: #c5cbc3;
	border-radius: 999px;
}

.shoptimizer-mini-cart-wrap .woocommerce-mini-cart.cart_list:before {
	display: none !important;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart li.mini_cart_item {
	margin-bottom: 8px !important;
	padding: 14px 12px 14px 40px !important;
	border: 1px solid var(--ngs-cart-line) !important;
	border-radius: var(--ngs-cart-radius);
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart li.mini_cart_item:hover {
	border-color: #d0d7ce !important;
	box-shadow: 0 2px 10px rgba(23, 32, 24, 0.05);
}

.shoptimizer-mini-cart-wrap .widget_shopping_cart li.mini_cart_item a {
	font-weight: 600;
	color: var(--ngs-cart-ink) !important;
	line-height: 1.35;
}

.shoptimizer-mini-cart-wrap .product_list_widget img {
	border-radius: 8px;
	margin-left: 12px !important;
}

.widget_shopping_cart .product_list_widget li a.remove {
	top: 16px !important;
	left: 12px !important;
	width: 18px !important;
	height: 18px !important;
	border-radius: 50%;
	opacity: 0.7;
}

.widget_shopping_cart .product_list_widget li a.remove:hover {
	opacity: 1;
}

.widget_shopping_cart .product_list_widget li a.remove:before {
	border-radius: 2px;
}

.shoptimizer-mini-cart-wrap .product_list_widget li .quantity {
	color: var(--ngs-cart-muted) !important;
	font-size: 12px !important;
	margin-top: 4px !important;
}

.widget_shopping_cart .woocommerce-mini-cart-item .amount {
	color: var(--ngs-cart-ink) !important;
	font-weight: 700 !important;
}

/* Sticky footer */
.shoptimizer-mini-cart-wrap .woocommerce-mini-cart__total,
.shoptimizer-mini-cart-wrap .woocommerce-mini-cart__buttons,
.shoptimizer-mini-cart-wrap .cart-drawer-below {
	flex-shrink: 0;
}

.widget_shopping_cart p.total {
	margin-top: auto !important;
	padding: 1rem 4px 0.75rem !important;
	border-top: 1px solid var(--ngs-cart-line) !important;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), #fff);
	font-size: 16px !important;
	color: var(--ngs-cart-ink) !important;
}

.widget_shopping_cart p.buttons {
	padding: 0 0 1rem !important;
}

.shoptimizer-mini-cart-wrap .woocommerce-mini-cart__buttons a {
	height: 48px !important;
	line-height: 48px !important;
	border-radius: 10px !important;
	font-weight: 600 !important;
	letter-spacing: 0.01em;
	transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.widget_shopping_cart a.button:not(.checkout) {
	border-color: var(--ngs-cart-line) !important;
	color: var(--ngs-cart-ink) !important;
	background: #fff !important;
}

.widget_shopping_cart a.button:not(.checkout):hover {
	background: var(--ngs-cart-soft) !important;
	border-color: #cfd6cb !important;
}

.widget_shopping_cart a.button.checkout {
	border: none !important;
	background: var(--ngs-cart-green) !important;
	color: #15200e !important;
	box-shadow: 0 6px 16px rgba(132, 185, 40, 0.28);
}

.widget_shopping_cart a.button.checkout:hover {
	background: #a2d647 !important;
	color: #15200e !important;
	transform: translateY(-1px);
}

.shoptimizer-mini-cart-wrap .cart-drawer-below {
	color: var(--ngs-cart-muted);
	padding-bottom: 1.25rem !important;
}

/* Quantity controls inside drawer */
.shoptimizer-mini-cart-wrap .shoptimizer-custom-quantity-mini-cart {
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--ngs-cart-line);
}

.shoptimizer-mini-cart-wrap .shoptimizer-custom-quantity-mini-cart_button {
	background: var(--ngs-cart-soft);
}
