/* Roastery Cart: cart page, header cart link and cart drawer.
   Colours and type come from the site's Bricks variables, with Figma values as fallbacks. */

.rcx {
	--rcx-text: var(--text, #2b2522);
	--rcx-text-2: var(--text-secondary, #706b68);
	--rcx-muted: var(--muted, #8a8684);
	--rcx-border: var(--border, #d4dbd2);
	--rcx-border-subtle: var(--border-subtle, #e9ede8);
	--rcx-control: var(--espresso-300, #c2bfbe);
	--rcx-input: var(--border-input, #8a8684);
	--rcx-brand: var(--brand, #52614d);
	--rcx-brand-strong: var(--sage-800, #3e4b3a);
	--rcx-brand-soft: var(--sage-50, #f5f7f5);
	--rcx-thumb: var(--sage-100, #e9ede8);
	--rcx-surface: var(--surface, #f7f7f6);
	--rcx-primary: var(--primary, #52614d);
	--rcx-primary-hover: var(--primary-hover, #3e4b3a);
	--rcx-on-primary: var(--on-primary, #fff);
	--rcx-danger: #a33a2c;
	--rcx-heading: var(--heading-font, 'Gloock', Georgia, serif);
	--rcx-transition: 0.15s ease;
	color: var(--rcx-text);
	font-size: 1rem;
	line-height: 1.5;
}

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

.rcc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.rcc-icon {
	flex-shrink: 0;
}

/* The icon set has no left arrow; the right one is mirrored. */
.rcc-icon-flip {
	transform: scaleX(-1);
}

.rcc-loading {
	padding: 4rem 0;
	color: var(--rcx-muted);
	text-align: center;
}

.rcx :focus-visible {
	outline: 2px solid var(--rcx-brand);
	outline-offset: 2px;
}

/* ---------- header cart link ---------- */

.rcc-cart-link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs, 0.5rem);
	color: var(--text, #2b2522);
	font-size: var(--modest, 0.875rem);
	font-weight: 600;
	line-height: 1.43;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.rcc-cart-link:hover {
	color: var(--text-brand, #52614d);
}

/* Bricks wraps shortcodes in a block div; keep the header row tight. */
.brxe-shortcode:has(> .rcc-cart-link) {
	display: flex;
	line-height: 0;
}

@media (max-width: 767px) {
	.rcc-cart-link-word {
		display: none;
	}
}

/* ---------- buttons ---------- */

.rcc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 3.25rem;
	padding: 0.875rem 1.5rem;
	border: 1.5px solid transparent;
	border-radius: var(--radius-m, 6px);
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--rcx-transition), border-color var(--rcx-transition), color var(--rcx-transition);
}

.rcc-btn-block {
	width: 100%;
}

.rcc-btn-primary {
	background: var(--rcx-primary);
	color: var(--rcx-on-primary);
}

.rcc-btn-primary:hover {
	background: var(--rcx-primary-hover);
	color: var(--rcx-on-primary);
}

.rcc-btn-outline {
	border-color: var(--rcx-brand);
	background: transparent;
	color: var(--rcx-brand-strong);
}

.rcc-btn-outline:hover {
	background: var(--rcx-brand-soft);
	color: var(--rcx-brand-strong);
}

.rcc-btn-soft {
	background: var(--rcx-thumb);
	color: var(--rcx-brand-strong);
}

.rcc-btn-soft:hover {
	background: var(--sage-200, #d4dbd2);
}

/* ---------- shared pieces ---------- */

.rcc-notice:empty {
	display: none;
}

.rcc-notice p {
	margin: 0 0 1rem;
	padding: 0.875rem 1rem;
	border-radius: var(--radius-m, 6px);
	background: #fbeeec;
	color: var(--rcx-danger);
	font-size: 0.875rem;
	font-weight: 600;
}

.rcc-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rcc-item {
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr) auto 8.75rem;
	grid-template-areas: "thumb info qty price";
	align-items: center;
	column-gap: 1.5rem;
	padding: 1.5rem 0;
	border-top: 1px solid var(--rcx-border-subtle);
	transition: opacity var(--rcx-transition);
}

.rcc-item:last-child {
	border-bottom: 1px solid var(--rcx-border-subtle);
}

.rcc-item.is-busy {
	opacity: 0.55;
	pointer-events: none;
}

.rcc-item-thumb {
	grid-area: thumb;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--radius-m, 6px);
	background: var(--rcx-thumb);
}

.rcc-item-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rcc-item-info {
	grid-area: info;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	min-width: 0;
}

.rcc-item-info p {
	margin: 0;
}

.rcc-item-meta {
	color: var(--rcx-brand);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.33;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.rcc-item-name {
	font-family: var(--rcx-heading);
	font-size: 1.75rem;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.rcc-item-name a {
	color: inherit;
	text-decoration: none;
}

.rcc-item-name a:hover {
	color: var(--rcx-brand);
}

.rcc-item-variant {
	color: var(--rcx-text-2);
	font-size: 0.875rem;
	line-height: 1.57;
}

.rcc-remove {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0;
	padding: 0.25rem 0;
	border: 0;
	background: none;
	color: var(--rcx-brand);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.01em;
	cursor: pointer;
}

.rcc-remove:hover {
	color: var(--rcx-brand-strong);
	text-decoration: underline;
}

.rcc-qty {
	grid-area: qty;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	justify-self: start;
	padding: 0 0.25rem;
	border: 1px solid var(--rcx-control);
	border-radius: var(--radius-m, 6px);
	background: var(--white, #fff);
}

.rcc-qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--radius-s, 4px);
	background: none;
	color: var(--rcx-text);
	cursor: pointer;
}

.rcc-qty-btn:hover:not(:disabled) {
	color: var(--rcx-brand);
}

.rcc-qty-btn:disabled {
	color: var(--rcx-control);
	cursor: not-allowed;
}

.rcc-qty-value {
	min-width: 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.rcc-item-price {
	grid-area: price;
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.33;
	text-align: right;
	white-space: nowrap;
}

.rcc-free {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	padding: 1rem 1.25rem;
	border-radius: var(--radius-l, 10px);
	background: var(--rcx-brand-soft);
}

.rcc-free-text {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	margin: 0;
	color: var(--rcx-brand);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.43;
}

.rcc-free-text .rcc-icon {
	margin-top: 1px;
}

.rcc-free-bar {
	height: 6px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--sage-200, #d4dbd2);
}

.rcc-free-bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--rcx-brand);
	transition: width 0.4s ease;
}

.rcc-rows {
	margin: 0;
}

.rcc-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.375rem 0;
}

.rcc-row dt {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	color: var(--rcx-text-2);
	font-size: 1rem;
	line-height: 1.625;
}

.rcc-row dd {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: right;
	white-space: nowrap;
}

.rcc-row-coupon dt {
	color: var(--rcx-brand);
	font-weight: 600;
}

.rcc-row-coupon dd {
	color: var(--rcx-brand);
}

.rcc-coupon-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--rcx-text-2);
	cursor: pointer;
}

.rcc-coupon-remove:hover {
	background: var(--rcx-thumb);
	color: var(--rcx-text);
}

.rcc-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding: 4rem 0;
	text-align: center;
}

.rcc-empty-title {
	margin: 0;
	font-family: var(--rcx-heading);
	font-size: 1.75rem;
	line-height: 1.2;
}

.rcc-empty-text {
	max-width: 26rem;
	margin: 0 0 0.5rem;
	color: var(--rcx-text-2);
}

/* ---------- loading skeleton ---------- */

.rcc-skel {
	display: block;
	height: 1em;
	border-radius: var(--radius-xs, 2px);
	background: linear-gradient(90deg, var(--rcx-thumb) 0%, var(--rcx-brand-soft) 50%, var(--rcx-thumb) 100%);
	background-size: 200% 100%;
	animation: rcc-shimmer 1.4s ease-in-out infinite;
}

@keyframes rcc-shimmer {
	from { background-position: 100% 0; }
	to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.rcc-skel {
		animation: none;
	}
}

.rcc-skel-count { width: 4.5rem; height: 1.125rem; }
.rcc-skel-meta { width: 11rem; max-width: 70%; height: 0.75rem; margin: 0.125rem 0; }
.rcc-skel-name { width: 9rem; max-width: 80%; height: 1.625rem; margin: 0.125rem 0; }
.rcc-skel-variant { width: 6rem; height: 0.875rem; margin: 0.25rem 0; }
.rcc-skel-remove { width: 4rem; height: 0.875rem; margin: 0.375rem 0; }
.rcc-skel-price { width: 5.5rem; height: 1.125rem; margin-left: auto; }
.rcc-skel-value { width: 5rem; height: 1rem; margin: 0.125rem 0 0.125rem auto; }
.rcc-skel-total { width: 7rem; height: 1.5rem; margin: 0.25rem 0 0.25rem auto; }
.rcc-skel-free { width: 70%; height: 0.875rem; margin: 0.1875rem 0; }
.rcc-skel-free + .rcc-skel-free { display: none; width: 30%; margin-top: -0.4375rem; } /* cancels the box's 10px gap: 2nd line adds 20px */

/* The "free shipping reached" message wraps to two lines on phones. */
@media (max-width: 560px) {
	.rcc-free.is-long .rcc-skel-free + .rcc-skel-free { display: block; }
}

.rcc-qty.rcc-skel-qty {
	width: 6.5rem;
	height: 2.875rem;
	border-color: var(--rcx-border-subtle);
}

.rcc-item.is-skeleton .rcc-item-thumb {
	background: var(--rcx-thumb);
}

.rcc-drawer-root .rcc-qty.rcc-skel-qty {
	width: 5.5rem;
	height: 2.5rem;
}

.rcc-drawer-root .rcc-skel-name {
	height: 1.25rem;
}

.rcc-drawer-root .rcc-skel-remove {
	display: none;
}

.rcc-coupon input:disabled,
.rcc-coupon button:disabled {
	cursor: wait;
}

/* ---------- cart page ---------- */

.rcc-page {
	padding: 3rem 0 6rem;
}

.rcc-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 1rem;
	padding-bottom: 2rem;
}

.rcc-title {
	margin: 0;
	font-family: var(--rcx-heading);
	font-size: clamp(2.75rem, 2.1rem + 2.8vw, 4.5rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.008em;
}

.rcc-head-count {
	margin: 0;
	color: var(--rcx-muted);
	font-size: 1.125rem;
	line-height: 1.67;
}

.rcc-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 27.5rem;
	align-items: start;
	gap: 4rem;
}

.rcc-main {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 0;
}

.rcc-back {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.5rem;
	padding: 0.25rem 0;
	color: var(--rcx-brand);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
}

.rcc-back:hover {
	color: var(--rcx-brand-strong);
	text-decoration: underline;
}

.rcc-summary {
	position: sticky;
	top: calc(var(--header-height, 4.5rem) + 1.5rem + var(--wp-admin--admin-bar--height, 0px));
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 2rem;
	border-radius: var(--radius-xl, 16px);
	background: var(--rcx-surface);
}

.rcc-summary-title {
	margin: 0 0 0.25rem;
	font-family: var(--rcx-heading);
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.rcc-coupon {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 0.5rem;
	padding: 0.75rem 0 0.5rem;
}

.rcc-coupon-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 0;
}

.rcc-coupon-field label {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.33;
	letter-spacing: 0.01em;
}

.rcc-coupon-field input {
	width: 100%;
	height: 3.25rem;
	padding: 0 1rem;
	border: 1px solid var(--rcx-input);
	border-radius: var(--radius-m, 6px);
	background: var(--white, #fff);
	color: var(--rcx-text);
	font: inherit;
	font-size: 1rem;
}

.rcc-coupon-field input::placeholder {
	color: var(--rcx-muted);
}

.rcc-coupon-field input:focus {
	border-color: var(--rcx-brand);
	outline: 2px solid var(--rcx-brand);
	outline-offset: 0;
}

.rcc-coupon-field.has-error input {
	border-color: var(--rcx-danger);
}

.rcc-error {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--rcx-danger);
	font-size: 0.875rem;
	font-weight: 600;
}

.rcc-total {
	margin-top: 0.25rem;
	border-top: 1px solid var(--rcx-border);
}

.rcc-total .rcc-row {
	padding: 1rem 0;
}

.rcc-total dt {
	color: var(--rcx-text);
	font-weight: 600;
	line-height: 1.25;
}

.rcc-total dd {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.33;
}

.rcc-hint {
	margin: 0.25rem 0 0;
	color: var(--rcx-muted);
	font-size: 0.75rem;
	line-height: 1.33;
}

.rcc-perks {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	margin: 0.5rem 0 0;
	padding: 1rem 0 0;
	border-top: 1px solid var(--rcx-border-subtle);
	list-style: none;
}

.rcc-perks li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--rcx-text-2);
	font-size: 0.875rem;
	line-height: 1.57;
}

@media (max-width: 1199px) {
	.rcc-layout {
		grid-template-columns: minmax(0, 1fr) 23rem;
		gap: 2.5rem;
	}

	.rcc-item {
		grid-template-columns: 6rem minmax(0, 1fr) auto 7rem;
		column-gap: 1.25rem;
	}
}

@media (max-width: 991px) {
	.rcc-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.rcc-summary {
		position: static;
	}
}

/* Narrow screens and the drawer share the stacked item layout. */
@media (max-width: 767px) {
	.rcc-page {
		padding: 2rem 0 4rem;
	}

	.rcc-page .rcc-item {
		grid-template-columns: 5.5rem minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb info info"
			"thumb qty price";
		align-items: start;
		column-gap: 1rem;
		row-gap: 0.75rem;
		padding: 1.25rem 0;
	}

	.rcc-page .rcc-item-name {
		font-size: 1.25rem;
	}

	.rcc-page .rcc-skel-name {
		height: 1.25rem;
	}

	.rcc-page .rcc-qty,
	.rcc-page .rcc-item-price {
		align-self: center;
	}

	.rcc-summary {
		padding: 1.5rem;
	}
}

/* ---------- drawer ---------- */

html.rcc-lock {
	overflow: hidden;
}

.rcc-drawer-root {
	position: fixed;
	inset: 0;
	z-index: 100000; /* above the WordPress admin bar (99999) */
}

.rcc-drawer-root[hidden] {
	display: none;
}

.rcc-drawer-overlay {
	position: absolute;
	inset: 0;
	background: rgb(43 37 34 / 0.6);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.rcc-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(30rem, 100%);
	background: var(--white, #fff);
	box-shadow: -8px 0 32px rgb(0 0 0 / 0.2);
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.rcc-drawer-root.is-open .rcc-drawer-overlay {
	opacity: 1;
}

.rcc-drawer-root.is-open .rcc-drawer-panel {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.rcc-drawer-overlay,
	.rcc-drawer-panel {
		transition: none;
	}
}

.rcc-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.5rem 2rem;
}

.rcc-drawer-title {
	margin: 0;
	font-family: var(--rcx-heading);
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.rcc-drawer-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--rcx-control);
	border-radius: 50%;
	background: none;
	color: var(--rcx-text);
	cursor: pointer;
	transition: border-color var(--rcx-transition), background-color var(--rcx-transition);
}

.rcc-drawer-close:hover {
	border-color: var(--rcx-text);
}

.rcc-drawer-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.rcc-drawer-free {
	padding: 0 2rem 1rem;
}

.rcc-drawer-body {
	flex: 1;
	min-height: 0;
	padding: 0 2rem 1rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rcc-drawer-body .rcc-loading {
	padding: 3rem 0;
}

.rcc-drawer-root .rcc-item {
	grid-template-columns: 5.5rem minmax(0, 1fr) auto;
	grid-template-areas:
		"thumb info info"
		"thumb qty price";
	align-items: start;
	column-gap: 1rem;
	row-gap: 0.5rem;
	padding: 1.25rem 0;
}

.rcc-drawer-root .rcc-item-thumb {
	border-radius: var(--radius-s, 4px);
}

.rcc-drawer-root .rcc-item-info {
	gap: 0.25rem;
}

.rcc-drawer-root .rcc-item-name {
	font-size: 1.25rem;
}

.rcc-drawer-root .rcc-item-variant {
	font-size: 0.75rem;
	line-height: 1.33;
}

.rcc-drawer-root .rcc-qty,
.rcc-drawer-root .rcc-item-price {
	align-self: center;
}

.rcc-drawer-root .rcc-qty-btn {
	width: 2rem;
	height: 2.375rem;
}

.rcc-drawer-root .rcc-qty-value {
	font-size: 0.875rem;
}

.rcc-drawer-foot {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.5rem 2rem 2rem;
	border-top: 1px solid var(--rcx-border-subtle);
	background: var(--white, #fff);
}

.rcc-drawer-actions {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	padding-top: 0.75rem;
}

.rcc-drawer-root .rcc-empty {
	padding: 3rem 0;
}

@media (max-width: 478px) {
	.rcc-drawer-head,
	.rcc-drawer-free,
	.rcc-drawer-body,
	.rcc-drawer-foot {
		padding-right: 1.25rem;
		padding-left: 1.25rem;
	}

	.rcc-drawer-head {
		padding-top: 1rem;
		padding-bottom: 1rem;
	}

	.rcc-drawer-foot {
		padding-top: 1rem;
		padding-bottom: 1.25rem;
	}

	.rcc-drawer-title {
		font-size: 1.75rem;
	}
}

/* ---------- quick add buttons (product cards) ---------- */

[data-rcx-quick-add].is-busy {
	opacity: 0.6;
	pointer-events: none;
}

[data-rcx-quick-add].is-added {
	background-color: var(--sage-800, #3e4b3a);
}
