/* Rincón de Ideas – Calculadora de Envíos Zippin
 * Paleta rosa Rincón + Natom Pro (heredada del sitio).
 * ------------------------------------------------------------- */

.rdi-zc {
	--rdi-pink:        #ec4a8e;
	--rdi-pink-dark:   #c4336f;
	--rdi-pink-soft:   #ffe6f0;
	--rdi-pink-bg:     #fff5f9;
	--rdi-ink:         #2d1b28;
	--rdi-muted:       #7a6a73;
	--rdi-border:      #f6c9d9;
	--rdi-success:     #2f9e6e;
	--rdi-error:       #c4336f;
	--rdi-radius:      12px;
	--rdi-radius-sm:   8px;
	--rdi-shadow:      0 3px 14px rgba(236, 74, 142, 0.08);
	--rdi-shadow-hover:0 5px 18px rgba(236, 74, 142, 0.15);

	font-family: 'Natom Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--rdi-ink);
	background: #fff;
	border: 1px solid var(--rdi-border);
	border-radius: var(--rdi-radius);
	padding: 14px 16px;
	margin: 16px 0;
	box-shadow: var(--rdi-shadow);
	box-sizing: border-box;
	max-width: 100%;
}
.rdi-zc *,
.rdi-zc *::before,
.rdi-zc *::after { box-sizing: border-box; }
.rdi-zc { container-type: inline-size; container-name: rdizc; }

/* Head --------------------------------------------------------- */
.rdi-zc__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 0;
	cursor: pointer;
	list-style: none;
	user-select: none;
}
.rdi-zc__head::-webkit-details-marker { display: none; }
.rdi-zc__head-text { flex: 1 1 auto; min-width: 0; }
.rdi-zc__chevron {
	flex: 0 0 auto;
	color: var(--rdi-pink);
	transition: transform 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
}
.rdi-zc[open] .rdi-zc__chevron { transform: rotate(180deg); }
.rdi-zc__body {
	margin-top: 12px;
	animation: rdi-zc-slide 0.2s ease;
}
@keyframes rdi-zc-slide {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}
.rdi-zc__icon {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--rdi-pink-soft);
	color: var(--rdi-pink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.rdi-zc__icon svg { width: 16px; height: 16px; }
.rdi-zc__title {
	margin: 0 0 1px;
	font-size: 0.98rem;
	font-weight: 700;
	color: var(--rdi-pink-dark);
	line-height: 1.2;
}
.rdi-zc__subtitle {
	margin: 0;
	font-size: 0.78rem;
	color: var(--rdi-muted);
	line-height: 1.3;
}

/* Form --------------------------------------------------------- */
/* Default: 2x2 (funciona en cualquier contenedor angosto) */
.rdi-zc__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 10px;
	margin-bottom: 10px;
}
.rdi-zc__field--prov { grid-column: 1; }
.rdi-zc__field--city { grid-column: 2; }
.rdi-zc__field--cp   { grid-column: 1; }
.rdi-zc__field--qty  { grid-column: 2; }

/* Si hay ancho suficiente en el CONTENEDOR, una sola fila */
@container rdizc (min-width: 560px) {
	.rdi-zc__row {
		grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 95px) minmax(0, 65px);
	}
	.rdi-zc__field--prov { grid-column: auto; }
	.rdi-zc__field--city { grid-column: auto; }
	.rdi-zc__field--cp   { grid-column: auto; }
	.rdi-zc__field--qty  { grid-column: auto; }
}
.rdi-zc__field { display: flex; flex-direction: column; min-width: 0; }
.rdi-zc__label {
	font-size: 0.68rem;
	font-weight: 600;
	color: var(--rdi-muted);
	margin-bottom: 4px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rdi-zc .rdi-zc__select,
.rdi-zc .rdi-zc__input {
	font: inherit;
	font-family: 'Natom Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 0.85rem !important;
	line-height: 1.2 !important;
	color: var(--rdi-ink);
	background: #fff;
	border: 1px solid var(--rdi-border);
	border-radius: var(--rdi-radius-sm);
	padding: 6px 10px !important;
	height: 34px !important;
	min-height: 34px !important;
	max-height: 34px !important;
	width: 100%;
	min-width: 0;
	margin: 0 !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
	vertical-align: middle;
	box-sizing: border-box;
}
.rdi-zc .rdi-zc__select { padding-right: 26px !important; }
.rdi-zc .rdi-zc__select option { color: var(--rdi-ink); font-size: 14px; }
.rdi-zc__select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23ec4a8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	padding-right: 22px;
	text-overflow: ellipsis;
}
.rdi-zc__select:focus,
.rdi-zc__input:focus {
	outline: none;
	border-color: var(--rdi-pink);
	box-shadow: 0 0 0 2px rgba(236, 74, 142, 0.18);
}
.rdi-zc__field--error .rdi-zc__select,
.rdi-zc__field--error .rdi-zc__input {
	border-color: var(--rdi-error);
	box-shadow: 0 0 0 3px rgba(196, 51, 111, 0.15);
}
.rdi-zc__input:disabled {
	background: #f5f5f7;
	color: #999;
	cursor: not-allowed;
}

