/* ==========================================================================
   Cuba Provider — phones.css (Celulares: catálogo, búsqueda y portada)
   Se carga en el catálogo y en la portada, después de shop.css / home.css
   (inc/parts/phones.php). Móvil primero. Clases .cp-shop-brandtile,
   .cp-phone-…, .cp-card-phone… y .cp-home-phones…
   ========================================================================== */

/* ─────────────────────────── Cabecera de Celulares ─────────────────────────── */

/* Logo de la marca en una tarjeta blanca (no en el círculo de las categorías). */
.cp-shop-head__media--logo {
	width: 72px;
	height: 52px;
	padding: 4px;
	border-radius: var(--cp-r-card);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--cp-line), var(--cp-shadow-card);
}

.cp-shop-head__media--logo {
	position: relative;
}

.cp-shop-head__media--logo .cp-shop-head__img {
	position: absolute;
	inset: 4px;
	width: calc(100% - 8px);
	height: calc(100% - 8px);
	border-radius: 8px;
	object-fit: cover;
}

@media (min-width: 768px) {
	.cp-shop-head__media--logo {
		width: 92px;
		height: 64px;
	}
}

.cp-shop-head--phones .cp-shop-head__count {
	color: var(--cp-brand-dark);
}

/* ─────────────────────────── Marcas (tarjetas con logo) ─────────────────────────── */

.cp-shop-pills--brands .cp-shop-rail__track {
	gap: 10px;
	padding-top: 4px;
	padding-bottom: 6px;
}

.cp-shop-brandtile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	width: 96px;
	height: 88px;
	padding: 8px 6px 7px;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-r-card);
	background: #fff;
	color: var(--cp-text);
	text-align: center;
	-webkit-tap-highlight-color: transparent;
	transition: border-color var(--cp-fast), box-shadow var(--cp-fast), transform var(--cp-fast);
}

.cp-shop-brandtile:hover {
	border-color: var(--cp-ink);
	color: var(--cp-ink);
}

.cp-shop-brandtile:active {
	transform: scale(0.97);
}

.cp-shop-brandtile__logo {
	position: relative;
	display: grid;
	place-items: center;
	width: 76px;
	height: 40px;
	overflow: hidden;
	border-radius: 6px;
	color: var(--cp-ink);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.04em;
}

/* Los logos son miniaturas cuadradas con el logo en medio: se recortan arriba y abajo. */
.cp-shop-brandtile__logo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cp-shop-brandtile__logo.is-empty {
	background: var(--cp-surface-alt);
	color: var(--cp-brand-dark);
}

