/* =====================================================================
   Tien21 · Tienda asignada en la cabecera
   - Desktop: chip en .c-navbar__options (hueco de "Enviar a") + popover
   - Móvil:   barra fina en .c-navbar__more-options + bottom sheet
   Ajusta --t21s-bp si vuestro breakpoint desktop no es 1024px.
   ===================================================================== */
:root {
	--t21s-blue: #0060a7;
	--t21s-blue-dark: #004b83;
	--t21s-red: #e2271d;
	--t21s-ink: #1d2433;
	--t21s-muted: #5b6475;
	--t21s-line: #dfe3ea;
	--t21s-soft: #f3f5f8;
	--t21s-wa: #1a7f37;
	--t21s-radius: 12px;
	--t21s-shadow: 0 16px 40px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .08);
	--t21s-store-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6475' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M4 9.5V20h16V9.5M3 9.5 5 4h14l2 5.5c0 1.4-1.1 2.5-2.5 2.5S16 10.9 16 9.5c0 1.4-1.1 2.5-2.5 2.5h-3C9.1 12 8 10.9 8 9.5 8 10.9 6.9 12 5.5 12S3 10.9 3 9.5ZM10 20v-5h4v5'/%3E%3C/svg%3E");
}

/* --- Los "Enviar a" antiguos se ocultan pero siguen en el DOM:
       common.js sigue escribiendo el CP en ellos y el nuevo JS los usa
       para abrir el modal de CP existente. --------------------------- */
.c-navbar--store .c-navbar__send-to-desktop,
.c-navbar--store .js-zip-code-link-mobile {
	display: none !important;
}

/* --- Home: el bloque c-your-shop deja de verse, pero se mantiene en el
       DOM como fuente de datos (home.js lo sigue rellenando) y el H1
       sigue presente para SEO/lectores de pantalla. ------------------- */
.c-your-shop__cnt--in-header {
	padding: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	background: none !important;
	border: 0 !important;
}
.c-your-shop__cnt--in-header .c-your-shop {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* =====================================================================
   Chip (desktop)
   ===================================================================== */
.c-store {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
	min-width: 0;
	color: var(--t21s-ink);
}

.c-store__chip {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	max-width: 290px;
	padding: 5px 12px 5px 5px;
	border: 1px solid var(--t21s-line);
	border-radius: var(--t21s-radius);
	background: #fff;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.c-store__chip:hover,
.c-store__chip[aria-expanded="true"] {
	border-color: var(--t21s-blue);
	box-shadow: 0 0 0 3px rgba(0, 96, 167, .12);
}

.c-store__chip:focus-visible,
.c-store__change:focus-visible,
.c-store-bar:focus-visible,
.c-store__panel a:focus-visible,
.c-store__panel button:focus-visible {
	outline: 2px solid var(--t21s-blue);
	outline-offset: 2px;
}

/* Miniatura: icono de tienda de fondo hasta que llega la foto */
.c-store__thumb,
.c-store-bar__thumb,
.c-store__photo {
	position: relative;
	flex: 0 0 auto;
	overflow: hidden;
	background: var(--t21s-soft) var(--t21s-store-icon) center / 55% no-repeat;
}
.c-store__thumb { width: 44px; height: 44px; border-radius: 8px; }
.c-store__thumb img,
.c-store-bar__thumb img,
.c-store__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.c-store__txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}
.c-store__eyebrow {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--t21s-muted);
}
.c-store__name {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}
.c-store__name-txt {
	overflow: hidden;
	text-overflow: ellipsis;
}
.c-store__chev {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: var(--t21s-blue);
	transition: transform .2s ease;
}
[aria-expanded="true"] .c-store__chev { transform: rotate(180deg); }

.c-store__addr {
	margin-top: 2px;
	font-size: 12px;
	color: var(--t21s-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.c-store__addr:empty { display: none; }

.c-store__change {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--t21s-blue);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	cursor: pointer;
}
.c-store__change svg { width: 16px; height: 16px; }

/* Estados del chip */
.c-store[data-state="loading"] .c-store__thumb,
.c-store-bar[data-state="loading"] .c-store-bar__thumb {
	animation: t21s-pulse 1.2s ease-in-out infinite;
}
.c-store[data-state="loading"] .c-store__name-txt,
.c-store-bar[data-state="loading"] [data-store-field="name"] {
	color: var(--t21s-muted);
	font-weight: 600;
}
/* Sin tienda asignada: el CTA "Cambiar tienda" sobra */
.c-store:not([data-state="ready"]) .c-store__change { display: none; }

@keyframes t21s-pulse { 50% { opacity: .45; } }

/* =====================================================================
   Panel (popover en desktop)
   ===================================================================== */
.c-store__overlay { display: none; }

.c-store__panel {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	z-index: 1000;
	width: 360px;
	padding: 18px 20px 16px;
	border-radius: 16px;
	background: #fff;
	box-shadow: var(--t21s-shadow);
	color: var(--t21s-ink);
	text-align: left;
	animation: t21s-pop .16s ease-out;
}
.c-store__panel[hidden],
.c-store__overlay[hidden] { display: none !important; }
.c-store__panel:focus { outline: none; }

.c-store__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.c-store__panel-eyebrow {
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--t21s-muted);
}
.c-store__close {
	display: inline-flex;
	padding: 6px;
	margin: -6px -6px -6px 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--t21s-ink);
	cursor: pointer;
}
.c-store__close:hover { background: var(--t21s-soft); }
.c-store__close svg { width: 20px; height: 20px; }

