/* Public order form styles */
.order-page { max-width: 960px; margin: 0 auto; padding: 24px; }
.form-header-img {
	width: 100%; max-height: 300px; object-fit: cover;
	border-radius: var(--radius-lg); margin-bottom: 24px;
}
.form-title { font-size: 28px; margin-bottom: 8px; }
.form-desc { color: var(--gray-500); margin-bottom: 24px; font-size: 15px; white-space: pre-wrap; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; align-items: stretch; }
@media (max-width: 860px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: 1fr; } }

/* Category filter tabs */
.category-filters {
	display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.cat-filter-btn {
	padding: 6px 16px; border: 1px solid var(--gray-300); border-radius: 20px;
	background: var(--gray-50); cursor: pointer; font-size: 13px; font-weight: 500;
	color: var(--gray-600); transition: all 0.2s;
}
.cat-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-filter-btn.active {
	background: var(--primary); color: white; border-color: var(--primary);
}

.product-category-section { margin-bottom: 18px; }
.product-category-section .product-grid { margin-bottom: 0; }
.product-category-toggle {
	width: 100%; display: flex; align-items: center; gap: 10px;
	padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	background: var(--gray-50); cursor: pointer; text-align: left; font: inherit; color: var(--gray-800);
	box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s;
}
.product-category-toggle:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.product-category-title { font-size: 14px; font-weight: 700; }
.product-category-meta { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--gray-500); }
.product-category-chevron { font-size: 12px; color: var(--gray-500); }
.product-category-body { padding-top: 10px; }