.cp-shop-brandtile__name {
	max-width: 100%;
	overflow: hidden;
	color: var(--cp-ink);
	font-size: 12px;
	font-weight: 750;
	line-height: 1.15;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cp-shop-brandtile__count {
	color: var(--cp-muted);
	font-size: 11px;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.cp-shop-brandtile.is-active {
	border: 2px solid var(--cp-brand);
	padding: 7px 5px 6px;
	background: var(--cp-brand-soft);
	box-shadow: 0 4px 14px rgba(33, 160, 74, 0.18);
}

.cp-shop-brandtile.is-active .cp-shop-brandtile__count,
.cp-shop-brandtile.is-active .cp-shop-brandtile__name {
	color: var(--cp-brand-dark);
}

.cp-shop-brandtile.is-active::after {
	content: "";
	position: absolute;
	top: -7px;
	right: -7px;
	width: 20px;
	height: 20px;
	border: 2px solid var(--cp-surface);
	border-radius: 50%;
	background: var(--cp-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.cp-shop-brandtile.is-all .cp-shop-brandtile__logo {
	background: var(--cp-surface-alt);
	color: var(--cp-brand-dark);
}

.cp-shop-brandtile.is-active.is-all .cp-shop-brandtile__logo {
	background: var(--cp-surface);
}

.cp-shop-brandtile.is-zero {
	opacity: 0.55;
}

.cp-shop-brandtile.is-ask {
	border-style: dashed;
	background: transparent;
}

.cp-shop-brandtile.is-ask .cp-shop-brandtile__logo {
	background: transparent;
	color: var(--cp-brand);
}

.cp-shop-brandtile.is-ask .cp-shop-brandtile__count {
	color: var(--cp-brand-dark);
	font-weight: 700;
}

/* La fila de marcas lleva su propio «hueco» para la insignia de la marcada. */
.cp-shop-pills--brands .cp-shop-rail__track > li {
	padding-top: 4px;
	padding-right: 4px;
}

@media (min-width: 768px) {
	.cp-shop-brandtile {
		width: 112px;
		height: 92px;
	}
	.cp-shop-brandtile__logo {
		width: 88px;
		height: 42px;
	}
}

/* ─────────────────────────── Filtros rápidos ─────────────────────────── */

.cp-phone-quick {
	margin-top: 10px;
}

.cp-phone-quick .cp-shop-rail__track {
	gap: 6px;
}

.cp-phone-chip {
	gap: 5px;
	height: 34px;
	padding: 0 11px;
	border-color: var(--cp-line-strong);
	color: var(--cp-ink);
	font-weight: 650;
	-webkit-tap-highlight-color: transparent;
}

.cp-phone-chip .cp-icon {
	color: var(--cp-brand);
}

.cp-phone-chip__n {
	color: var(--cp-faint);
	font-size: 11px;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.cp-phone-chip.is-active {
	border: 1px solid rgba(33, 160, 74, 0.45);
	background: var(--cp-brand-soft);
	color: var(--cp-brand-dark);
	font-weight: 750;
}

.cp-phone-chip.is-active .cp-icon {
	color: var(--cp-brand-dark);
}

.cp-phone-chip.is-active .cp-phone-chip__n {
	color: var(--cp-brand-dark);
	opacity: 0.75;
}

.cp-phone-quick__sep {
	align-self: stretch;
	width: 1px;
	margin: 6px 2px;
	background: var(--cp-line-strong);
}

/* Nombre del grupo delante de sus fichas («ROM», «RAM», «Batería»). */
.cp-phone-quick__label {
	align-self: center;
	padding: 0 2px 0 4px;
	color: var(--cp-muted);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

@media (min-width: 1024px) {
	.cp-phone-quick__sep {
		margin: 6px 4px;
	}
}

/* ─────────────────────────── Tarjeta de celular ─────────────────────────── */

.cp-card-phone__brand {
	color: var(--cp-muted);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.05em;
	line-height: 1.2;
	text-transform: uppercase;
}

.cp-card-phone .cp-card-phone__title {
	min-height: 0;
	color: var(--cp-ink);
	font-weight: 650;
}

.cp-card-phone__facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px 6px;
}

.cp-card-phone__specs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
}

.cp-card-phone__specs li {
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--cp-surface-alt);
	box-shadow: inset 0 0 0 1px var(--cp-line);
	color: var(--cp-ink);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.45;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.cp-card-phone__specs li.is-5g {
	background: var(--cp-ink);
	box-shadow: none;
	color: #fff;
}

/* Con ficha técnica: pantalla · batería · cámara. */
.cp-card-phone__line {
	margin: 0;
	overflow: hidden;
	color: var(--cp-muted);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-variant-numeric: tabular-nums;
}

.cp-card-phone__colors {
	display: inline-flex;
	align-items: center;
	padding-left: 3px;
}

.cp-card-phone__dot {
	width: 13px;
	height: 13px;
	margin-left: -3px;
	border: 2px solid var(--cp-surface);
	border-radius: 50%;
	background: var(--cp-dot, #ccc);
	box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.16);
}

.cp-card-phone__more {
	margin-left: 3px;
	color: var(--cp-muted);
	font-size: 11px;
	font-weight: 700;
}

/* Invitados: «Ver precio» también en escritorio (la regla del dueño). */
.cp-card-phone .cp-login-price--card {
	position: relative;
	gap: 5px;
	min-height: 30px;
	padding: 0 12px 0 10px;
	border-radius: var(--cp-r-pill);
	background: var(--cp-brand-soft);
	font-size: var(--cp-fs-xs);
	font-weight: 750;
	line-height: 1;
	white-space: nowrap;
}

.cp-card-phone .cp-login-price--card:hover {
	background: #d8f0e1;
	text-decoration: none;
}

.cp-card-phone .cp-login-price--card .cp-icon {
	width: 13px;
	height: 13px;
}

.cp-card-phone .cp-login-price--card .cp-login-price__long {
	display: none;
}

.cp-card-phone .cp-login-price--card .cp-login-price__short {
	display: inline;
}

.cp-card-phone .cp-card-product__price {
	margin-top: 2px;
}

/* Vista de lista (catálogo, ≥ 768 px): la ficha en su propia fila. */
@media (min-width: 768px) {
	.cp-shop-grid.is-list .cp-card-phone .cp-card-product__body {
		grid-template-areas:
			"brand price"
			"title price"
			"facts price"
			"line price"
			"meta price";
	}
	.cp-shop-grid.is-list .cp-card-phone__brand {
		grid-area: brand;
	}
	.cp-shop-grid.is-list .cp-card-phone__facts {
		grid-area: facts;
	}
	.cp-shop-grid.is-list .cp-card-phone__line {
		grid-area: line;
	}
}

/* ─────────────────────────── Búsqueda: «Celulares» ─────────────────────────── */

.cp-phone-hint {
	display: grid;
	gap: 10px;
	margin: 0 0 12px;
	padding: 14px;
	border: 1px solid rgba(33, 160, 74, 0.18);
	border-radius: var(--cp-r-card);
	background: linear-gradient(135deg, var(--cp-brand-soft) 0%, #fbfefc 70%);
}

.cp-phone-hint__main {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cp-phone-hint__icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--cp-brand);
	color: #fff;
	box-shadow: 0 6px 16px rgba(33, 160, 74, 0.3);
}

.cp-phone-hint__text {
	min-width: 0;
}

.cp-phone-hint__title {
	margin: 0;
	color: var(--cp-ink);
	font-size: var(--cp-fs-lg);
	font-weight: 800;
	line-height: 1.2;
}

.cp-phone-hint__text p {
	margin: 2px 0 0;
	color: var(--cp-text);
	font-size: var(--cp-fs-sm);
	line-height: 1.45;
}

/* Una fila: «Ver …» (verde), las marcas con stock y el chat. */
.cp-phone-hint__row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 -14px;
	padding: 2px 14px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.cp-phone-hint__row::-webkit-scrollbar {
	display: none;
}

.cp-phone-hint__row > li {
	flex: none;
}

.cp-phone-hint__go,
.cp-phone-hint__brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	border-radius: var(--cp-r-card);
	font-size: var(--cp-fs-sm);
	font-weight: 700;
	white-space: nowrap;
	-webkit-tap-highlight-color: transparent;
}

.cp-phone-hint__go {
	gap: 6px;
	padding: 0 14px 0 16px;
	background: var(--cp-brand-grad);
	box-shadow: 0 4px 14px rgba(33, 160, 74, 0.28);
	color: #fff;
	font-weight: 750;
}

.cp-phone-hint__go:hover {
	color: #fff;
	filter: brightness(1.05);
}

.cp-phone-hint__brand {
	padding: 0 12px 0 4px;
	border: 1px solid var(--cp-line-strong);
	background: #fff;
	color: var(--cp-ink);
}

.cp-phone-hint__brand:hover {
	border-color: var(--cp-ink);
	color: var(--cp-ink);
}

.cp-phone-hint__chat {
	gap: 6px;
	padding: 0 14px 0 12px;
	border-color: rgba(33, 160, 74, 0.3);
	color: var(--cp-brand-dark);
}

.cp-phone-hint__chat .cp-icon {
	color: var(--cp-brand);
}

.cp-phone-hint__logo {
	position: relative;
	display: grid;
	place-items: center;
	width: 52px;
	height: 34px;
	overflow: hidden;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 800;
}

.cp-phone-hint__logo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cp-phone-hint__logo.is-empty {
	background: var(--cp-surface-alt);
	color: var(--cp-brand-dark);
}

.cp-phone-hint__bcount {
	min-width: 22px;
	padding: 1px 7px;
	border-radius: var(--cp-r-pill);
	background: var(--cp-surface-alt);
	color: var(--cp-muted);
	font-size: 11px;
	text-align: center;
}

.cp-phone-hint__parts {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: var(--cp-r-img);
	background: var(--cp-surface);
	box-shadow: inset 0 0 0 1px var(--cp-line);
	color: var(--cp-ink);
	font-size: var(--cp-fs-sm);
	font-weight: 650;
	line-height: 1.35;
}

.cp-phone-hint__parts > span {
	flex: 1;
	min-width: 0;
}

.cp-phone-hint__parts .cp-icon:first-child {
	flex: none;
	color: var(--cp-brand);
}

.cp-phone-hint__parts:hover {
	color: var(--cp-brand-dark);
}

/* Accesos ya filtrados: «Filtra por [5G 3] [128 GB 2] [RAM 8 GB 2]». */
.cp-phone-hint__quick {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 -14px;
	padding: 0 14px;
	overflow-x: auto;
	scrollbar-width: none;
}

.cp-phone-hint__quick::-webkit-scrollbar {
	display: none;
}

.cp-phone-hint__qlabel {
	flex: none;
	color: var(--cp-muted);
	font-size: var(--cp-fs-xs);
	font-weight: 700;
}

.cp-phone-hint__chips {
	display: flex;
	gap: 6px;
	list-style: none;
}

.cp-phone-hint__chips > li {
	flex: none;
}

.cp-phone-hint__chips .cp-phone-chip {
	background: var(--cp-surface);
}

@media (min-width: 768px) {
	.cp-phone-hint {
		padding: 16px 18px;
	}
	.cp-phone-hint__row {
		flex-wrap: wrap;
		margin: 0;
		padding: 0 0 0 52px;
		overflow: visible;
	}
	.cp-phone-hint__quick {
		margin: 0;
		padding: 0 0 0 52px;
		overflow: visible;
	}
	.cp-phone-hint__chips {
		flex-wrap: wrap;
	}
	.cp-phone-hint__parts {
		margin-left: 52px;
	}
}

/* ─────────────────────────── Portada: «Celulares al por mayor» ─────────────────────────── */

.cp-home-phones__box {
	padding: 18px 14px 10px;
	border-radius: var(--cp-r-xl);
	background:
		radial-gradient(80% 140px at 100% 0%, rgba(33, 160, 74, 0.16) 0%, rgba(33, 160, 74, 0) 70%),
		linear-gradient(180deg, #eef8f1 0%, var(--cp-surface) 180px);
	box-shadow: var(--cp-shadow-card);
}

.cp-home-phones__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
}

.cp-home-phones__titles {
	min-width: 0;
}

.cp-home-phones__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--cp-brand-dark);
	font-size: var(--cp-fs-xs);
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.cp-home-phones__title {
	margin: 4px 0 2px;
	color: var(--cp-ink);
	font-size: var(--cp-fs-xl);
	font-weight: 800;
	line-height: 1.2;
}

.cp-home-phones__sub {
	margin: 0;
	color: var(--cp-muted);
	font-size: var(--cp-fs-sm);
}

.cp-home-phones__all {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 36px;
	padding: 0 12px 0 14px;
	border: 1px solid rgba(33, 160, 74, 0.28);
	border-radius: var(--cp-r-pill);
	background: var(--cp-surface);
	color: var(--cp-brand-dark);
	font-size: var(--cp-fs-sm);
	font-weight: 750;
	white-space: nowrap;
}

.cp-home-phones__all:hover {
	border-color: var(--cp-brand);
	color: var(--cp-brand-dark);
}

.cp-home-phones__brands {
	display: flex;
	gap: 8px;
	margin: 14px -14px 4px;
	padding: 2px 14px 4px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.cp-home-phones__brands::-webkit-scrollbar {
	display: none;
}

.cp-home-phones__brands > li {
	flex: none;
}

.cp-home-phones__brand {
	display: grid;
	grid-template-columns: auto auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 10px;
	height: 56px;
	padding: 0 14px 0 6px;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-r-card);
	background: #fff;
	color: var(--cp-ink);
}

.cp-home-phones__brand:hover {
	border-color: var(--cp-ink);
	color: var(--cp-ink);
}

.cp-home-phones__logo {
	position: relative;
	grid-row: 1 / 3;
	display: grid;
	place-items: center;
	width: 64px;
	height: 40px;
	overflow: hidden;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 800;
}

.cp-home-phones__logo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cp-home-phones__logo.is-empty {
	background: var(--cp-surface-alt);
	color: var(--cp-brand-dark);
}

.cp-home-phones__bname {
	align-self: end;
	font-size: var(--cp-fs-sm);
	font-weight: 750;
	line-height: 1.2;
	white-space: nowrap;
}

.cp-home-phones__bcount {
	align-self: start;
	color: var(--cp-muted);
	font-size: 11.5px;
	line-height: 1.3;
	white-space: nowrap;
}

.cp-home-phones .cp-rail {
	margin-top: 12px;
}

/* Tarjetas sobre fondo blanco: un filo (por fuera; dentro lo taparía la foto). */
.cp-home-phones .cp-card-product {
	box-shadow: 0 0 0 1px var(--cp-line);
}

@media (hover: hover) {
	.cp-home-phones .cp-card-product:hover {
		box-shadow: 0 0 0 1px var(--cp-line), var(--cp-shadow-hover);
	}
}

@media (min-width: 768px) {
	.cp-home-phones__box {
		padding: 24px 24px 14px;
	}
	.cp-home-phones__title {
		font-size: 1.375rem;
	}
	.cp-home-phones__brands {
		flex-wrap: wrap;
		margin: 16px 0 4px;
		padding: 2px 0 4px;
		overflow: visible;
	}
}

@media (min-width: 1024px) {
	.cp-home-phones__box {
		padding: 28px 32px 18px;
	}
}

/* ==========================================================================
   Móvil estilo app (< 768 px)
   La franja de la búsqueda y la sección de la portada, a todo el ancho como
   el resto de bandas; las tarjetas de marca, algo más compactas.
   ========================================================================== */

@media (max-width: 767px) {
	.cp-shop-brandtile {
		width: 92px;
		height: 84px;
	}

	.cp-phone-hint {
		margin: 0 calc(-1 * var(--cp-gutter));
		padding: 12px var(--cp-gutter);
		border-width: 1px 0;
		border-radius: 0;
	}

	.cp-phone-hint__row {
		margin: 0 calc(-1 * var(--cp-gutter));
		padding: 2px var(--cp-gutter);
	}

	.cp-home-phones__box {
		margin: 0 calc(-1 * var(--cp-gutter));
		padding: 16px var(--cp-gutter) 8px;
		border-radius: 0;
		box-shadow: none;
	}

	.cp-home-phones__brands {
		margin: 12px calc(-1 * var(--cp-gutter)) 2px;
		padding: 2px var(--cp-gutter) 4px;
	}
}
