/**
 * Cabinet Estimate Calculator — Frontend styles.
 *
 * Scoped under #cec-wizard / .cec-* to avoid theme conflicts.
 */

#cec-wizard {
	max-width: 820px;
	margin: 0 auto;
	padding: 28px;
	background: #fff;
	border: 1px solid #e6e9ee;
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(10, 61, 98, 0.06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #222;
	box-sizing: border-box;
}
#cec-wizard *, #cec-wizard *::before, #cec-wizard *::after { box-sizing: border-box; }

/* Progress */
.cec-progress { margin-bottom: 22px; }
.cec-progress-bar { background: #eef2f6; height: 8px; border-radius: 4px; overflow: hidden; }
.cec-progress-fill {
	display: block; height: 100%;
	background: linear-gradient(90deg, #0a3d62, #1e7fc0);
	transition: width .3s ease;
}
.cec-progress-label { font-size: 12px; color: #666; margin-top: 6px; text-align: right; }

/* Steps */
.cec-step h2 { margin: 0 0 6px; font-size: 22px; color: #0a3d62; }
.cec-help { color: #666; margin: 0 0 18px; font-size: 14px; }
.cec-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .cec-grid-2 { grid-template-columns: 1fr; } }

.cec-field { display: flex; flex-direction: column; margin-bottom: 14px; }
.cec-field > span, .cec-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: #333; }
.cec-field input[type="number"],
.cec-field input[type="text"],
.cec-field input[type="email"],
.cec-field input[type="tel"] {
	padding: 12px 14px; border: 1px solid #d4d9e0; border-radius: 6px; font-size: 15px;
	background: #fff; transition: border-color .15s;
}
.cec-field input:focus { outline: none; border-color: #1e7fc0; box-shadow: 0 0 0 3px rgba(30,127,192,.15); }
.cec-field-error, .cec-form-error { color: #c62828; font-size: 13px; margin-top: 4px; display: block; min-height: 16px; }

/* Choice (radio buttons rendered as pill chips) */
.cec-choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cec-choice {
	flex: 0 1 auto; display: inline-flex; align-items: center;
	padding: 12px 22px; border: 2px solid #d4d9e0; border-radius: 8px;
	cursor: pointer; background: #fff; transition: all .15s;
	font-weight: 500;
}
.cec-choice input { position: absolute; opacity: 0; pointer-events: none; }
.cec-choice:has(input:checked) { border-color: #1e7fc0; background: #eef6fc; color: #0a3d62; }

/* Image options */
.cec-image-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 12px; }
@media (max-width: 540px) { .cec-image-options { grid-template-columns: 1fr; } }
.cec-image-option {
	position: relative; cursor: pointer; border: 2px solid #d4d9e0;
	border-radius: 10px; padding: 10px; background: #fff; text-align: center; transition: all .15s;
}
.cec-image-option input { position: absolute; opacity: 0; pointer-events: none; }
.cec-image-option img {
	display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 6px;
	background: #f1f4f8;
}
.cec-image-option span { display: block; margin-top: 8px; font-weight: 600; font-size: 14px; }
.cec-image-option:has(input:checked) { border-color: #1e7fc0; background: #eef6fc; }
.cec-image-option:has(input:checked)::after {
	content: "✓"; position: absolute; top: 8px; right: 10px;
	background: #1e7fc0; color: #fff; width: 22px; height: 22px;
	border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* Checkboxes */
.cec-addons { display: grid; gap: 10px; }
.cec-checkbox {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 16px; border: 2px solid #d4d9e0; border-radius: 8px;
	cursor: pointer; background: #fff; transition: all .15s;
}
.cec-checkbox input { width: 18px; height: 18px; }
.cec-checkbox:has(input:checked) { border-color: #1e7fc0; background: #eef6fc; }

/* Spinner (Step 8) */
.cec-step-calc { text-align: center; padding: 40px 0; }
.cec-spinner {
	width: 56px; height: 56px; margin: 0 auto 20px;
	border: 5px solid #eef2f6; border-top-color: #1e7fc0;
	border-radius: 50%; animation: cec-spin 1s linear infinite;
}
@keyframes cec-spin { to { transform: rotate(360deg); } }
.cec-spinner-text { font-size: 16px; color: #0a3d62; font-weight: 600; transition: opacity .25s; }

/* Pantry step layout (image + question side-by-side) */
.cec-pantry-row { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
@media (max-width: 600px) { .cec-pantry-row { grid-template-columns: 1fr; } }
.cec-pantry-photo {
	display: block; width: 100%; max-width: 240px; height: auto; max-height: 220px; object-fit: cover;
	border-radius: 8px; background: #f1f4f8; border: 1px solid #e6e9ee;
}

/* Extras grid */
.cec-extras-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .cec-extras-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { .cec-extras-grid { grid-template-columns: 1fr; } }
.cec-extra-option {
	position: relative; cursor: pointer; border: 2px solid #d4d9e0;
	border-radius: 10px; padding: 10px; background: #fff; text-align: center; transition: all .15s;
}
.cec-extra-option input { position: absolute; opacity: 0; pointer-events: none; }
.cec-extra-option img {
	display: block; width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: #f1f4f8;
}
.cec-extra-option .cec-extra-name { display: block; margin-top: 8px; font-weight: 600; font-size: 13px; line-height: 1.25; }
.cec-extra-option .cec-extra-price { display: block; font-size: 12px; color: #0a3d62; margin-top: 2px; }
.cec-extra-option:has(input:checked) { border-color: #1e7fc0; background: #eef6fc; }
.cec-extra-option:has(input:checked)::after {
	content: "✓"; position: absolute; top: 8px; right: 10px;
	background: #1e7fc0; color: #fff; width: 22px; height: 22px;
	border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.cec-extras-empty { color: #888; font-style: italic; text-align: center; padding: 18px 0; }

/* Results */
.cec-prices { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 18px; }
.cec-prices.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .cec-prices.two-col { grid-template-columns: 1fr; } }
.cec-price-card {
	padding: 22px; border-radius: 10px; text-align: center;
	background: #f1f4f8; border: 2px solid transparent;
}
.cec-price-card.recommended { background: #e7f5e7; border-color: #0a6a0a; }
.cec-price-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #555; }
.cec-price-card.recommended .label { color: #0a6a0a; }
.cec-price-card .regular {
	display: block; font-size: 18px; color: #999; text-decoration: line-through;
	margin-top: 8px; font-weight: 600;
}
.cec-price-card .promo-label {
	display: block; font-size: 11px; color: #c1272d; text-transform: uppercase;
	letter-spacing: .4px; margin-top: 4px; font-weight: 600;
}
.cec-price-card .amount {
	font-size: 36px; font-weight: 800; color: #c1272d; line-height: 1.1; margin-top: 4px;
}
.cec-price-card.recommended .amount { color: #c1272d; }
.cec-price-card .hst { font-size: 14px; color: #555; font-weight: 500; margin-left: 6px; }
.cec-price-card .badge {
	display: inline-block; background: #0a6a0a; color: #fff;
	font-size: 11px; padding: 3px 8px; border-radius: 3px; margin-top: 8px;
}

.cec-explanation {
	background: #f8f9fa; border-left: 4px solid #1e7fc0;
	padding: 14px 18px; border-radius: 6px; margin: 16px 0; font-size: 14px; line-height: 1.6;
}

.cec-promo {
	background: linear-gradient(90deg, #fff4d6, #ffe9a8);
	border: 1px solid #f0c400;
	padding: 14px 18px; border-radius: 6px; font-weight: 600;
	color: #856100; margin: 16px 0; text-align: center;
}

.cec-breakdown { display: grid; gap: 8px; margin: 14px 0 22px; }
.cec-line {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 14px; background: #fafbfc; border: 1px solid #eef2f6; border-radius: 6px;
}
.cec-line.fixed { background: #f8f9fa; }
.cec-line input[type="checkbox"] { width: 18px; height: 18px; margin-right: 12px; }
.cec-line label { display: flex; align-items: center; flex: 1; font-size: 14px; cursor: pointer; }
.cec-line .price { font-weight: 600; color: #0a3d62; }
.cec-line .price.strike { color: #999; text-decoration: line-through; }
.cec-line .price.free { color: #0a6a0a; font-weight: 700; margin-left: 8px; }

.cec-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.cec-actions .cec-btn { flex: 1; min-width: 200px; }
.cec-action-status { display: block; margin-top: 10px; color: #0a6a0a; font-weight: 600; }

/* Nav */
.cec-nav {
	display: flex; justify-content: space-between; gap: 12px;
	margin-top: 24px; padding-top: 18px; border-top: 1px solid #eef2f6;
}

/* Buttons */
.cec-btn {
	padding: 12px 22px; border: none; border-radius: 6px;
	font-size: 15px; font-weight: 600; cursor: pointer;
	transition: all .15s; font-family: inherit;
}
.cec-btn-primary { background: #0a3d62; color: #fff; }
.cec-btn-primary:hover { background: #0d4d7a; }
.cec-btn-secondary { background: #fff; color: #0a3d62; border: 2px solid #0a3d62; }
.cec-btn-secondary:hover { background: #eef6fc; }
.cec-btn-back { background: transparent; color: #666; }
.cec-btn-back:hover { color: #0a3d62; }
.cec-btn-block { width: 100%; margin-top: 14px; }
.cec-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Modal */
.cec-modal { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; }
.cec-modal[hidden] { display: none !important; }
.cec-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.cec-modal-dialog {
	position: relative; background: #fff; border-radius: 10px;
	padding: 28px; max-width: 540px; width: calc(100% - 32px);
	max-height: 90vh; overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.cec-modal-dialog h2 { margin: 0 0 6px; color: #0a3d62; }
.cec-modal-close {
	position: absolute; top: 10px; right: 14px;
	background: transparent; border: none; font-size: 28px;
	color: #666; cursor: pointer; line-height: 1;
}
.cec-upload {
	display: block; padding: 24px; border: 2px dashed #d4d9e0;
	border-radius: 8px; text-align: center; cursor: pointer;
	transition: all .15s; margin: 12px 0;
}
.cec-upload:hover { border-color: #1e7fc0; background: #f8fbfe; }
.cec-upload input[type="file"] { display: none; }
.cec-upload-cta { display: block; font-weight: 600; color: #0a3d62; }
.cec-upload-hint { display: block; color: #888; margin-top: 6px; font-size: 12px; }
.cec-upload-list { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; }
.cec-upload-list li {
	padding: 6px 10px; background: #f1f4f8; border-radius: 4px; margin-bottom: 4px;
	display: flex; justify-content: space-between; align-items: center;
}
.cec-upload-list li.error { background: #fde7e7; color: #a00; }
.cec-modal-status { display: block; margin-top: 10px; color: #0a6a0a; }
