/* Responsive global — plugin Llantas Web */

html {
	-webkit-text-size-adjust: 100%;
}

body:has(.llw-header),
body:has(.yantas-catalog),
body.llw-cart-page,
body.llw-checkout-page,
body.llw-my-account {
	overflow-x: clip;
}

img,
video,
.llw-logo-video {
	max-width: 100%;
	height: auto;
}

/* ── Header ─────────────────────────────────────────── */
@media (max-width: 992px) {
	.llw-header__inner {
		gap: 0.65rem;
		padding: 0.65rem 0.85rem;
	}

	.llw-header__search {
		flex: 1 1 auto;
		min-width: 0;
	}

	.llw-header__login-text {
		display: none;
	}

	.llw-header__actions {
		gap: 0.35rem;
		flex-shrink: 0;
	}
}

@media (max-width: 768px) {
	body.llw-mobile-header .llw-sticky-shell {
		display: flex;
		flex-direction: column;
	}

	body.llw-mobile-header .llw-sticky-shell .llw-header__inner {
		flex-wrap: wrap;
	}

	body.llw-mobile-header .llw-sticky-shell .llw-header__search {
		order: 3;
		width: 100%;
		flex: 1 1 100%;
	}

	.llw-header__icon,
	.llw-header__menu {
		width: 40px;
		height: 40px;
	}

	.llw-cart-drawer__panel {
		width: min(100vw, 420px);
		max-width: 100%;
	}

	.llw-sidebar__panel {
		width: min(100vw, 360px);
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.llw-header__inner {
		padding: 0.55rem 0.65rem;
	}

	.llw-header__badge {
		min-width: 16px;
		height: 16px;
		font-size: 0.62rem;
	}
}

/* ── Segmentos: carrusel deslizable en móvil/tablet ───── */
@media (max-width: 1024px) {
	.llw-segmentos {
		/*
		 * Elementor puede ensanchar el padre del shortcode en móvil.
		 * Centramos respecto a ese padre y trasladamos media pantalla:
		 * la barra queda exactamente de borde a borde del viewport.
		 */
		position: relative;
		left: 50%;
		right: auto;
		width: 100vw;
		max-width: 100vw;
		margin: 0;
		transform: translateX(-50%);
		overflow: hidden;
		/* Tope duro: evita que la lista ensanche las columnas flex de Elementor. */
	}

	.llw-segmentos__list {
		flex-wrap: nowrap;
		justify-content: flex-start !important;
		width: 100%;
		min-width: 0;
		margin: 0 !important;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 0;
		scrollbar-width: none;
	}

	.llw-segmentos__list::-webkit-scrollbar {
		display: none;
	}

	.llw-segmentos__item {
		scroll-snap-align: start !important;
		scroll-snap-stop: always;
		flex: 0 0 auto;
	}
}

/* ── Tarjetas producto ───────────────────────────────── */
@media (max-width: 1200px) {
	.yantas-carousel__products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 992px) {
	.yantas-carousel__products,
	.yantas-filtro__products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 520px) {
	.yantas-carousel__products,
	.yantas-filtro__products,
	.yantas-catalog__grid,
	.llw-favorites__grid {
		grid-template-columns: 1fr !important;
	}

	.llw-card__title {
		font-size: 0.82rem;
		min-height: calc(3 * 1.35em);
	}

	.llw-card__price {
		font-size: 1.05rem;
	}

	.llw-card__actions {
		flex-wrap: wrap;
	}

	.llw-card__cart {
		min-height: 36px;
		font-size: 0.86rem !important;
	}
}

/* ── Catálogo ────────────────────────────────────────── */
@media (max-width: 992px) {
	.yantas-catalog__toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.yantas-catalog__results-meta {
		text-align: left;
	}
}

/* ── Filtro home ─────────────────────────────────────── */
@media (max-width: 640px) {
	.yantas-filtro {
		margin-left: 0.75rem;
		margin-right: 0.75rem;
	}

	.yantas-filtro__body {
		padding: 1.15rem 1rem 1.35rem;
	}

	/* Con las pestañas apiladas (ver filter.css), cada una es un botón en fila. */
	.yantas-filtro__tab {
		flex-direction: row;
		gap: 0.65rem;
		padding: 0.85rem 1.1rem;
		font-size: 0.95rem;
	}
}

/* ── Carrusel / partners ─────────────────────────────── */
@media (max-width: 768px) {
	.yantas-carousel__nav {
		display: none;
	}

	.yantas-partner-logos__track {
		gap: 1rem;
	}

	.yantas-category-banners__grid {
		grid-template-columns: 1fr !important;
	}
}

/* ── Modales y cuenta ────────────────────────────────── */
@media (max-width: 768px) {
	.llw-modal__dialog {
		width: min(100%, 520px);
		padding: 24px 20px 20px;
		max-height: calc(100vh - 2rem);
		overflow-y: auto;
	}

	.llw-account-layout {
		gap: 1rem;
	}

	.llw-profile__row--2,
	.llw-profile__row--doc {
		grid-template-columns: 1fr !important;
	}
}

/* ── Carrito drawer / resumen ────────────────────────── */
@media (max-width: 520px) {
	.llw-cart-drawer__item {
		grid-template-columns: 68px minmax(0, 1fr);
		gap: 0.65rem;
	}

	.llw-cart-drawer__photo img {
		max-width: 68px;
	}

	.llw-cart-summary {
		padding: 0.75rem;
		align-items: flex-end;
	}

	.llw-cart-summary__dialog {
		width: 100%;
		max-height: calc(100vh - 1.5rem);
		overflow-y: auto;
		border-radius: 16px 16px 0 0;
	}
}

/* ── Header móvil: logo | espacio | carrito + menú ───── */
@media (max-width: 768px) {
	html,
	body {
		/* Ningún bloque del tema o Elementor debe ensanchar la pantalla móvil. */
		max-width: 100%;
		overflow-x: clip;
	}

	.yantas-catalog,
	.yantas-filtro,
	.yantas-destacados,
	.llw-segmentos {
		max-width: 100%;
		min-width: 0;
	}

	/* Barra superior “¿Eres empresa?”: Elementor la ocultaba en móvil. */
	body .llw-top-business-banner {
		display: block !important;
		width: 100% !important;
		min-height: 30px;
		color: #fff !important;
		background: #e30613 !important;
	}

	body .llw-top-business-banner .elementor-container,
	body .llw-top-business-banner .elementor-widget-wrap,
	body .llw-top-business-banner .elementor-widget-container {
		display: flex !important;
		align-items: center;
		justify-content: center;
		min-height: 30px;
	}

	body .llw-top-business-banner,
	body .llw-top-business-banner * {
		color: #fff !important;
		font-size: 12px !important;
		line-height: 1.25 !important;
		text-align: center !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) {
		grid-column: 1 / -1 !important;
		grid-row: 1 !important;
		width: 100% !important;
		justify-self: stretch !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) > .elementor-container {
		display: flex !important;
		flex-flow: row nowrap !important;
		align-items: center !important;
		justify-content: space-between !important;
		width: 100% !important;
		max-width: 100% !important;
		padding: 0 12px !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) .elementor-column {
		width: auto !important;
		max-width: none !important;
		flex: 0 1 auto !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) .elementor-column:has(#llw-header) {
		flex: 0 0 auto !important;
		margin-left: auto !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) .elementor-widget {
		margin-bottom: 0 !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) .elementor-widget-image {
		text-align: left !important;
	}

	body.llw-mobile-header .llw-sticky-shell > .elementor-section:has(#llw-header) .elementor-widget-image img {
		display: block;
		width: auto;
		max-width: 140px;
		height: auto;
	}
}
