/* Popup cart (ocmodpcart), CrazyCarp colours */
.pcart-modal {
	--pcart-navy: #1b223a;
	--pcart-slate: #3a4754;
	--pcart-accent: #38afc8;
	--pcart-green: #50ad55;
	--pcart-green-dark: #43944a;
	--pcart-red: #dd0e1c;
	--pcart-text: #333;
	--pcart-muted: #7a8494;
	--pcart-line: #e3e7ec;
	--pcart-bg: #f3f5f8;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	font-family: Roboto, Arial, sans-serif;
	color: var(--pcart-text);
}

.pcart-modal[hidden] {
	display: none;
}

.pcart-modal *,
.pcart-modal *::before,
.pcart-modal *::after {
	box-sizing: border-box;
}

html.pcart-open,
html.pcart-open body {
	overflow: hidden;
}

/* The Journal mini cart is replaced by the popup */
html.pcart-on #cart .cart-content,
html.pcart-on .mobile-cart-content-container {
	display: none !important;
}

.pcart-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 20, 35, .6);
	opacity: 0;
	transition: opacity .2s ease;
}

.pcart-dialog {
	position: relative;
	width: 100%;
	max-width: 1080px;
	max-height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	background: var(--pcart-bg);
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transition: opacity .2s ease, transform .2s ease;
	outline: none;
}

.pcart-modal.is-open .pcart-overlay,
.pcart-modal.is-open .pcart-dialog {
	opacity: 1;
}

.pcart-modal.is-open .pcart-dialog {
	transform: none;
}

.pcart-body {
	min-height: 160px;
}

/* Loader */
.pcart-loader {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(243, 245, 248, .6);
	border-radius: inherit;
	z-index: 5;
}

.pcart-modal.is-loading .pcart-loader {
	display: flex;
}

.pcart-loader span {
	width: 36px;
	height: 36px;
	border: 3px solid var(--pcart-line);
	border-top-color: var(--pcart-accent);
	border-radius: 50%;
	animation: pcart-spin .7s linear infinite;
}

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

/* Content */
.pcart {
	position: relative;
	padding: 32px 32px 28px;
}

.pcart button {
	font-family: inherit;
	cursor: pointer;
}

.pcart-close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pcart-navy);
	transition: background-color .15s;
}

.pcart-close:hover {
	background: var(--pcart-line);
}

.pcart-title {
	margin: 0 48px 24px 0;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--pcart-navy);
}

.pcart-alert {
	margin-bottom: 16px;
	padding: 12px 16px;
	border-radius: 8px;
	background: #fdecea;
	color: #a1141d;
	font-size: 14px;
}

.pcart-items {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pcart-item {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr) auto 150px 40px;
	align-items: center;
	gap: 24px;
	padding: 20px 24px;
	background: #fff;
	border-radius: 12px;
}

.pcart-image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 120px;
	height: 120px;
	border: 1px solid var(--pcart-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.pcart-image img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	height: auto;
}

.pcart-image-voucher {
	color: var(--pcart-accent);
}

.pcart-name {
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--pcart-navy);
	text-decoration: none;
}

a.pcart-name:hover {
	color: var(--pcart-accent);
}

.pcart-nostock {
	color: var(--pcart-red);
	font-weight: 700;
}

.pcart-code,
.pcart-option {
	margin-top: 6px;
	font-size: 13px;
	color: var(--pcart-muted);
}

/* Quantity */
.pcart-qty {
	display: flex;
	align-items: center;
	gap: 12px;
}

.pcart-qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pcart-navy);
	transition: background-color .15s, color .15s;
}

.pcart-qty-btn svg {
	width: 26px;
	height: auto;
}

.pcart-qty-btn:hover {
	background: var(--pcart-bg);
	color: var(--pcart-accent);
}

.pcart-qty-input {
	width: 72px;
	height: 44px;
	padding: 0 4px;
	border: 1px solid #c9d0d8;
	border-radius: 6px;
	background: #fff;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	text-align: center;
	color: var(--pcart-navy);
}

.pcart-qty-input:focus {
	border-color: var(--pcart-accent);
	outline: none;
	box-shadow: 0 0 0 3px rgba(56, 175, 200, .2);
}

/* Price */
.pcart-price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	white-space: nowrap;
}

.pcart-price-normal,
.pcart-price-new {
	font-size: 24px;
	font-weight: 700;
	color: var(--pcart-navy);
}

.pcart-price-new {
	color: var(--pcart-red);
}

.pcart-price-old {
	font-size: 16px;
	font-weight: 500;
	color: var(--pcart-muted);
	text-decoration: line-through;
}

/* Row actions */
.pcart-actions {
	position: relative;
	display: flex;
	justify-content: center;
}

.pcart-actions-btn,
.pcart-remove-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pcart-navy);
}

