/**
 * CWS Suite mini cart drawer in the StolesRaceShop / RedParts look.
 *
 * The suite's stylesheet prints late (footer) and Elementor styles
 * .elementor-button through the kit, so every rule starts from body to win
 * on specificity whatever the load order.
 *
 * Colours follow the RedParts theme options: primary button #ffca05 with
 * #1e1e1e text, #333 / #fff on hover.
 */

body .cws-cart-wrap {
	--srs-primary: #ffca05;
	--srs-primary-ink: #1e1e1e;
	--srs-hover: #333333;
	--srs-text: #262626;
	--srs-muted: #6c757d;
	--srs-line: #ebebeb;
	--srs-soft: #f5f5f5;
	--srs-radius: 2px;

	background: rgba(0, 0, 0, 0.5);
	color: var(--srs-text);
}

body .cws-cart-wrap .cws-cart-content {
	box-shadow: 0 0 24px rgba(0, 0, 0, 0.15);
}

/* ---- Head: logo --------------------------------------------------------- */

body .cws-cart-wrap .cws-cart-title {
	padding: 20px 20px 18px;
	border-bottom: 1px solid var(--srs-line);
}

body .cws-cart-wrap .cws-cart-title img {
	max-width: 190px;
	height: auto;
}

/* ---- Item list ---------------------------------------------------------- */

body .cws-cart-wrap .cws-cart-items-wrap {
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d9d9d9 transparent;
}

body .cws-cart-wrap .cws-minicart-item-wrap {
	padding: 0 20px;
}

body .cws-cart-wrap .cws-minicart-item-wrap .cws-minicart-item-content {
	align-items: flex-start;
	gap: 14px;
	padding: 18px 28px 18px 0;
	border-bottom: 1px solid var(--srs-line);
}

body .cws-cart-wrap .minicart-item-image {
	flex: 0 0 72px;
	max-width: 72px;
	height: 72px;
	padding: 4px;
	border: 1px solid var(--srs-line);
	border-radius: var(--srs-radius);
	background: #fff;
}

body .cws-cart-wrap .minicart-item-data {
	flex: 1;
	min-width: 0;
	gap: 10px;
}

body .cws-cart-wrap .minicart-item-name {
	display: block;
	color: var(--srs-text);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none;
	overflow-wrap: anywhere;
}

body .cws-cart-wrap .minicart-item-name:hover {
	color: var(--srs-text);
	text-decoration: underline;
}

body .cws-cart-wrap .item-attrs {
	margin-top: 4px;
}

body .cws-cart-wrap .single-cart-item-attr {
	color: var(--srs-muted);
	font-size: 13px;
	line-height: 1.4;
}

body .cws-cart-wrap .single-cart-item-attr .attr-name {
	font-weight: 500;
}

/* ---- Quantity + prices -------------------------------------------------- */

body .cws-cart-wrap .minicart-price-data {
	gap: 10px;
	font-size: 14px;
	color: var(--srs-muted);
}

body .cws-cart-wrap .cws-quantity-input {
	height: 32px;
	border: 1px solid var(--srs-line);
	border-radius: var(--srs-radius);
	background: #fff;
	overflow: hidden;
}

body .cws-cart-wrap .cws-decrease-quantity,
body .cws-cart-wrap .cws-increase-quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 100%;
	padding: 9px;
	cursor: pointer;
	transition: background-color 0.15s;
}

body .cws-cart-wrap .cws-decrease-quantity:hover,
body .cws-cart-wrap .cws-increase-quantity:hover {
	background: var(--srs-soft);
}

body .cws-cart-wrap .cws-decrease-quantity svg path,
body .cws-cart-wrap .cws-increase-quantity svg path {
	stroke: var(--srs-text);
}

body .cws-cart-wrap .cws-quantity-input .cws-quantity {
	min-width: 26px;
	color: var(--srs-text);
	font-size: 14px;
	font-weight: 500;
	text-align: center;
}

body .cws-cart-wrap .qunatitiy-multiplier {
	color: var(--srs-muted);
}

