/**
 * Cart Upsell Popup - frontend styles.
 * Colors are exposed as CSS variables so themes can override them without
 * touching this file.
 */

:root {
	--cup-color-primary: #a55166;
	--cup-color-primary-contrast: #ffffff;
	--cup-color-accent: #f3e9eb;
	--cup-color-accent-contrast: #2b2b2b;
	--cup-color-surface: #ffffff;
	--cup-color-text: #2b2b2b;
	--cup-color-muted: #6b7280;
	--cup-color-border: #e4dadc;
	--cup-color-overlay: rgba( 44, 24, 30, 0.55 );
	--cup-radius: 14px;
	--cup-shadow: 0 20px 50px rgba( 0, 0, 0, 0.25 );
}

body.cup-no-scroll {
	overflow: hidden;
}

.cup-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var( --cup-color-overlay );
	opacity: 0;
	transition: opacity 0.25s ease;
	box-sizing: border-box;
}

.cup-overlay[hidden] {
	display: none;
}

.cup-overlay--visible {
	opacity: 1;
}

.cup-modal {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	background: var( --cup-color-surface );
	color: var( --cup-color-text );
	border-radius: var( --cup-radius );
	box-shadow: var( --cup-shadow );
	padding: 28px 24px 24px;
	box-sizing: border-box;
	transform: translateY( 12px ) scale( 0.98 );
	transition: transform 0.25s ease;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cup-overlay--visible .cup-modal {
	transform: translateY( 0 ) scale( 1 );
}

.cup-modal:focus {
	outline: none;
}

.cup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	color: var( --cup-color-muted );
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cup-close:hover,
.cup-close:focus-visible {
	background: var( --cup-color-border );
	color: var( --cup-color-text );
}

.cup-modal-title {
	margin: 0 32px 20px 0;
	font-size: 26px;
	font-weight: 600;
	color: var( --cup-color-text );
}

.cup-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
	padding-bottom: 4px;
	padding-right: 2px;
}
.cup-list {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #A55166 transparent;
}
/* Chrome, Safari, Edge */
.cup-list::-webkit-scrollbar {
    width: 6px;
}
.cup-list::-webkit-scrollbar-track {
    background: transparent;
}
.cup-list::-webkit-scrollbar-thumb {
    background: #A55166;
    border-radius: 10px;
}
.cup-list::-webkit-scrollbar-thumb:hover {
    background: #8f4357;
}
.cup-list:focus {
	outline: none;
}

.cup-row {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var( --cup-color-border );
	border-radius: var( --cup-radius );
	padding: 10px;
	background: var( --cup-color-surface );
	box-sizing: border-box;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.cup-row--added {
	background: var( --cup-color-accent );
}

.cup-row-select {
	flex: 0 0 auto;
	display: flex;
}

.cup-row-select input[type='checkbox'] {
	width: 20px;
	height: 20px;
	accent-color: var( --cup-color-primary );
	cursor: pointer;
}

.cup-row-select input[type='checkbox']:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.cup-row-image {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	overflow: hidden;
	border-radius: calc( var( --cup-radius ) - 6px );
	background: var( --cup-color-border );
}

.cup-row .cup-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cup-row-details {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cup-row-name {
	font-size: 14px;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cup-row-price {
	font-size: 14px;
	color: #000;
}

.cup-row-price ins {
	text-decoration: none;
	color: var( --cup-color-text );
}

.cup-row-added-label {
	font-size: 12px;
	font-weight: 600;
	color: var( --cup-color-primary );
}

.cup-variations {
	width: 100%;
	max-width: 220px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 2px;
}

.cup-variation-select {
	width: 100%;
	min-height: 36px;
	padding: 4px 10px;
	border: 1px solid var( --cup-color-border );
	border-radius: calc( var( --cup-radius ) - 8px );
	background: var( --cup-color-surface );
	color: var( --cup-color-text );
	font-size: 13px;
	appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 8px;
	padding-right: 25px;
}

.cup-variation-select:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.cup-row-qty {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cup-qty-btn {
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	border: 1px solid var( --cup-color-border );
	border-radius: 50%;
	background: var( --cup-color-surface );
	color: var( --cup-color-text );
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cup-qty-btn:hover:not(:disabled) {
	background: var( --cup-color-accent );
}

.cup-qty-btn:disabled,
.cup-qty-input:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.cup-qty-input {
	width: 36px;
	min-height: 28px;
	border: 1px solid var( --cup-color-border );
	border-radius: 6px;
	background: var( --cup-color-surface );
	color: var( --cup-color-text );
	font-size: 14px;
	text-align: center;
	appearance: textfield;
	-moz-appearance: textfield;
}

.cup-qty-input::-webkit-outer-spin-button,
.cup-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cup-status {
	min-height: 1.2em;
	margin: 14px 0 0;
	font-size: 0.9rem;
	color: var( --cup-color-muted );
}
p.cup-status:empty {
    display: none;
}
.cup-footer {
	flex: 0 0 auto;
	margin-top: 18px;
	border-top: 1px solid var( --cup-color-border );
	padding-top: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cup-add-selected-btn,
.cup-complete-btn {
	width: 100%;
	min-height: 50px;
	border: none;
	border-radius: 100px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.cup-add-selected-btn {
	background: var( --e-global-color-ef99091 );
	color: #FFF;
}

.cup-complete-btn {
	background: transparent;
	color: var( --cup-color-text );
	border: 1px solid var( --cup-color-border );
}

.cup-add-selected-btn:hover:not(:disabled),
.cup-complete-btn:hover:not(:disabled) {
	opacity: 0.92;
}

.cup-add-selected-btn:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.cup-add-selected-btn:focus-visible,
.cup-close:focus-visible,
.cup-complete-btn:focus-visible {
	outline: 3px solid var( --cup-color-accent );
	outline-offset: 2px;
}

@media ( max-width: 900px ) {
	.cup-modal-title {
		margin: 0 30px 16px 0;
		font-size: 20px;
	}
}

@media ( max-width: 560px ) {
	.cup-modal {
		padding: 22px 16px 18px;
		border-radius: 12px;
	}

	.cup-row {
		flex-wrap: wrap;
	}

	.cup-row-details {
		flex-basis: calc( 100% - 32px - 64px - 12px - 12px );
	}

	.cup-row-qty {
		flex-basis: 100%;
		justify-content: flex-end;
		margin-top: 4px;
	}
}

@media ( prefers-color-scheme: dark ) {
	:root:not( [data-cup-theme='light'] ) {
		--cup-color-surface: #1f2430;
		--cup-color-text: #f3f4f6;
		--cup-color-muted: #9ca3af;
		--cup-color-border: #333a48;
		--cup-color-overlay: rgba( 0, 0, 0, 0.7 );
	}
}