.prod-card {
	background: var(--form-bg, white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	overflow: hidden; box-shadow: var(--shadow); transition: box-shadow 0.15s;
	display: flex; flex-direction: column; min-height: 120px; position: relative; height: 100%;
}
.prod-card.selected { border-color: var(--primary); box-shadow: var(--shadow-md); }
.prod-card:hover { box-shadow: var(--shadow-md); }
.prod-select-indicator {
	position: absolute; top: 10px; right: 10px; width: 20px; height: 20px;
	border: 1px solid var(--gray-300); border-radius: 6px; background: var(--gray-100);
	box-shadow: 0 1px 2px rgba(15,23,42,0.12); z-index: 2; pointer-events: none;
}
.prod-select-indicator.checked { background: var(--primary); border-color: var(--primary); }
.prod-select-indicator.checked::after {
	content: '\2713'; position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	color: #fff; font-size: 13px; font-weight: 700;
}
.prod-card-img { width: 100%; height: 120px; object-fit: cover; background: var(--gray-100); }
.prod-img-square .prod-card-img { height: auto; aspect-ratio: 1 / 1; }
.prod-img-portrait .prod-card-img { height: auto; aspect-ratio: 3 / 4; }
.prod-img-auto .prod-card-img { height: auto; max-height: 200px; object-fit: contain; background: var(--gray-50); }
.prod-card-body { padding: 8px 36px 8px 10px; display: flex; flex-direction: column; flex: 1; }
.prod-card-name { font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.prod-card-desc { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.option-select { margin-bottom: 2px; }
.option-select label { font-size: 12px; font-weight: 500; color: var(--gray-600); }
.option-select select {
	width: 100%; padding: 5px 8px; border: 1px solid var(--gray-300);
	border-radius: var(--radius); font-size: 13px; background: var(--form-bg, white); margin-top: 2px;
}
.qty-row { display: flex; align-items: center; gap: 6px; padding-top: 4px; }
.qty-row label { font-size: 12px; font-weight: 500; color: var(--gray-600); }
.qty-input {
	width: 60px; padding: 4px 8px; border: 1px solid var(--gray-300);
	border-radius: var(--radius); font-size: 13px; text-align: center;
}
select.qty-dropdown { width: 80px; cursor: pointer; appearance: auto; }
.line-total { margin-left: auto; font-weight: 600; color: var(--primary); font-size: 13px; }

/* Individual variant display mode */
.variant-list { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.variant-row {
	display: flex; align-items: center;
	padding: 4px 8px; background: var(--gray-50); border: 1px solid var(--gray-200);
	border-radius: var(--radius); gap: 6px;
}
.variant-row.variant-oos { opacity: 0.6; }
.variant-info { display: flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0; }
.variant-label { font-size: 13px; font-weight: 500; color: var(--gray-800); }
.variant-price { font-size: 12px; font-weight: 600; color: var(--primary); }
.variant-stock { font-size: 10px; font-weight: 500; }
.variant-stock.low { color: #f59e0b; }
.variant-stock.oos { color: var(--danger); }
.variant-qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.variant-qty-input { width: 55px; text-align: center; padding: 3px 6px; }
.variant-line-total { text-align: right; padding-top: 2px; }

/* Cart summary */
.cart-summary {
	background: var(--form-bg, white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow);
	position: sticky; top: 80px;
}
@media (max-width: 640px) { .cart-summary { position: static; } }
.prod-card-price-range { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.cart-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.cart-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--gray-100); }
.cart-item:last-child { border: none; }
.cart-shipping-wrap {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--gray-200);
}
.cart-shipping-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: var(--gray-800); }
.cart-total {
	display: flex; justify-content: space-between; padding: 12px 0 0;
	font-size: 18px; font-weight: 700; border-top: 2px solid var(--gray-200); margin-top: 8px;
}

/* Block section wrapper — reset when inside styled .block-wrap */
.block-section {
	border: none; box-shadow: none; padding: 0; margin-bottom: 0;
}
.block-section h3 { font-size: 18px; margin-bottom: 16px; }

/* Block border style variants — target .block-wrap (universal wrapper on every block) */
/* Default/subtle: light border, soft shadow */
.block-wrap {
	transition: opacity 0.25s ease, max-height 0.3s ease; max-height: 20000px; opacity: 1; overflow: visible;
	background: var(--form-bg, white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.block-wrap:empty { display: none; }
/* Prominent: dark solid borders, strong shadow, very definitive edges */
.block-style-prominent .block-wrap {
	border: 3px solid #1f2937; border-radius: var(--radius-lg);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.block-style-prominent .block-section { border: none; box-shadow: none; padding: 0; margin-bottom: 0; }
.block-style-prominent .cf-divider { border-top-color: #1f2937; border-top-width: 3px; }
/* Outlined: accent color border, medium weight */
.block-style-outlined .block-wrap {
	border: 2px solid var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.block-style-outlined .block-section { border: none; box-shadow: none; padding: 0; margin-bottom: 0; }
.block-style-outlined .cf-divider { border-top-color: var(--primary); }
/* None: invisible wraps */
.block-style-none .block-wrap {
	border: none; box-shadow: none; background: transparent; padding: 20px 0;
}
.block-style-none .block-section { border: none; box-shadow: none; }
.block-style-none .cf-divider { border-top-color: var(--gray-300); border-top-style: dashed; }

/* Address grid */
.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.address-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .address-grid { grid-template-columns: 1fr; } .address-grid .full { grid-column: 1; } }

/* Validation */
.field-error .form-input, .field-error .form-textarea, .field-error .form-select, .field-error select {
	border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}
.field-error-msg { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
.field-error .field-error-msg { display: block; }

/* Custom fields */
.cf-heading { font-size: 20px; font-weight: 600; margin: 16px 0 8px; color: var(--gray-800); }
.cf-heading:first-child { margin-top: 0; }
.cf-divider { border: none; border-top: 2px solid var(--gray-200); margin: 16px 0; }
.cf-image { max-width: 100%; border-radius: var(--radius); margin: 8px 0; }
.cf-radio-group, .cf-checkbox-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cf-radio-group label, .cf-checkbox-group label {
	display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--gray-700);
}
.cf-radio-group input, .cf-checkbox-group input { accent-color: var(--primary); }

/* Agreement checkbox */
.agree-wrap {
	display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
	border-bottom: 1px solid var(--gray-100); margin-bottom: 8px;
}
.agree-wrap:last-child { border-bottom: none; margin-bottom: 0; }
.agree-wrap input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.agree-wrap label { font-size: 14px; color: var(--gray-700); cursor: pointer; line-height: 1.5; }
.agree-wrap.has-error label { color: var(--danger); }
.agree-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
.agree-wrap.has-error .agree-error { display: block; }

/* File upload */
.cf-file-upload {
	border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 20px;
	text-align: center; cursor: pointer; position: relative; transition: border-color 0.15s;
}
.cf-file-upload:hover { border-color: var(--primary); }
.cf-file-upload input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cf-file-upload.has-file { border-color: var(--success); border-style: solid; background: #ecfdf5; }

/* Proof upload */
.proof-upload-area {
	border: 2px dashed var(--gray-300); border-radius: var(--radius-lg); padding: 32px 16px;
	text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; position: relative;
}
.proof-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.proof-upload-area.has-error { border-color: var(--danger); background: #fef2f2; }
.proof-upload-area.has-file { border-color: var(--success); border-style: solid; background: #ecfdf5; }
.proof-upload-area input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.proof-preview { margin-top: 12px; max-width: 200px; max-height: 150px; border-radius: var(--radius); border: 1px solid var(--gray-200); }

/* Confirmation */
.confirmation { text-align: center; padding: 48px 24px; }
.confirmation .icon { font-size: 64px; margin-bottom: 16px; }
.confirmation h2 { font-size: 24px; margin-bottom: 12px; }
.payment-box {
	background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	padding: 20px; margin: 20px auto; max-width: 500px; text-align: left;
	white-space: pre-wrap; font-size: 14px; line-height: 1.8;
}
.not-found { text-align: center; padding: 80px 24px; color: var(--gray-400); }

/* Coupon */
.coupon-section {
	background: var(--form-bg, white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; }
.coupon-msg { font-size: 13px; margin-top: 8px; }
.coupon-msg.ok { color: var(--success); }
.coupon-msg.err { color: var(--danger); }
.discount-line { color: var(--success); font-weight: 500; }

/* Currency field */
.currency-wrap { display: flex; align-items: center; }
.currency-wrap .prefix {
	padding: 10px 12px; background: var(--gray-100);
	border: 1px solid var(--gray-300); border-right: none;
	border-radius: var(--radius) 0 0 var(--radius);
	font-size: 14px; color: var(--gray-600);
}
.currency-wrap input { border-radius: 0 var(--radius) var(--radius) 0; }

/* Rich text display */
.rt-content p { margin: 4px 0; }
.rt-content a { color: var(--primary); }
.rt-bullet { padding-left: 16px; margin: 2px 0; }

/* Star rating field */
.star-rating { display: flex; gap: 4px; }
.star-rating .star { font-size: 28px; cursor: pointer; color: var(--gray-300); transition: color 0.15s; user-select: none; }
.star-rating .star.active { color: #f59e0b; }
.star-rating .star:hover { color: #f59e0b; }

/* Multi-page forms */
.mp-progress { margin-bottom: 20px; }
.mp-progress-track { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.mp-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s ease; }
.mp-progress-label { font-size: 12px; color: var(--gray-500); margin-top: 6px; text-align: center; font-weight: 500; }
.form-page { transition: opacity 0.25s ease; }
.form-page.page-hidden { display: none; }
.page-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.page-nav .btn { min-width: 120px; }

/* Calculation field */
.calc-result {
	padding: 12px 16px; background: var(--gray-50); border: 1px solid var(--gray-200);
	border-radius: var(--radius); font-size: 20px; font-weight: 700; color: var(--primary);
}

/* Conditional logic show/hide */
.block-wrap.cond-hidden { max-height: 0; opacity: 0; margin: 0; padding: 0; border: none; box-shadow: none; pointer-events: none; overflow: hidden; }

/* Honeypot spam protection */
.hp-wrap { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---- Slider ---- */
.cf-slider-wrap { display: flex; align-items: center; gap: 12px; }
.cf-slider { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: var(--gray-200); border-radius: 3px; outline: none; cursor: pointer; }
.cf-slider:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3); }
.cf-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary, #6366f1); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.cf-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--primary, #6366f1); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.cf-slider-val { font-size: 18px; font-weight: 600; color: var(--primary, #6366f1); min-width: 40px; text-align: center; }

/* ---- Image Choice ---- */
.ic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 6px; }
.ic-card { border: 2px solid var(--gray-200, #e5e7eb); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.ic-card:hover { border-color: var(--gray-400, #9ca3af); }
.ic-card.selected { border-color: var(--primary, #6366f1); box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.ic-card-img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; display: block; }
.ic-card-placeholder { width: 100%; height: 80px; background: var(--gray-100, #f3f4f6); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--gray-300, #d1d5db); font-size: 24px; }
.ic-card-label { font-size: 13px; color: var(--gray-700, #374151); margin-top: 6px; font-weight: 500; }

/* ---- Multi Select ---- */
.ms-wrap { position: relative; }
.ms-tags { min-height: 40px; padding: 6px 10px; border: 1px solid var(--gray-300, #d1d5db); border-radius: 6px; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--gray-50, #fff); }
.ms-tags:hover { border-color: var(--gray-400, #9ca3af); }
.ms-placeholder { color: var(--gray-400, #9ca3af); font-size: 14px; }
.ms-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--primary, #6366f1); color: #fff; border-radius: 4px; font-size: 13px; }
.ms-tag-x { cursor: pointer; font-size: 15px; line-height: 1; opacity: 0.8; }
.ms-tag-x:hover { opacity: 1; }
.ms-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--gray-50, #fff); border: 1px solid var(--gray-300, #d1d5db); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 50; margin-top: 4px; max-height: 250px; overflow: hidden; display: flex; flex-direction: column; }
.ms-search { padding: 8px 12px; border: none; border-bottom: 1px solid var(--gray-200, #e5e7eb); font-size: 14px; outline: none; }
.ms-search:focus { box-shadow: inset 0 -2px 0 0 var(--primary, #6366f1); }
.ms-options { overflow-y: auto; max-height: 200px; }
.ms-option { padding: 8px 12px; cursor: pointer; font-size: 14px; color: var(--gray-700, #374151); }
.ms-option:hover { background: var(--gray-50, #f9fafb); }
.ms-option.selected { background: rgba(99,102,241,0.08); color: var(--primary, #6366f1); font-weight: 500; }

/* ---- Collapsible Section ---- */
.cf-section { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.cf-section-header { padding: 12px 16px; background: var(--gray-50, #f9fafb); border-bottom: 1px solid var(--gray-200, #e5e7eb); display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.cf-section-header:hover { background: var(--gray-100, #f3f4f6); }
.cf-section-title { font-weight: 600; font-size: 15px; color: var(--gray-800, #1f2937); }
.cf-section-arrow { color: var(--gray-400, #9ca3af); font-size: 14px; transition: transform 0.2s; }
.cf-section-header.expanded .cf-section-arrow { transform: rotate(180deg); }
.cf-section-body { padding: 16px; font-size: 14px; color: var(--gray-600, #4b5563); line-height: 1.6; }

/* ---- Shipping Block ---- */
.shipping-methods, .shipping-addons {
	display: flex; flex-direction: column; gap: 6px;
}
.shipping-option {
	display: flex; align-items: center; gap: 10px; padding: 10px 14px;
	border: 1px solid var(--gray-200); border-radius: var(--radius);
	cursor: pointer; transition: border-color 0.15s, background 0.15s;
	font-size: 14px;
}
.shipping-option:hover { border-color: var(--primary); background: var(--primary-light, rgba(99,102,241,0.04)); }
.shipping-option input[type="radio"],
.shipping-option input[type="checkbox"] {
	width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.shipping-option-qty { cursor: default; flex-wrap: wrap; }
.shipping-option-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.shipping-qty-select { width: auto; min-width: 92px; flex-shrink: 0; }
.shipping-option-img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.shipping-label { flex: 1; font-weight: 500; color: var(--gray-700); }
.shipping-price { font-weight: 600; color: var(--primary); font-size: 14px; white-space: nowrap; }
.cart-item.shipping-line { color: var(--gray-600); font-style: italic; }
#shipping-section.field-error .shipping-methods { outline: 2px solid var(--danger); outline-offset: 2px; border-radius: var(--radius); }
#shipping-section.field-error .field-error-msg { display: block; }

/* ---- Mobile Enhancements ---- */
@media (max-width: 640px) {
	.order-page { padding: 12px; }
	.prod-card-img { height: 100px; }
	.prod-card-body { padding: 6px 8px; }
	.qty-input { min-height: 44px; font-size: 16px; }
	.option-select select { min-height: 44px; font-size: 16px; }
	.form-input, .form-textarea, .form-select { min-height: 44px; font-size: 16px; }
	.block-section { padding: 16px; margin-bottom: 16px; }
	.block-section h3 { font-size: 16px; }
	.shipping-option-qty { align-items: flex-start; }
	.shipping-option-main { width: 100%; }
	.shipping-qty-select { width: 100%; }
	.cart-summary { position: static; padding: 16px; }
	.variant-row { padding: 6px 8px; }
	.variant-qty-input { min-height: 40px; font-size: 16px; width: 64px; }
	.btn { min-height: 44px; font-size: 15px; }
	.form-title { font-size: 22px; }
	.confirmation { padding: 32px 16px; }
	.payment-box { padding: 16px; }
}

/* Powered by footer */
.powered-by {
	text-align: center; padding: 24px 0 8px; font-size: 12px; color: var(--gray-400);
}
.powered-by a { color: var(--gray-400); text-decoration: none; }
.powered-by a:hover { color: var(--primary); }

/* Password gate card */
.pw-gate-card {
	background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
	padding: 32px 28px; box-shadow: var(--shadow-md);
}

/* Confirmation checkmark animation */
@keyframes confirmPop {
	0% { transform: scale(0); opacity: 0; }
	60% { transform: scale(1.2); }
	100% { transform: scale(1); opacity: 1; }
}
.confirmation .icon { animation: confirmPop 0.5s ease-out; }

/* Signup prompt on confirmation page */
.signup-prompt-card {
	background: var(--primary-light);
	border: 1px solid #c7d2fe;
	border-radius: var(--radius-lg);
	padding: 20px 24px;
	text-align: center;
}
