/* ── Retiro y Envío — TiendaPocket Addon 30 ───────────────────────────────── */

.tp-ship-block {
	margin: 1.25rem 0;
}

/* Línea de "envío estimado" en el mini-carrito (offcanvas) y en la página
   de carrito, reflejando la preferencia elegida en la ficha de producto. */
.tp-cart-totals__row--shipping-estimate {
	color: var(--color-text-muted, #666);
}

.tp-cart-shipping-estimate {
	font-weight: 600;
	color: var(--color-text, #1a1a1a);
}

.tp-cart-shipping-preference {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	padding: 10px 0;
	border-bottom: 1px solid var(--color-border, #eee);
	margin-bottom: 10px;
}

.tp-cart-totals__shipping-note {
	font-size: 11px;
	color: #888;
	font-style: italic;
	margin: -4px 0 8px;
	text-align: right;
}

.tp-ship-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.tp-ship-cards:has(.tp-ship-card:only-child) {
	grid-template-columns: 1fr;
}

.tp-ship-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	background: #fff;
	border: 1px solid var(--color-border, #e0e0e0);
	border-radius: 10px;
	padding: 16px;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
	overflow: hidden;
}

.tp-ship-card:hover {
	border-color: #1a1a1a;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.tp-ship-card:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

.tp-ship-card.is-chosen {
	border-color: #2e7d32;
	background: #f3faf3;
	animation: tp-ship-choice-pop .35s ease;
}

.tp-ship-card__status.is-chosen-label {
	color: #2e7d32;
}

.tp-ship-card__icon {
	color: #1a1a1a;
	margin-bottom: 4px;
}

.tp-ship-card__title {
	font-size: 15px;
	font-weight: 700;
	color: #1a1a1a;
}

.tp-ship-card__subtitle {
	font-size: 12px;
	color: #888;
	margin-top: -2px;
}

.tp-ship-card__status {
	margin-top: 6px;
	font-size: 12px;
	font-weight: 700;
}

.tp-ship-card__status.is-in-stock { color: #2e7d32; }
.tp-ship-card__status.is-out-of-stock { color: #c0392b; }
.tp-ship-card__status.is-select { color: #888; font-weight: 500; }

/* Animación sutil para llamar la atención sobre las tarjetas (UX) —
   un brillo que recorre la tarjeta cada tanto, sin ser invasivo. El
   recorrido visible dura ~1.8s a velocidad constante (linear) y después
   hace una pausa de "descanso" antes de repetir, para que se perciba
   como un barrido fluido y no como un parpadeo. */
.tp-ship-card::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%);
	background-size: 300% 100%;
	background-position: 150% 0;
	pointer-events: none;
	animation: tp-ship-shimmer 4s linear infinite;
	animation-delay: .6s;
}

.tp-ship-card--delivery::after {
	animation-delay: 2.6s;
}

@keyframes tp-ship-shimmer {
	0%   { background-position: 150% 0; }
	45%  { background-position: -150% 0; }
	100% { background-position: -150% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.tp-ship-card::after { animation: none; }
}

/* Popup */
.tp-ship-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	z-index: 99997;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.tp-ship-overlay.is-open {
	display: flex;
}

.tp-ship-modal {
	background: #fff;
	border-radius: 14px;
	width: 100%;
	max-width: 440px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 26px 22px 22px;
	position: relative;
	box-shadow: 0 25px 60px rgba(0,0,0,.35);
}

.tp-ship-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #888;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tp-ship-modal__close:hover {
	background: #f2f2f2;
	color: #333;
}

.tp-ship-modal__title {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 16px;
	padding-right: 20px;
	color: #1a1a1a;
}

/* Lista de sucursales (popup Retiro) */
.tp-ship-sucursal-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tp-ship-sucursal-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 12px;
}

.tp-ship-sucursal-item__icon {
	color: #1a1a1a;
	flex-shrink: 0;
	margin-top: 2px;
}

.tp-ship-sucursal-item__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
}

.tp-ship-sucursal-item__info strong {
	font-size: 14px;
}

.tp-ship-sucursal-item__address,
.tp-ship-sucursal-item__schedule {
	color: #666;
}

/* Formulario de provincia + CP (popup Envío) */
.tp-ship-cp-form {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
}

.tp-ship-state-select,
.tp-ship-cp-input {
	flex: 1;
	min-width: 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
}

.tp-ship-state-select:focus,
.tp-ship-cp-input:focus {
	outline: none;
	border-color: #1a1a1a;
}

.tp-ship-cp-btn {
	width: 100%;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	margin-bottom: 14px;
}

.tp-ship-cp-btn:hover {
	opacity: .88;
}

.tp-ship-cp-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.tp-ship-cp-btn.is-chosen {
	background: #2e7d32;
	opacity: 1;
	animation: tp-ship-choice-pop .35s ease;
}

.tp-ship-cp-result {
	font-size: 13px;
}

.tp-ship-cp-result .tp-ship-rate {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 8px;
}

.tp-ship-cp-result .tp-ship-rate.is-chosen {
	border-color: #2e7d32;
	background: #f3faf3;
}

.tp-ship-change-btn {
	display: block;
	width: 100%;
	background: none;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #555;
	cursor: pointer;
	margin-top: 4px;
}

.tp-ship-change-btn:hover {
	background: #f7f7f7;
}

.tp-ship-cp-result .tp-ship-rate__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tp-ship-cp-result .tp-ship-rate__label {
	font-weight: 600;
	color: #1a1a1a;
}

.tp-ship-cp-result .tp-ship-rate__cost {
	font-weight: 700;
	color: #2e7d32;
}

.tp-ship-cp-result .tp-ship-rate__choose {
	flex-shrink: 0;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}

.tp-ship-cp-result .tp-ship-rate__choose:hover {
	opacity: .88;
}

.tp-ship-cp-result .tp-ship-rate__choose:disabled {
	opacity: .6;
	cursor: default;
}

.tp-ship-cp-result .tp-ship-rate__choose.is-chosen {
	background: #2e7d32;
	color: #fff;
	opacity: 1;
	animation: tp-ship-choice-pop .35s ease;
}

@keyframes tp-ship-choice-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.12); }
	100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.tp-ship-cp-result .tp-ship-rate__choose.is-chosen { animation: none; }
}