.c-store__card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}
.c-store__photo { width: 96px; height: 72px; border-radius: 10px; }
.c-store__card-body { min-width: 0; }
.c-store__card-name {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
}
.c-store__card-addr {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--t21s-muted);
}
.c-store__directions-link {
	display: inline-block;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--t21s-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.c-store__actions {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}
.c-store__action {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--t21s-line);
	border-radius: 10px;
	background: #fff;
	color: var(--t21s-ink);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .15s ease, background-color .15s ease;
}
.c-store__action:hover { border-color: var(--t21s-ink); }
.c-store__action svg { flex: 0 0 auto; width: 18px; height: 18px; }
.c-store__action--wa { border-color: var(--t21s-wa); color: var(--t21s-wa); }
.c-store__action--wa:hover { border-color: var(--t21s-wa); background: #f0f8f2; }
.c-store__action[hidden] { display: none; }
.c-store__action--directions,
.c-store__lbl-mob { display: none; }

.c-store__ship {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 14px;
	padding: 11px 14px;
	border-radius: 10px;
	background: var(--t21s-soft);
	font-size: 14px;
}
.c-store__link {
	flex: 0 0 auto;
	padding: 0;
	border: 0;
	background: none;
	color: var(--t21s-blue);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.c-store__primary {
	display: block;
	width: 100%;
	min-height: 46px;
	margin-top: 14px;
	border: 0;
	border-radius: 10px;
	background: var(--t21s-blue);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .15s ease;
}
.c-store__primary:hover { background: var(--t21s-blue-dark); }

.c-store__note {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
	color: var(--t21s-muted);
}

@keyframes t21s-pop {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

/* =====================================================================
   Barra móvil (en .c-navbar__more-options)
   ===================================================================== */
.c-store-bar { display: none; }

@media (max-width: 1023px) {
	/* El contenedor desktop no ocupa sitio: solo aloja el panel */
	.c-store {
		position: static;
		flex: 0 0 0;
		width: 0;
		gap: 0;
	}
	.c-store__chip,
	.c-store__change { display: none; }

	.c-navbar--store .c-navbar__more-options { padding: 0; }

	/* La barra de tienda baja por debajo de la banda del menú
	   (VER PRODUCTOS + navegación secundaria). #navbar es flex-wrap en
	   móvil, así que basta con mandarla al final con order. */
	.c-navbar--store .c-navbar__more-options {
		order: 1;
		width: 100%;
	}

	.c-store-bar {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		min-height: 42px;
		padding: 6px 16px;
		border: 0;
		border-top: 1px solid var(--t21s-line);
		border-bottom: 1px solid var(--t21s-line);
		background: var(--t21s-soft);
		color: var(--t21s-ink);
		font: inherit;
		font-size: 13px;
		line-height: 1.2;
		text-align: left;
		cursor: pointer;
	}
	.c-store-bar__thumb { width: 28px; height: 28px; border-radius: 6px; }
	.c-store-bar__txt {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.c-store-bar__label { color: var(--t21s-muted); }
	.c-store-bar__cp {
		flex: 0 0 auto;
		color: var(--t21s-muted);
		white-space: nowrap;
	}
	.c-store-bar__cp strong { color: var(--t21s-ink); }
	.c-store-bar[data-state="empty"] .c-store-bar__cp { display: none; }
	.c-store-bar .c-store__chev { width: 18px; height: 18px; }

	/* Bottom sheet */
	.c-store__overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999;
		background: rgba(16, 24, 40, .45);
		animation: t21s-fade .2s ease-out;
	}
	.c-store__panel {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		max-height: 88vh;
		overflow-y: auto;
		padding: 26px 20px calc(18px + env(safe-area-inset-bottom));
		border-radius: 20px 20px 0 0;
		animation: t21s-up .26s cubic-bezier(.2, .8, .2, 1);
	}
	.c-store__panel::before {
		content: "";
		position: absolute;
		top: 9px;
		left: 50%;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		border-radius: 2px;
		background: var(--t21s-line);
	}
	.c-store__photo { width: 104px; height: 78px; }
	.c-store__card-name { font-size: 18px; }
	.c-store__card-addr { font-size: 15px; }
	.c-store__directions-link,
	.c-store__lbl-desk { display: none; }

	.c-store__action--directions { display: flex; }
	.c-store__lbl-mob { display: inline; }
	.c-store__action {
		flex-direction: column;
		gap: 4px;
		min-height: 64px;
		font-size: 14px;
	}
	.c-store__action svg { width: 22px; height: 22px; }
	.c-store__primary { min-height: 50px; }

	html.c-store-lock,
	html.c-store-lock body { overflow: hidden; }
}

@keyframes t21s-up {
	from { transform: translateY(100%); }
	to   { transform: none; }
}
@keyframes t21s-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.c-store__panel,
	.c-store__overlay,
	.c-store[data-state="loading"] .c-store__thumb,
	.c-store-bar[data-state="loading"] .c-store-bar__thumb { animation: none; }
}

/* =====================================================================
   Estado "sin tienda cerca" (data-state="nostore")
   ===================================================================== */
.c-store__view--nostore { display: none; }
.c-store[data-state="nostore"] .c-store__view--ready { display: none; }
.c-store[data-state="nostore"] .c-store__view--nostore { display: block; }

/* Chip y barra: miniatura con pin en vez de foto */
.c-store[data-state="nostore"] .c-store__thumb,
.c-store-bar[data-state="nostore"] .c-store-bar__thumb {
	background-color: #fdeceb;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2271d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.4'/%3E%3C/svg%3E");
	background-size: 55%;
}
.c-store[data-state="nostore"] .c-store__addr { color: var(--t21s-muted); }

.c-store__empty {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}
.c-store__empty-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 14px;
	background: #fdeceb;
	color: var(--t21s-red);
}
.c-store__empty-icon svg { width: 28px; height: 28px; }
.c-store__view--nostore .c-store__card-name { font-size: 16px; }
.c-store__view--nostore .c-store__card-addr { font-size: 14px; }

.c-store__perks {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	font-weight: 600;
}
.c-store__perks li { display: flex; align-items: center; gap: 10px; }
.c-store__perks svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--t21s-blue); }