body .cws-cart-wrap .cws-single-item-price,
body .cws-cart-wrap .cws-single-item-price .amount {
	color: var(--srs-muted);
}

body .cws-cart-wrap .cws-single-item-total-price,
body .cws-cart-wrap .cws-single-item-total-price .amount {
	color: var(--srs-text);
	font-size: 16px;
	font-weight: 700;
}

/* ---- Remove: small grey × at the top right instead of the red circle ---- */

body .cws-cart-wrap .cws-remove-from-cart {
	top: 18px;
	right: 0;
	left: auto;
	width: 22px;
	height: 22px;
	padding: 6px;
	border-radius: var(--srs-radius);
	background: var(--srs-soft);
}

body .cws-cart-wrap .cws-remove-from-cart svg path {
	stroke: #999999;
	stroke-width: 4px;
}

body .cws-cart-wrap .cws-remove-from-cart:hover {
	background: var(--srs-hover);
}

body .cws-cart-wrap .cws-remove-from-cart:hover svg path {
	stroke: #ffffff;
}

/* ---- Empty state -------------------------------------------------------- */

body .cws-cart-wrap .cws-suite.empty-cart-notice {
	padding: 40px 20px;
	color: var(--srs-muted);
	font-size: 15px;
	text-align: center;
}

/* ---- Footer: total + buttons -------------------------------------------- */

body .cws-cart-wrap .cws-cart-footer {
	padding: 18px 20px 20px;
	border-top: 1px solid var(--srs-line);
	background: #fafafa;
}

body .cws-cart-wrap .minicart-total-data {
	align-items: baseline;
	margin-bottom: 14px;
	padding-bottom: 0;
	font-size: 16px;
}

body .cws-cart-wrap .minicart-total-data .minicart-total {
	color: var(--srs-text);
	font-weight: 500;
}

body .cws-cart-wrap .minicart-total-data .minicart-value,
body .cws-cart-wrap .minicart-total-data .minicart-value .amount {
	color: var(--srs-text);
	font-size: 20px;
	font-weight: 700;
}

body .cws-cart-wrap .minicartcart-actions {
	gap: 10px;
}

body .cws-cart-wrap .minicartcart-actions .cws-cart-checkout-action {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--srs-radius);
	background: var(--srs-primary);
	color: var(--srs-primary-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	fill: var(--srs-primary-ink);
	transition: background-color 0.15s, color 0.15s;
}

body .cws-cart-wrap .minicartcart-actions .cws-cart-checkout-action:hover {
	background: var(--srs-hover);
	color: #ffffff;
	fill: #ffffff;
}

body .cws-cart-wrap .minicartcart-actions .cws-cart-checkout-action.view-cart {
	border: 0;
	background: #f0f0f0;
	color: var(--srs-text);
	fill: var(--srs-text);
}

body .cws-cart-wrap .minicartcart-actions .cws-cart-checkout-action.view-cart:hover {
	background: #e5e5e5;
	color: var(--srs-text);
	fill: var(--srs-text);
}

/* ---- "Dodaj u košaricu" while the AJAX add runs ------------------------- */
/* Class set by assets/js/cws-single-add-to-cart.js. Same look as the spinner RedParts
   draws on product-card buttons, with a dark ring because this
   button is yellow with dark text. */

body form.cart .single_add_to_cart_button.loading {
	position: relative;
	color: transparent !important;
	cursor: default;
	pointer-events: none;
}

body form.cart .single_add_to_cart_button.loading::after {
	content: "";
	position: absolute;
	top: calc(50% - 11px);
	left: calc(50% - 11px);
	display: block;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	border: 2px solid rgba(30, 30, 30, 0.2);
	border-top-color: var(--th-btn-primary-normal-font-color, #1e1e1e);
	border-radius: 11px;
	opacity: 1;
	animation: srs-atc-spin 0.5s linear infinite;
}

@keyframes srs-atc-spin {
	to {
		transform: rotate(360deg);
	}
}