/* Botón -------------------------------------------------------- */
.rdi-zc__btn {
	position: relative;
	display: inline-flex;
	align-self: flex-start;
	font: inherit;
	font-weight: 700;
	font-size: 0.85rem;
	color: #fff;
	background: linear-gradient(135deg, var(--rdi-pink) 0%, var(--rdi-pink-dark) 100%);
	border: 0;
	border-radius: var(--rdi-radius-sm);
	padding: 6px 18px;
	height: 32px;
	cursor: pointer;
	letter-spacing: 0.02em;
	transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s ease;
	box-shadow: 0 2px 8px rgba(236, 74, 142, 0.28);
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.rdi-zc__btn:hover:not(:disabled) {
	box-shadow: var(--rdi-shadow-hover);
	transform: translateY(-1px);
}
.rdi-zc__btn:active { transform: translateY(0); }
.rdi-zc__btn:disabled { opacity: 0.7; cursor: wait; }

.rdi-zc__spinner {
	display: none;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rdi-zc-spin 0.7s linear infinite;
}
.rdi-zc.is-loading .rdi-zc__spinner { display: inline-block; }
.rdi-zc.is-loading .rdi-zc__btn-text { opacity: 0.85; }
@keyframes rdi-zc-spin { to { transform: rotate(360deg); } }

/* Mensaje ------------------------------------------------------ */
.rdi-zc__message {
	margin-top: 10px;
	padding: 8px 10px;
	border-radius: var(--rdi-radius-sm);
	font-size: 0.82rem;
	line-height: 1.35;
	display: none;
}
.rdi-zc__message.is-visible { display: block; }
.rdi-zc__message.is-error   { background: #fde9f0; color: var(--rdi-pink-dark); border: 1px solid var(--rdi-border); }
.rdi-zc__message.is-info    { background: var(--rdi-pink-bg); color: var(--rdi-ink); border: 1px solid var(--rdi-border); }

/* Resultados --------------------------------------------------- */
.rdi-zc__results {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.rdi-zc__results:empty { margin: 0; }

.rdi-zc__result {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	background: var(--rdi-pink-bg);
	border: 1px solid var(--rdi-border);
	border-radius: var(--rdi-radius-sm);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
	animation: rdi-zc-fadein 0.25s ease both;
}
.rdi-zc__result:hover {
	transform: translateY(-1px);
	border-color: var(--rdi-pink);
	box-shadow: var(--rdi-shadow);
}
.rdi-zc__result-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #fff;
	color: var(--rdi-pink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--rdi-border);
	flex: 0 0 auto;
}
.rdi-zc__result-icon svg { width: 14px; height: 14px; }
.rdi-zc__result-body { min-width: 0; }
.rdi-zc__result-name {
	margin: 0;
	font-weight: 600;
	color: var(--rdi-ink);
	font-size: 0.85rem;
	line-height: 1.25;
	word-wrap: break-word;
}
.rdi-zc__result-eta {
	margin: 1px 0 0;
	font-size: 0.72rem;
	color: var(--rdi-muted);
}
.rdi-zc__result-price {
	font-weight: 800;
	font-size: 0.95rem;
	color: var(--rdi-pink-dark);
	white-space: nowrap;
	text-align: right;
}

@keyframes rdi-zc-fadein {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Responsive --------------------------------------------------- */
@media (max-width: 640px) {
	.rdi-zc { padding: 12px; }
	.rdi-zc__result {
		grid-template-columns: auto 1fr;
	}
	.rdi-zc__result-price {
		grid-column: 1 / -1;
		text-align: right;
		border-top: 1px dashed var(--rdi-border);
		padding-top: 5px;
	}
}
/* Contenedor muy angosto: 1 columna */
@container rdizc (max-width: 340px) {
	.rdi-zc__row { grid-template-columns: 1fr; }
	.rdi-zc__field--prov,
	.rdi-zc__field--city,
	.rdi-zc__field--cp,
	.rdi-zc__field--qty { grid-column: 1; }
}
