/**
 * Brodtek Custom Options — Front Styles
 *
 * Clean, professional UI for delay selector and embroidery service.
 * Designed to integrate smoothly with most WooCommerce themes.
 */

/* ─── Layout fix: force full-width vertical stacking ──────────── */
/* Prevents Elementor/theme flex from placing blocks side by side  */

.woocommerce-variation-add-to-cart,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: wrap !important;
	align-items: stretch !important;
}

.woocommerce-variation-add-to-cart .bco-embroidery-option,
.woocommerce-variation-add-to-cart .bco-delay-selector,
form.cart .bco-embroidery-option,
form.cart .bco-delay-selector {
	width: 100% !important;
	flex: 0 0 100% !important;
	max-width: 100% !important;
	display: block !important;
	clear: both !important;
	box-sizing: border-box !important;
}

/* Quantity + button row: back to horizontal */
.woocommerce-variation-add-to-cart .quantity,
.woocommerce-variation-add-to-cart .single_add_to_cart_button {
	flex: 0 0 auto !important;
	width: auto !important;
}

/* Group quantity + button on the same row */
.woocommerce-variation-add-to-cart .quantity {
	display: inline-flex !important;
	align-items: center !important;
	margin-right: 12px !important;
}

/* ─── Shared Section ───────────────────────────────────────── */

.bco-delay-selector,
.bco-embroidery-option {
	margin: 20px 0 16px;
	padding: 0;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	background: #fafafa;
	overflow: hidden;
	font-family: inherit;
}

.bco-section-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 18px 10px;
	font-size: 15px;
	font-weight: 600;
	color: #1a1a1a;
	letter-spacing: -0.01em;
}

.bco-section-icon {
	font-size: 18px;
	line-height: 1;
}

.bco-section-desc {
	margin: 0 0 8px;
	padding: 0 18px;
	font-size: 13px;
	color: #666;
	line-height: 1.5;
}

/* ─── Radio Options (shared) ───────────────────────────────── */

.bco-delay-options,
.bco-embroidery-options {
	display: flex;
	flex-direction: column;
	padding: 0 10px 10px;
	gap: 6px;
}

.bco-delay-option,
.bco-embroidery-choice {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 2px solid transparent;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.bco-delay-option:hover,
.bco-embroidery-choice:hover {
	border-color: #d0d0d0;
	background: #fff;
}

.bco-delay-option--active,
.bco-delay-option:has(input:checked),
.bco-embroidery-choice:has(input:checked) {
	border-color: #2c2c2c;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Hide native radio */
.bco-delay-radio,
.bco-embroidery-radio {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* Custom radio indicator */
.bco-delay-radio-custom {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	border: 2px solid #ccc;
	border-radius: 50%;
	background: #fff;
	position: relative;
	transition: all 0.2s ease;
}

.bco-delay-radio-custom::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	background: #2c2c2c;
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(0);
	transition: transform 0.2s ease;
}

input:checked ~ .bco-delay-radio-custom {
	border-color: #2c2c2c;
}

input:checked ~ .bco-delay-radio-custom::after {
	transform: translate(-50%, -50%) scale(1);
}

/* ─── Content ──────────────────────────────────────────────── */

.bco-delay-content,
.bco-embroidery-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.bco-delay-label,
.bco-embroidery-label {
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	line-height: 1.4;
}

.bco-delay-desc {
	font-size: 12px;
	color: #888;
	line-height: 1.4;
}

/* ─── Badges ───────────────────────────────────────────────── */

.bco-delay-badge {
	flex-shrink: 0;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.bco-delay-badge--standard {
	background: #e8f5e9;
	color: #2e7d32;
}

.bco-delay-badge--fast {
	background: #fff8e1;
	color: #f57f17;
}

.bco-delay-badge--express {
	background: #fce4ec;
	color: #c62828;
}

/* ─── Upload Zone ──────────────────────────────────────────── */

.bco-upload-zone {
	margin: 4px 0 0;
	padding: 0;
}

.bco-upload-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 20px 16px;
	border: 2px dashed #ccc;
	border-radius: 8px;
	background: #fefefe;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
}

.bco-upload-label:hover {
	border-color: #999;
	background: #f5f5f5;
}

.bco-upload-label.bco-upload-label--has-file {
	border-color: #2e7d32;
	border-style: solid;
	background: #e8f5e9;
}

.bco-upload-icon {
	font-size: 28px;
	line-height: 1;
}

.bco-upload-text {
	font-size: 14px;
	font-weight: 500;
	color: #333;
}

.bco-upload-help {
	font-size: 12px;
	color: #999;
}

.bco-upload-file-name {
	font-size: 13px;
	font-weight: 600;
	color: #2e7d32;
	display: none;
}

.bco-upload-file-name.bco-visible {
	display: block;
}

.bco-upload-input {
	display: none !important;
}

/* ─── Form enctype fix ─────────────────────────────────────── */
/* The JS will add enctype="multipart/form-data" to the cart form */

/* ─── Responsive ───────────────────────────────────────────── */

@media (max-width: 600px) {
	.bco-delay-option,
	.bco-embroidery-choice {
		padding: 10px 12px;
		gap: 10px;
	}

	.bco-delay-label,
	.bco-embroidery-label {
		font-size: 13px;
	}

	.bco-delay-badge {
		font-size: 11px;
		padding: 3px 8px;
	}

	.bco-section-header {
		font-size: 14px;
		padding: 12px 14px 8px;
	}
}
