/* Sublime COD Form – frontend (estilo Releasit) */
:root {
	--scf-primary: #f7ea00;
	--scf-btn-text: #111111;
	--scf-accent: #e11d26;
	--scf-selected: #0b74c4;
	--scf-sale: #e11d26;
	--scf-title: #e11d26;
	--scf-font: inherit;
	--scf-ink: #111111;
	--scf-muted: #6b7280;
	--scf-line: #cfcfcf;
	--scf-soft: #ececec;
	--scf-danger: #dc2626;
	--scf-radius: 8px;
}

/* Ocultar el botón nativo de WooCommerce cuando el COD lo reemplaza */
.scf-replace-atc form.cart .single_add_to_cart_button,
.scf-replace-atc form.cart .quantity { display: none !important; }

/* ---------- Botones ---------- */
.scf-btn {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
	width: 100%; min-height: 54px; margin: 12px 0 0; padding: 12px 18px 12px 52px;
	border: 0; border-radius: var(--scf-radius); cursor: pointer;
	background: var(--scf-primary); color: var(--scf-btn-text);
	font-family: var(--scf-font); font-weight: 700; font-size: 16px; line-height: 1.25; letter-spacing: .01em; text-align: center; text-transform: none;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .22);
	transition: transform .15s ease, filter .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.scf-btn:not(:has(.scf-btn__icon)) { padding-left: 18px; }
.scf-btn:hover { filter: brightness(1.04); transform: translateY(-1px); color: var(--scf-btn-text); }
.scf-btn:active { transform: translateY(1px); }
.scf-btn:disabled { opacity: .75; cursor: progress; transform: none; }
.scf-btn__icon { position: absolute; left: 18px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%); fill: currentColor; }
.scf-btn__sub { font-size: 12.5px; font-weight: 500; opacity: .9; letter-spacing: 0; }
.scf-online { color: #fff; }
.scf-online:hover { color: #fff; }

.scf-anim-shake { animation: scf-shake 4s ease-in-out 2s infinite; }
.scf-anim-pulse { animation: scf-pulse 2s ease-in-out infinite; }
@keyframes scf-shake {
	0%, 88%, 100% { transform: translateX(0); }
	90%, 94%, 98% { transform: translateX(-4px) rotate(-.5deg); }
	92%, 96% { transform: translateX(4px) rotate(.5deg); }
}
@keyframes scf-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .scf-anim-shake, .scf-anim-pulse { animation: none; } }

/* Botón fijo en móvil */
.scf-sticky { display: none; }
@media (max-width: 767px) {
	.scf-sticky {
		display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, .96); box-shadow: 0 -6px 18px rgba(0, 0, 0, .08);
		transform: translateY(110%); transition: transform .25s ease;
	}
	.scf-sticky.is-visible { transform: translateY(0); }
	.scf-sticky .scf-btn { margin: 0; min-height: 50px; }
}

