/* ============================================================
   Calculadora de medidas — botón en PDP + popup modal
   Scoped under .cc-calc-* to avoid leaking into theme styles.
   ============================================================ */

/* ── Trigger button (lives right below "envío bonificado") ──
   The theme's PDP info column is a `display:flex; flex-direction:
   column` container whose existing children all carry an explicit
   `order` (chips=1, title=2, rating=3, long=4, delivery=5,
   features=7). A new sibling defaults to `order:0` and would render
   FIRST — above the title — even though it's last in the DOM.
   Slot ourselves into the gap (6) so we land between delivery and
   features regardless of source order. The modal is position:fixed
   so order doesn't matter for it visually. */
.cc-calc-btn {
	order: 6;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 12px;
	padding: 11px 18px;
	background: linear-gradient(135deg, #fdf9ef 0%, #f2e8c8 100%);
	border: 1.5px solid var(--cc-accent, #b88b3b);
	border-radius: 999px;
	color: var(--cc-ink, #0d0d0d);
	font: 600 14px / 1 var(--cc-sans, system-ui, -apple-system, sans-serif);
	cursor: pointer;
	transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
	box-shadow: 0 2px 8px rgba(184, 139, 59, 0.12);
	text-decoration: none;
	letter-spacing: .005em;
}
.cc-calc-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(184, 139, 59, 0.22);
	background: linear-gradient(135deg, #fdf6e6 0%, #ecdfb6 100%);
}
.cc-calc-btn:focus-visible {
	outline: 2px solid var(--cc-accent, #b88b3b);
	outline-offset: 2px;
}
.cc-calc-btn__arrow {
	display: inline-block;
	font-size: 16px;
	color: var(--cc-accent, #b88b3b);
	transition: transform .15s ease;
}
.cc-calc-btn:hover .cc-calc-btn__arrow { transform: translateX(3px); }

/* ── Modal: overlay + dialog ──────────────────────────────── */
.cc-calc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.cc-calc-modal[hidden] { display: none; }
.cc-calc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(13, 13, 13, 0.62);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	animation: cc-calc-fade .18s ease;
}
.cc-calc-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 540px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	padding: 32px 28px 24px;
	animation: cc-calc-pop .22s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes cc-calc-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes cc-calc-pop {
	from { opacity: 0; transform: translateY(12px) scale(.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cc-calc-modal__x {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: rgba(13, 13, 13, 0.06);
	color: var(--cc-ink, #0d0d0d);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	transition: background .15s ease, color .15s ease;
	z-index: 2;
}
.cc-calc-modal__x:hover { background: var(--cc-ink, #0d0d0d); color: #fff; }
.cc-calc-modal__x:focus-visible { outline: 2px solid var(--cc-accent, #b88b3b); outline-offset: 2px; }

/* ── Modal head ───────────────────────────────────────────── */
.cc-calc-modal__head {
	text-align: center;
	margin-bottom: 22px;
	padding: 0 18px;
}
.cc-calc-modal__eyebrow {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .25em;
	color: var(--cc-accent, #b88b3b);
	margin-bottom: 8px;
}
.cc-calc-modal__head h2 {
	font: 700 24px / 1.15 var(--cc-display, "Bricolage Grotesque", system-ui, sans-serif);
	margin: 0 0 8px;
	letter-spacing: -.015em;
	color: var(--cc-ink, #0d0d0d);
}
.cc-calc-modal__head p {
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--cc-ink-2, #5e5e5e);
	margin: 0;
}

/* ── Form ─────────────────────────────────────────────────── */
.cc-calc-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 12px;
	margin-bottom: 18px;
}
.cc-calc-field--full { grid-column: 1 / -1; }
/* Use the child combinator so this rule targets ONLY the field's
   own label (Ancho / Alto / Situación), not the per-option <label>
   elements wrapping each radio inside .cc-calc-radios — those have
   their own flex layout below. Without the `>`, `.cc-calc-field label`
   has higher specificity than `.cc-calc-radio` and flips it to block,
   collapsing the radio + badge onto two lines. */
.cc-calc-field > label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--cc-ink-2, #5e5e5e);
	margin-bottom: 6px;
}
.cc-calc-field input[type="number"] {
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	font-weight: 600;
	color: var(--cc-ink, #0d0d0d);
	background: #fbf6eb;
	border: 1.5px solid var(--cc-line, #e7dcc1);
	border-radius: 10px;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.cc-calc-field input[type="number"]:focus {
	outline: 0;
	border-color: var(--cc-accent, #b88b3b);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(184, 139, 59, 0.18);
}
.cc-calc-radios {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.cc-calc-radio {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: #fbf6eb;
	border: 1.5px solid var(--cc-line, #e7dcc1);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
	font-size: 13.5px;
	line-height: 1.3;
}
.cc-calc-radio:hover { border-color: var(--cc-accent, #b88b3b); }
/* Custom-styled radio dot — replaces the native control so it
   matches the surrounding pill / badge / typography of the modal.
   Native control is fully hidden via appearance: none + reset. */
.cc-calc-radio input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	margin: 0;
	width: 18px;
	height: 18px;
	border: 2px solid var(--cc-line, #e7dcc1);
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	flex-shrink: 0;
	position: relative;
	transition: border-color .15s ease, background .15s ease;
}
.cc-calc-radio input[type="radio"]:hover { border-color: var(--cc-accent, #b88b3b); }
.cc-calc-radio input[type="radio"]:checked {
	border-color: var(--cc-accent, #b88b3b);
	background: var(--cc-accent, #b88b3b);
}
.cc-calc-radio input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: #fff;
}
.cc-calc-radio input[type="radio"]:focus-visible {
	outline: 2px solid var(--cc-accent, #b88b3b);
	outline-offset: 2px;
}
.cc-calc-radio span {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--cc-ink, #0d0d0d);
}
.cc-calc-radio span strong {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--cc-accent, #b88b3b);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
}
.cc-calc-radio:has(input:checked) {
	border-color: var(--cc-accent, #b88b3b);
	background: linear-gradient(135deg, #fdf9ef 0%, #f7eed0 100%);
}

/* ── Result ───────────────────────────────────────────────── */
.cc-calc-result {
	margin-top: 4px;
	padding: 18px 18px 14px;
	background: linear-gradient(135deg, #fdf9ef 0%, #f2e8c8 100%);
	border-radius: 14px;
	border-left: 4px solid var(--cc-accent, #b88b3b);
	animation: cc-calc-pop .25s cubic-bezier(.2, .9, .3, 1.1);
}
.cc-calc-result[hidden] { display: none; }
.cc-calc-result__label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--cc-ink-2, #5e5e5e);
	font-weight: 700;
	margin-bottom: 10px;
}
.cc-calc-result__values {
	display: flex;
	align-items: center;
	gap: 12px;
}
.cc-calc-result__values > div {
	flex: 1;
	display: flex;
	align-items: baseline;
	gap: 4px;
}
.cc-calc-result__values small {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--cc-ink-2, #5e5e5e);
	font-weight: 700;
}
.cc-calc-result__values strong {
	font: 700 32px / 1 var(--cc-display, "Bricolage Grotesque", sans-serif);
	color: var(--cc-ink, #0d0d0d);
	margin-left: 6px;
}
.cc-calc-result__values span {
	font-size: 14px;
	font-weight: 600;
	color: var(--cc-ink-2, #5e5e5e);
}
.cc-calc-result__sep {
	font-size: 22px;
	color: var(--cc-ink-3, #9b9b9b);
	font-weight: 300;
}
.cc-calc-result__formula {
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--cc-ink-2, #5e5e5e);
	margin: 10px 0 0;
}

/* ── Footer (more-info link) ──────────────────────────────── */
.cc-calc-modal__foot {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px dashed var(--cc-line, #e7dcc1);
	text-align: center;
}
.cc-calc-modal__more {
	display: inline-block;
	font-size: 13.5px;
	color: var(--cc-accent, #b88b3b);
	font-weight: 600;
	text-decoration: none;
	transition: color .15s, transform .15s;
}
.cc-calc-modal__more:hover { color: var(--cc-ink, #0d0d0d); transform: translateX(2px); }

/* ── Body lock when modal is open ─────────────────────────── */
body.cc-calc-locked { overflow: hidden; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 520px) {
	/* Keep the dialog centered (matches desktop). The previous
	   bottom-sheet look made the modal feel disconnected from
	   the trigger button. */
	.cc-calc-modal { padding: 16px; align-items: center; }
	.cc-calc-modal__dialog {
		max-width: 100%;
		max-height: calc(100vh - 32px);
		border-radius: 18px;
		padding: 26px 20px 20px;
	}
	.cc-calc-form { grid-template-columns: 1fr; }
	.cc-calc-modal__head h2 { font-size: 22px; }
	.cc-calc-result__values strong { font-size: 28px; }
}