.c-store__secondary {
	display: block;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	color: var(--t21s-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 1023px) {
	.c-store__view--nostore .c-store__card-name { font-size: 17px; }
	.c-store__view--nostore .c-store__card-addr { font-size: 15px; }
	.c-store__perks { flex-direction: row; gap: 8px; }
	.c-store__perks li {
		flex: 1 1 0;
		flex-direction: column;
		gap: 6px;
		padding: 12px 6px;
		border: 1px solid var(--t21s-line);
		border-radius: 10px;
		font-size: 12px;
		line-height: 1.25;
		text-align: center;
	}
	.c-store__perks svg { width: 22px; height: 22px; }
}

/* =====================================================================
   Home: H1 integrado en la banda azul clara de "Miles de productos…"
   - Centrado, en el azul marino de los titulares de Tien21
   - Si debajo va el slider pro1 (contentPro = pro.1), comparte su fondo
     y queda como cabecera de esa banda.
   ===================================================================== */
.c-home-intro {
	padding: 32px 0 4px;
	text-align: center;
}
.c-home-intro__title {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	color: #062558;
}
.c-home-intro__title::after {
	content: "";
	display: block;
	width: 44px;
	height: 3px;
	margin: 12px auto 0;
	border-radius: 2px;
	background: var(--t21s-red);
}

/* Unido a la banda del slider "Miles de productos…" */
.c-home-intro:has(~ .pro1-slider) {
	background: rgba(11, 94, 168, .06);
}
/* El título del slider trae margin-top: 50px desde su propio CSS (con más
   especificidad), por eso aquí hace falta !important, acotado a este caso. */
.c-home-intro ~ section.pro1-slider > p.title {
	margin-top: 6px !important;
}

@media (max-width: 1023px) {
	.c-home-intro { padding: 24px 0 0; }
	.c-home-intro__title { font-size: 20px; }
	.c-home-intro__title::after { margin-top: 10px; }
	.c-home-intro ~ section.pro1-slider > p.title { margin-top: 4px !important; }
}

/* =====================================================================
   CP por defecto (28020) sin geolocalizar: data-fallback
   Mismo aspecto que "sin tienda", pero sin mostrar el CP falso.
   ===================================================================== */
.c-store[data-fallback] .c-store__ship,
.c-store-bar[data-fallback] .c-store-bar__cp,
.c-store-bar[data-fallback] .c-store-bar__label {
	display: none;
}
.c-store[data-fallback] .c-store__name-txt,
.c-store-bar[data-fallback] [data-store-field="name"] {
	color: var(--t21s-blue);
}