/*
 * Direct Checkout Optimizer — Popup Checkout Styles
 */

/* =====================================================================
   Overlay
   ===================================================================== */

.dco-popup-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 999990;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.dco-popup-overlay.dco-popup-open {
	display: flex;
}

/* =====================================================================
   Dialog
   ===================================================================== */

.dco-popup-dialog {
	background: #fff;
	border-radius: 8px;
	width: 100%;
	max-width: 460px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	position: relative;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
	animation: dco-popup-in 0.22s ease;
}

@keyframes dco-popup-in {
	from { opacity: 0; transform: translateY(-14px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dco-popup-dialog__close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #787c82;
	padding: 4px 6px;
	border-radius: 3px;
	transition: color 0.15s, background 0.15s;
}

.dco-popup-dialog__close:hover {
	color: #1d2327;
	background: #f0f0f1;
}

.dco-popup-dialog h2 {
	margin: 0 0 16px;
	font-size: 20px;
	font-weight: 700;
	color: #1d2327;
	padding-right: 24px;
}

/* =====================================================================
   Product summary inside popup
   ===================================================================== */

.dco-popup-product {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 10px 12px;
	margin-bottom: 20px;
}

.dco-popup-product__img {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 4px;
}

.dco-popup-product__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dco-popup-product__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dco-popup-product__name {
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.dco-popup-product__price {
	font-size: 14px;
	color: #2271b1;
	font-weight: 500;
}

/* =====================================================================
   Form fields
   ===================================================================== */

.dco-popup-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 18px;
}

.dco-popup-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.dco-popup-field label {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.dco-required {
	color: #d63638;
	margin-left: 2px;
}

.dco-popup-field input[type="text"],
.dco-popup-field input[type="tel"],
.dco-popup-field input[type="email"],
.dco-popup-field input[type="number"],
.dco-popup-field textarea {
	width: 100%;
	padding: 9px 12px;
	font-size: 14px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	color: #1d2327;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.dco-popup-field input:focus,
.dco-popup-field textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.dco-popup-field textarea {
	resize: vertical;
	min-height: 68px;
}

/* =====================================================================
   Quantity control
   ===================================================================== */

.dco-popup-field--qty label {
	margin-bottom: 2px;
}

.dco-qty-control {
	display: flex;
	align-items: center;
	gap: 0;
	width: fit-content;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
}

.dco-qty-btn {
	background: #f0f0f1;
	border: none;
	padding: 8px 14px;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #1d2327;
	transition: background 0.15s;
}

.dco-qty-btn:hover { background: #dcdcde; }

.dco-qty-input {
	width: 52px !important;
	border: none !important;
	border-left: 1px solid #c3c4c7 !important;
	border-right: 1px solid #c3c4c7 !important;
	border-radius: 0 !important;
	text-align: center;
	box-shadow: none !important;
	-moz-appearance: textfield;
}

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

/* =====================================================================
   Error container
   ===================================================================== */

.dco-popup-error {
	background: #fce8e8;
	border: 1px solid #f0b8b8;
	color: #8a0000;
	padding: 10px 14px;
	border-radius: 4px;
	font-size: 13px;
	margin-bottom: 14px;
}

/* =====================================================================
   Submit button
   ===================================================================== */

.dco-popup-submit {
	width: 100%;
	padding: 13px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	border-radius: 4px;
	transition: opacity 0.2s;
	margin-bottom: 12px;
}

.dco-popup-submit:disabled,
.dco-popup-submit.dco-loading {
	opacity: 0.6;
	cursor: not-allowed;
}

/* =====================================================================
   Footer note & links
   ===================================================================== */

.dco-popup-footer-note {
	font-size: 12px;
	color: #787c82;
	text-align: center;
	margin: 0;
}

.dco-popup-std-checkout {
	color: #2271b1;
	text-decoration: underline;
	font-size: 12px;
}

/* =====================================================================
   Trigger button wrapper
   ===================================================================== */

.dco-popup-trigger-wrap {
	margin-top: 8px;
}

.dco-popup-trigger {
	width: 100%;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 480px) {
	.dco-popup-dialog {
		padding: 20px 16px 18px;
		max-height: 95vh;
	}
}