.pcart-actions-btn:hover,
.pcart-actions.is-open .pcart-actions-btn,
.pcart-remove-icon:hover {
	background: var(--pcart-bg);
}

.pcart-menu {
	position: absolute;
	top: 50%;
	right: 44px;
	z-index: 3;
	display: none;
	min-width: 230px;
	padding: 8px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(27, 34, 58, .18);
	transform: translateY(-50%);
}

.pcart-actions.is-open .pcart-menu {
	display: block;
}

.pcart-menu button {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 12px 14px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font-size: 16px;
	font-weight: 500;
	text-align: left;
	color: var(--pcart-navy);
	white-space: nowrap;
}

.pcart-menu button svg {
	flex: 0 0 auto;
	width: 24px;
	color: var(--pcart-slate);
}

.pcart-menu button:hover {
	background: var(--pcart-bg);
}

.pcart-menu .pcart-remove:hover,
.pcart-menu .pcart-remove:hover svg {
	color: var(--pcart-red);
}

/* Footer */
.pcart-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 28px;
}

.pcart-continue {
	padding: 14px 32px;
	border: 2px solid var(--pcart-navy);
	border-radius: 999px;
	background: transparent;
	font-size: 16px;
	font-weight: 500;
	color: var(--pcart-navy);
	transition: background-color .15s, color .15s;
}

.pcart-continue:hover {
	background: var(--pcart-navy);
	color: #fff;
}

.pcart-summary {
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 22px 28px;
	background: var(--pcart-navy);
	border-radius: 14px;
	color: #fff;
}

.pcart-total {
	display: flex;
	flex-direction: column;
	font-size: 34px;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
}

.pcart-total-label {
	font-size: 13px;
	font-weight: 400;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .65);
}

.pcart-checkout {
	display: inline-block;
	padding: 15px 30px;
	border-radius: 999px;
	background: var(--pcart-green);
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	text-align: center;
	text-decoration: none;
	transition: background-color .15s;
}

.pcart-checkout:hover,
.pcart-checkout:focus {
	background: var(--pcart-green-dark);
	color: #fff;
	text-decoration: none;
}

/* Empty cart */
.pcart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 16px 0 8px;
	text-align: center;
	color: var(--pcart-muted);
}

.pcart-empty p {
	margin: 0;
	font-size: 16px;
}

/* Tablet */
@media (max-width: 900px) {
	.pcart {
		padding: 24px 20px 20px;
	}

	.pcart-title {
		font-size: 26px;
	}

	.pcart-item {
		grid-template-columns: 96px minmax(0, 1fr) auto 40px;
		grid-template-areas:
			"image info info actions"
			"image qty price price";
		gap: 12px 16px;
		padding: 16px;
	}

	.pcart-image {
		grid-area: image;
		width: 96px;
		height: 96px;
		align-self: start;
	}

	.pcart-info { grid-area: info; }
	.pcart-qty { grid-area: qty; }
	.pcart-price { grid-area: price; }
	.pcart-actions { grid-area: actions; align-self: start; }

	.pcart-name {
		font-size: 16px;
	}

	.pcart-price-normal,
	.pcart-price-new {
		font-size: 20px;
	}

	.pcart-footer {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.pcart-summary {
		justify-content: space-between;
	}
}

/* Phone */
@media (max-width: 560px) {
	.pcart-modal {
		align-items: flex-end;
		padding: 0;
	}

	.pcart-dialog {
		max-height: 92vh;
		border-radius: 16px 16px 0 0;
	}

	.pcart {
		padding: 20px 16px 16px;
	}

	.pcart-close {
		top: 10px;
		right: 8px;
	}

	.pcart-title {
		margin-bottom: 16px;
		font-size: 22px;
	}

	.pcart-items {
		gap: 10px;
	}

	.pcart-item {
		grid-template-columns: 72px minmax(0, 1fr) 36px;
		grid-template-areas:
			"image info actions"
			"qty qty price";
		gap: 12px;
		padding: 12px;
	}

	.pcart-image {
		width: 72px;
		height: 72px;
	}

	.pcart-qty {
		gap: 6px;
	}

	.pcart-qty-btn {
		width: 36px;
		height: 36px;
	}

	.pcart-qty-btn svg {
		width: 20px;
	}

	.pcart-qty-input {
		width: 56px;
		height: 38px;
		font-size: 16px;
	}

	.pcart-menu {
		top: 100%;
		right: 0;
		min-width: 210px;
		transform: none;
	}

	.pcart-summary {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 16px;
		text-align: center;
	}

	.pcart-total {
		align-items: center;
		font-size: 28px;
	}

	.pcart-checkout,
	.pcart-continue {
		width: 100%;
	}

	.pcart-footer {
		gap: 12px;
		margin-top: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcart-overlay,
	.pcart-dialog {
		transition: none;
	}

	.pcart-loader span {
		animation-duration: 2s;
	}
}