.tp-ship-cp-result .tp-ship-eta {
	color: #666;
	margin-top: 10px;
}

.tp-ship-cp-result .tp-ship-cart-notice {
	color: #888;
	font-size: 12px;
	margin-top: 6px;
	font-style: italic;
}

.tp-ship-cp-result .tp-ship-error {
	color: #c0392b;
}

.tp-ship-choice-feedback {
	font-size: 13px;
	font-weight: 700;
	color: #2e7d32;
	text-align: center;
	margin: 10px 0 0;
	min-height: 18px;
}

@media (max-width: 480px) {
	.tp-ship-cards {
		grid-template-columns: 1fr;
	}

	.tp-ship-cp-result .tp-ship-rate {
		flex-direction: column;
		align-items: stretch;
	}

	.tp-ship-cp-result .tp-ship-rate__choose {
		width: 100%;
	}
}

/* ── Calculador de envío del mini-carrito (offcanvas) ───────────────────────
   Versión compacta del addon: provincia + CP con botón "Calcular" explícito
   (sin auto-cálculo, ver order-shipping-cart.js) y dos secciones de filas
   seleccionables ("Envío a domicilio" / "Retirar por"), reusando la misma
   preferencia de sesión que la ficha de producto. */

.tp-ship-cart-block {
	padding: 12px 16px 6px;
	border-bottom: 1px solid var(--color-border, #eee);
}

.tp-ship-cart-heading {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--color-text-muted, #666);
	margin-bottom: 10px;
}

.tp-ship-cart-heading svg {
	flex-shrink: 0;
}

.tp-ship-cart-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 12px;
	border: 1px solid var(--color-border, #ddd);
	border-radius: 7px;
	background: #faf9f7;
	margin-bottom: 10px;
}

/* El atributo [hidden] nativo pierde contra un display:flex/column propio de
   la clase con la misma especificidad — sin esto, el JS que alterna
   .hidden = true/false en el resumen colapsado y el formulario no tiene
   ningún efecto visual y ambos quedan visibles a la vez. */
.tp-ship-cart-summary[hidden],
.tp-ship-cart-location[hidden] {
	display: none;
}

.tp-ship-cart-summary__text {
	font-size: 12px;
	color: #666;
}

.tp-ship-cart-summary__text strong {
	color: #1a1a1a;
}

.tp-ship-cart-summary__edit {
	border: none;
	background: none;
	padding: 0;
	font-size: 12px;
	font-weight: 700;
	color: #1a1a1a;
	text-decoration: underline;
	cursor: pointer;
	white-space: nowrap;
	font-family: inherit;
}

.tp-ship-cart-location {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 4px;
}

.tp-ship-cart-select-wrap {
	position: relative;
	border: 1px solid var(--color-border, #ddd);
	border-radius: 7px;
	background: #faf9f7;
	height: 38px;
}

.tp-ship-cart-select-wrap select {
	width: 100%;
	height: 100%;
	appearance: none;
	border: none;
	background: transparent;
	padding: 0 26px 0 12px;
	font-size: 13px;
	font-family: inherit;
	color: #1a1a1a;
	cursor: pointer;
}

.tp-ship-cart-select-wrap::after {
	content: "";
	position: absolute;
	right: 11px;
	top: 50%;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid #999;
	border-bottom: 1.5px solid #999;
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.tp-ship-cart-cp-wrap {
	display: flex;
	align-items: center;
	border: 1px solid var(--color-border, #ddd);
	border-radius: 7px;
	background: #faf9f7;
	padding: 0 12px;
	height: 38px;
}

.tp-ship-cart-cp {
	border: none;
	background: transparent;
	outline: none;
	font-size: 13px;
	color: #1a1a1a;
	width: 100%;
	font-family: inherit;
}

.tp-ship-cart-geo-hint {
	font-size: 11px;
	color: #888;
	margin: 4px 2px 12px;
}

.tp-ship-cart-calc-btn {
	width: 100%;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 7px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	margin-top: 2px;
}

.tp-ship-cart-calc-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.tp-ship-cart-result {
	font-size: 13px;
}

.tp-ship-cart-result .tp-ship-cart-group {
	margin-bottom: 12px;
}

.tp-ship-cart-result .tp-ship-cart-group-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: #1a1a1a;
	margin-bottom: 8px;
}

.tp-ship-cart-result .tp-ship-cart-group-title svg {
	flex-shrink: 0;
	color: #888;
}

.tp-ship-cart-result .tp-ship-cart-rows {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tp-ship-cart-result .tp-ship-cart-row {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	padding: 9px 10px;
	border: 1px solid var(--color-border, #e0e0e0);
	border-radius: 8px;
	cursor: pointer;
	background: #fff;
	transition: border-color .15s ease, background .15s ease;
}

.tp-ship-cart-result .tp-ship-cart-row.is-active {
	border-color: #2e7d32;
	background: #f3faf3;
}

.tp-ship-cart-result .tp-ship-cart-row__radio {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	border: 1.5px solid #ccc;
	flex-shrink: 0;
	position: relative;
	margin-top: 1px;
}

.tp-ship-cart-result .tp-ship-cart-row.is-active .tp-ship-cart-row__radio {
	border-color: #2e7d32;
	background: #2e7d32;
}

.tp-ship-cart-result .tp-ship-cart-row.is-active .tp-ship-cart-row__radio::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 4px;
	height: 8px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

.tp-ship-cart-result .tp-ship-cart-row__body {
	flex: 1;
	min-width: 0;
}

.tp-ship-cart-result .tp-ship-cart-row__label {
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.3;
}

.tp-ship-cart-result .tp-ship-cart-row__sub {
	font-size: 11px;
	color: #888;
	line-height: 1.4;
	margin-top: 2px;
}

.tp-ship-cart-result .tp-ship-cart-row__price {
	font-size: 13px;
	font-weight: 700;
	color: #1a1a1a;
	white-space: nowrap;
	margin-top: 1px;
}

.tp-ship-cart-result .tp-ship-cart-row__price.is-free {
	color: #2e7d32;
}

.tp-ship-cart-result .tp-ship-error {
	color: #c0392b;
	font-size: 12px;
	margin: 4px 0 10px;
}

/* Fila única mostrada tras elegir un método — mismo look que .is-active pero
   no clickeable (ya está confirmada), con un botón aparte para volver a ver
   todas las opciones. */
.tp-ship-cart-result .tp-ship-cart-chosen {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	padding: 9px 10px;
	border: 1px solid #2e7d32;
	border-radius: 8px;
	background: #f3faf3;
	margin-bottom: 8px;
}

.tp-ship-cart-result .tp-ship-cart-chosen .tp-ship-cart-row__radio {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	border-color: #2e7d32;
	background: #2e7d32;
	flex-shrink: 0;
	position: relative;
	margin-top: 1px;
}

.tp-ship-cart-result .tp-ship-cart-chosen .tp-ship-cart-row__radio::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 4px;
	height: 8px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

.tp-ship-cart-change-method-btn {
	border: none;
	background: none;
	padding: 0;
	font-size: 12px;
	font-weight: 700;
	color: #1a1a1a;
	text-decoration: underline;
	cursor: pointer;
	font-family: inherit;
}

.tp-ship-cart-result .tp-ship-cart-loading {
	color: #888;
	font-size: 12px;
	margin: 4px 0 10px;
}