/* ---------- Popup ---------- */
html.scf-lock, html.scf-lock body { overflow: hidden !important; }
.scf-modal { position: fixed; inset: 0; z-index: 999999; display: none; }
.scf-modal.is-open { display: block; }
.scf-modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: scf-fade .2s ease; }
.scf-modal__dialog {
	position: relative; margin: 3vh auto; width: calc(100% - 24px); max-width: 640px; max-height: 94vh; overflow-y: auto;
	background: #fff; border-radius: 10px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45);
	animation: scf-pop .22s ease; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.scf-modal__close {
	position: absolute; top: 12px; right: 12px; z-index: 2;
	width: 34px; height: 34px; border: 0; padding: 0; background: transparent; color: #333;
	font-size: 34px; font-weight: 300; line-height: 30px; cursor: pointer; box-shadow: none;
}
.scf-modal__close:hover { color: #000; background: transparent; }
@keyframes scf-fade { from { opacity: 0; } }
@keyframes scf-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@media (max-width: 600px) {
	.scf-modal__dialog {
		position: absolute; bottom: 0; left: 0; right: 0; margin: 0; width: 100%; max-width: none; max-height: 96vh;
		border-radius: 14px 14px 0 0; animation: scf-up .25s ease; padding-bottom: env(safe-area-inset-bottom);
	}
	@keyframes scf-up { from { transform: translateY(40px); opacity: .4; } }
}

/* ---------- Contenedor ---------- */
.scf-wrap { color: var(--scf-ink); font-family: var(--scf-font); font-size: 15px; line-height: 1.35; text-align: left; }
.scf-wrap *, .scf-wrap *::before, .scf-wrap *::after { box-sizing: border-box; }
.scf-wrap--popup { padding: 18px 20px 22px; }
.scf-wrap--embedded { margin: 16px 0; padding: 18px; border: 1px solid var(--scf-line); border-radius: 10px; background: #fff; }
.scf-view[hidden] { display: none !important; }

.scf-head { text-align: center; margin: 0 34px 14px; }
.scf-wrap--embedded .scf-head { margin: 0 0 14px; }
.scf-wrap .scf-title {
	margin: 0; font-family: var(--scf-font); font-size: 21px; font-weight: 800; line-height: 1.25;
	color: var(--scf-title); text-transform: uppercase; letter-spacing: .01em;
}
.scf-subtitle { margin: 4px 0 0; color: var(--scf-muted); font-size: 14px; }

.scf-downsell-banner {
	margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; text-align: center; font-weight: 700; font-size: 14px;
	background: #e8f6ec; color: #15803d;
}
.scf-downsell-banner[hidden] { display: none; }

/* ---------- Ofertas ---------- */
.scf-offers { display: grid; gap: 14px; margin-bottom: 18px; }
.scf-offer {
	position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px;
	border: 1px solid var(--scf-line); border-radius: 6px; background: #fff; cursor: pointer;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.scf-offer input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.scf-offer.is-selected {
	border: 2px solid var(--scf-selected); padding: 13px;
	background: color-mix(in srgb, var(--scf-selected) 14%, #fff);
}
.scf-offer:has(input:focus-visible) { outline: 2px solid var(--scf-selected); outline-offset: 2px; }
.scf-offer__img { width: 64px; height: 64px; flex: 0 0 64px; object-fit: cover; border-radius: 6px; background: #f3f3f3; }
.scf-offer__body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.scf-offer__title { font-weight: 700; font-size: 17px; line-height: 1.2; text-transform: uppercase; color: var(--scf-ink); }
.scf-offer__badge {
	display: inline-block; padding: 4px 9px; border-radius: 4px; background: var(--scf-accent);
	color: #fff; font-size: 14px; font-weight: 700; line-height: 1.2;
}
.scf-offer__badge[hidden] { display: none; }
.scf-offer__prices { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; text-align: right; }
.scf-offer__regular { color: #555; font-size: 15px; }
.scf-offer__regular:empty { display: none; }
.scf-offer__total { font-weight: 700; font-size: 19px; color: var(--scf-ink); white-space: nowrap; }
.scf-offer__total.is-sale { color: var(--scf-sale); }

/* Producto sin ofertas: tarjeta con cantidad */
.scf-offer--single { cursor: default; margin-bottom: 18px; }
.scf-qty__control { display: inline-flex; align-items: center; border: 1px solid var(--scf-line); border-radius: 6px; overflow: hidden; background: #fff; }
.scf-qty__btn { width: 34px; height: 34px; border: 0; background: #f3f3f3; color: var(--scf-ink); font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }
.scf-qty__input { width: 42px; height: 34px; border: 0; padding: 0; text-align: center; font-weight: 700; font-size: 16px; -moz-appearance: textfield; background: #fff; color: var(--scf-ink); }
.scf-qty__input::-webkit-outer-spin-button, .scf-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Resumen ---------- */
.scf-summary { margin: 0 0 20px; padding: 14px 16px; border-radius: 6px; background: var(--scf-soft); font-size: 17px; }
.scf-summary__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.scf-summary__row > span:last-child { font-weight: 700; }
.scf-summary__row[hidden] { display: none; }
.scf-summary__row--save > span:last-child { color: var(--scf-sale); }
.scf-tag { width: 17px; height: 17px; fill: #555; vertical-align: -3px; }
.scf-summary__row--total { margin-top: 8px; padding-top: 12px; border-top: 1px solid #c9c9c9; font-weight: 700; font-size: 18px; }
.scf-summary__row--total > span:last-child { font-size: 21px; }

/* ---------- Método de envío ---------- */
.scf-section-title { margin: 0 0 10px; font-weight: 700; font-size: 18px; color: var(--scf-ink); }
.scf-section-title--center { margin-top: 22px; text-align: center; font-size: 20px; }
.scf-shipping-method {
	display: flex; align-items: center; gap: 14px; padding: 14px 18px;
	border: 1px solid var(--scf-line); border-radius: 6px; font-size: 16px;
}
.scf-shipping-method__dot { width: 18px; height: 18px; border-radius: 50%; border: 5px solid #000; flex: 0 0 auto; }
.scf-shipping-method__name { flex: 1 1 auto; }
.scf-shipping-method__price { font-weight: 700; }

/* ---------- Campos ---------- */
.scf-fields { display: grid; gap: 14px; margin-top: 14px; }
.scf-wrap .scf-label { display: block; margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--scf-ink); line-height: 1.2; }
.scf-req { color: var(--scf-danger); }
.scf-control { position: relative; display: flex; align-items: stretch; width: 100%; }
.scf-control.has-icon .scf-icon {
	display: flex; align-items: center; justify-content: center; flex: 0 0 52px;
	background: #e3e3e3; border: 1px solid var(--scf-line); border-right: 0; border-radius: 6px 0 0 6px;
}
.scf-icon svg { width: 22px; height: 22px; fill: #333; }
.scf-wrap .scf-input {
	display: block; width: 100%; min-width: 0; height: 48px; margin: 0; padding: 10px 14px;
	border: 1px solid var(--scf-line); border-radius: 6px; background: #fff; color: var(--scf-ink);
	font-family: var(--scf-font); font-size: 16px; /* 16px evita el zoom en iPhone */ box-shadow: none; outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.scf-control.has-icon .scf-input { border-radius: 0 6px 6px 0; }
.scf-wrap textarea.scf-input { height: auto; min-height: 64px; resize: vertical; }
.scf-wrap select.scf-input { appearance: auto; padding-right: 8px; }
.scf-wrap .scf-input::placeholder { color: #8a8a8a; }
.scf-wrap .scf-input:focus { border-color: var(--scf-selected); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scf-selected) 18%, transparent); }
.scf-field.has-error .scf-input,
.scf-field.has-error .scf-icon { border-color: var(--scf-danger) !important; }
.scf-error-msg { color: var(--scf-danger); font-size: 13px; margin-top: 4px; font-weight: 600; }
.scf-error-msg:empty { display: none; }

/* Etiqueta a la izquierda (estilo Releasit) */
.scf-layout--inline .scf-field { display: grid; grid-template-columns: 130px 1fr; column-gap: 14px; align-items: center; }
.scf-layout--inline .scf-field .scf-label { margin: 0; }
.scf-layout--inline .scf-field .scf-error-msg { grid-column: 2; }
@media (max-width: 420px) {
	.scf-layout--inline .scf-field { grid-template-columns: 100px 1fr; column-gap: 10px; }
	.scf-layout--inline .scf-field .scf-label { font-size: 14px; }
	.scf-control.has-icon .scf-icon { flex-basis: 44px; }
}

/* Honeypot */
.scf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.scf-alert { margin: 14px 0 0; padding: 10px 12px; border-radius: 6px; background: #fef2f2; color: #991b1b; font-size: 14px; font-weight: 600; }
.scf-alert[hidden] { display: none; }

.scf-submit { margin-top: 22px; font-size: 17px; }
.scf-online { margin-top: 14px; min-height: 64px; font-size: 16px; }
.scf-trust { margin: 12px 0 0; text-align: center; color: var(--scf-muted); font-size: 13px; }
.scf-trust-img { display: block; max-width: 100%; height: auto; margin: 18px auto 0; }

/* ---------- Upsell / downsell ---------- */
.scf-upsell { text-align: center; padding: 8px 4px; }
.scf-upsell__eyebrow { margin: 0 0 12px; font-weight: 800; color: var(--scf-title); text-transform: uppercase; letter-spacing: .03em; font-size: 15px; }
.scf-upsell__img { width: 170px; height: 170px; object-fit: cover; border-radius: 8px; margin: 0 auto 12px; display: block; background: #f3f3f3; }
.scf-upsell__name { margin: 0 0 6px; font-size: 21px; font-weight: 800; }
.scf-upsell__text { margin: 0 0 10px; color: #444; }
.scf-upsell__prices { margin-bottom: 4px; }
.scf-upsell__price { font-size: 25px; font-weight: 800; color: var(--scf-sale); }
.scf-upsell__regular { color: #555; }
.scf-link { display: block; width: 100%; margin: 10px 0 0; padding: 8px; border: 0; background: none; color: var(--scf-muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; box-shadow: none; }

/* ---------- Éxito ---------- */
.scf-success { text-align: center; padding: 22px 6px; }
.scf-success__icon {
	width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
	background: #16a34a; color: #fff; font-size: 32px; font-weight: 800; animation: scf-pop .3s ease;
}
.scf-success__title { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.scf-success__text { margin: 0; color: var(--scf-muted); }
