/*
 * OrderCraft Direct Order Form. All colors/radius come from CSS custom
 * properties set inline per-instance (see direct-order-form.php) so a
 * theme/layout change from settings never requires touching this file.
 */

.oc-do-wrap {
	--oc-do-primary: #16a34a;
	--oc-do-accent: #f97316;
	--oc-do-text: #111827;
	--oc-do-bg: #f5faf5;
	--oc-do-radius: 14px;

	max-width: 560px;
	margin: 1.5em 0;
	padding: 1.25em 1.4em;
	color: var(--oc-do-text);
	font-size: 0.95em;
}

.oc-do-layout-detailed-card,
.oc-do-layout-compact-card {
	background: var(--oc-do-bg);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--oc-do-radius);
}

.oc-do-layout-compact-flat {
	padding-inline: 0;
}

/* Variation / attribute selector */

.oc-do-attr-group {
	margin-bottom: 1em;
}

.oc-do-attr-label {
	display: block;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.8em;
	margin-bottom: 0.5em;
}

.oc-do-attr-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.oc-do-attr-btn {
	min-width: 48px;
	min-height: 44px;
	padding: 0.5em 0.9em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-weight: 600;
}

.oc-do-attr-btn.is-selected {
	border-color: var(--oc-do-primary);
	color: var(--oc-do-primary);
	box-shadow: inset 0 0 0 1px var(--oc-do-primary);
}

.oc-do-attr-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.oc-do-size-guide-link {
	appearance: none;
	background: none;
	border: none;
	color: var(--oc-do-primary);
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	margin-bottom: 1em;
	display: inline-block;
}

.oc-do-size-guide-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 1em;
}

.oc-do-size-guide-content {
	background: #fff;
	border-radius: 10px;
	padding: 1.5em;
	max-width: 500px;
	max-height: 80vh;
	overflow-y: auto;
	position: relative;
	color: #111827;
}

.oc-do-modal-close {
	position: absolute;
	top: 0.5em;
	right: 0.75em;
	background: none;
	border: none;
	font-size: 1.5em;
	cursor: pointer;
	line-height: 1;
}

/* Trust badge + heading */

.oc-do-trust-badge {
	display: inline-block;
	background: color-mix(in srgb, var(--oc-do-primary) 12%, transparent);
	color: var(--oc-do-primary);
	border-radius: 999px;
	padding: 0.4em 1em;
	font-size: 0.8em;
	font-weight: 700;
	margin-bottom: 0.9em;
}

.oc-do-heading {
	margin: 0 0 1em;
	font-size: 1.2em;
}

.oc-do-notice {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 0.7em 1em;
	margin-bottom: 1em;
	font-size: 0.9em;
}

.oc-do-notice.oc-do-notice-success {
	background: #f0fdf4;
	color: #15803d;
	border-color: #bbf7d0;
}

/* Field grid */

.oc-do-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.9em;
	margin-bottom: 1em;
}

.oc-do-field.oc-do-full {
	grid-column: 1 / -1;
}

.oc-do-label {
	display: block;
	font-weight: 600;
	font-size: 0.88em;
	margin-bottom: 0.35em;
}

.oc-required {
	color: #dc2626;
}

.oc-do-field input[type="text"],
.oc-do-field input[type="tel"],
.oc-do-field input[type="number"],
.oc-do-field select,
.oc-do-field textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 46px;
	padding: 0.6em 0.8em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 10px;
	font: inherit;
	background: #fff;
}

.oc-do-field textarea {
	min-height: 70px;
	resize: vertical;
}

.oc-do-delivery-modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.7em;
}

.oc-do-mode-card {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 10px;
	padding: 0.7em 0.9em;
	cursor: pointer;
	min-height: 60px;
}

.oc-do-mode-card:has(input:checked) {
	border-color: var(--oc-do-primary);
	background: color-mix(in srgb, var(--oc-do-primary) 8%, transparent);
}

.oc-do-mode-fee {
	font-size: 0.8em;
	opacity: 0.7;
}

.oc-do-promo-row {
	display: flex;
	gap: 0.5em;
}

.oc-do-promo-row input {
	flex: 1 1 auto;
}

.oc-do-apply-promo {
	appearance: none;
	border: none;
	background: var(--oc-do-text);
	color: #fff;
	border-radius: 10px;
	padding: 0 1.1em;
	font-weight: 700;
	cursor: pointer;
	min-height: 46px;
}

/* Totals */

.oc-do-totals {
	border-top: 1px dashed rgba(0, 0, 0, 0.15);
	padding-top: 0.8em;
	margin-bottom: 1em;
}

.oc-do-totals-row {
	display: flex;
	justify-content: space-between;
	padding: 0.25em 0;
	font-size: 0.92em;
}

.oc-do-discount-row strong {
	color: var(--oc-do-primary);
}

.oc-do-grand-total {
	font-size: 1.1em;
	padding-top: 0.4em;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	margin-top: 0.3em;
}

.oc-do-grand-total strong {
	color: var(--oc-do-primary);
}

/* CTAs */

.oc-do-cta-primary {
	display: block;
	width: 100%;
	appearance: none;
	border: none;
	background: var(--oc-do-accent);
	color: #fff;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-size: 0.95em;
	min-height: 54px;
	border-radius: var(--oc-do-radius);
	cursor: pointer;
	margin-bottom: 0.7em;
	transition: filter 0.15s ease;
}

.oc-do-cta-primary:hover {
	filter: brightness(0.95);
}

.oc-do-cta-primary:disabled {
	opacity: 0.6;
	cursor: wait;
}

.oc-do-reassurance {
	font-size: 0.78em;
	opacity: 0.7;
	text-align: center;
	margin: 0 0 0.9em;
}

.oc-do-cta-secondary {
	display: block;
	width: 100%;
	appearance: none;
	border: none;
	background: var(--oc-do-primary);
	color: #fff;
	font-weight: 700;
	text-transform: uppercase;
	min-height: 48px;
	border-radius: var(--oc-do-radius);
	cursor: pointer;
}

@media (max-width: 480px) {
	.oc-do-wrap {
		max-width: 100%;
		padding: 1em;
	}

	.oc-do-grid,
	.oc-do-delivery-modes {
		grid-template-columns: 1fr;
	}

	.oc-do-field.oc-do-half {
		grid-column: 1 / -1;
	}
}

/* Embedded PDP options (delivery date, gift note, add-ons, substitution) inside the Direct Order Form. */
.oc-do-form .oc-do-options {
	margin: 0 0 16px;
	padding: 14px 16px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--oc-do-radius);
	background: rgba(255, 255, 255, 0.55);
}

.oc-do-form .oc-do-options .oc-field {
	margin-bottom: 12px;
}

.oc-do-form .oc-do-options .oc-field:last-child {
	margin-bottom: 0;
}

.oc-do-form .oc-do-options .oc-field label,
.oc-do-form .oc-do-options .oc-addon-group legend {
	color: var(--oc-do-text);
	font-weight: 600;
}

.oc-do-form .oc-do-options .oc-occasion-chip.is-active,
.oc-do-form .oc-do-options .oc-addon-price {
	color: var(--oc-do-primary);
}
