/* Flami App: experiencia móvil. Todo lo visible está dentro de @media (max-width: 767px). */

:root {
	--flami-pink: #fd86a9;
	--flami-pink-soft: #fff0f4;
	--flami-ink: #3b3735;
	--flami-muted: #8a8380;
	--flami-line: #eee8e6;
	--flami-green: #57bf6d;
	--flami-bar-h: 62px;
}

/* Elementos de la app ocultos por defecto (escritorio). */
.flami-tabbar,
.flami-sheet { display: none; }

/* Bloque de confianza (también en escritorio). */
.flami-trust {
	list-style: none;
	margin: 14px 0 18px;
	padding: 12px 14px;
	border: 1px solid var(--flami-line);
	border-radius: 12px;
	background: #fffafb;
}
.flami-trust li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 5px 0;
	font-size: 14px;
	line-height: 1.35;
	color: var(--flami-ink);
}
.flami-trust .flami-ico { flex: 0 0 22px; width: 22px; height: 22px; stroke: var(--flami-pink); }

/* El carrito lateral de Flami reemplaza al del tema OceanWP (si no, se abren dos a la vez). */
#oceanwp-cart-sidebar-wrap,
.oceanwp-cart-sidebar-overlay { display: none !important; }
body.show-cart .current-shop-items-dropdown { opacity: 0 !important; visibility: hidden !important; }

/* Campos ocultos del checkout (p. ej. país, si solo se vende en Uruguay). */
.woocommerce form .form-row.flami-hidden { display: none !important; }

/* ---------- Carrito lateral (todas las pantallas) ---------- */
.flami-sheet--cart:not([hidden]) {
	position: fixed;
	inset: 0;
	z-index: 99995;
	display: block;
	background: rgba(30, 24, 22, .45);
	animation: flami-fade .18s ease-out;
}
.flami-sheet__panel--side {
	position: absolute;
	top: 0; right: 0; bottom: 0;
	width: min(420px, 100vw);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 0 20px 20px;
	background: #fff;
	box-shadow: -10px 0 30px rgba(0, 0, 0, .12);
	animation: flami-left .22s ease-out;
}
.flami-sheet--cart .flami-sheet__head {
	position: sticky; top: 0; z-index: 1;
	display: flex; align-items: center; justify-content: space-between;
	margin: 0 -20px 6px; padding: 16px 20px 12px;
	background: #fff; border-bottom: 1px solid var(--flami-line);
	font-size: 18px; color: var(--flami-ink);
}
.flami-sheet--cart .flami-sheet__close {
	display: inline-flex; padding: 6px; border: 0; border-radius: 50%;
	background: #f5f1f0; color: var(--flami-ink); line-height: 0;
}
.flami-sheet--cart .widget_shopping_cart_content { flex: 1 0 auto; }
.flami-sheet--cart ul.woocommerce-mini-cart { margin: 0; padding: 0; list-style: none; }
.flami-sheet--cart .woocommerce-mini-cart-item {
	position: relative;
	display: block;
	min-height: 76px;
	margin: 0; padding: 12px 28px 12px 76px !important;
	border-bottom: 1px solid var(--flami-line);
	font-size: 14px; line-height: 1.35; color: var(--flami-ink);
}
.flami-sheet--cart .woocommerce-mini-cart-item img {
	position: absolute; left: 0; top: 12px;
	width: 64px !important; height: 64px !important; margin: 0 !important;
	object-fit: cover; border-radius: 10px;
}
.flami-sheet--cart .woocommerce-mini-cart-item a:not(.remove) { color: var(--flami-ink); font-weight: 600; text-decoration: none; }
.flami-sheet--cart .woocommerce-mini-cart-item .quantity { display: block; margin-top: 4px; color: var(--flami-muted); }
.flami-sheet--cart .woocommerce-mini-cart-item .remove {
	position: absolute !important; right: 0; top: 12px; left: auto !important;
	width: 22px; height: 22px; border-radius: 50%;
	color: var(--flami-muted) !important; font-size: 18px; line-height: 20px; text-align: center;
}
.flami-sheet--cart .woocommerce-mini-cart__total {
	display: flex; justify-content: space-between;
	margin: 14px 0 12px; padding: 0; font-size: 16px; color: var(--flami-ink);
}
.flami-sheet--cart .woocommerce-mini-cart__buttons { display: flex; flex-direction: column-reverse; gap: 10px; margin: 0; }
.flami-sheet--cart .woocommerce-mini-cart__buttons .button {
	display: block; width: 100%; margin: 0 !important; padding: 13px !important;
	border-radius: 12px !important; text-align: center;
	font-size: 15px !important; font-weight: 700; letter-spacing: 0 !important; text-transform: none !important;
	background: #fff !important; color: var(--flami-ink) !important; border: 1.5px solid var(--flami-line) !important;
}
.flami-sheet--cart .woocommerce-mini-cart__buttons .button.checkout {
	background: var(--flami-pink) !important; border-color: var(--flami-pink) !important; color: #fff !important;
	font-size: 16px !important; padding: 15px !important;
}
.flami-sheet--cart .woocommerce-mini-cart__empty-message { margin: 30px 0; text-align: center; color: var(--flami-muted); }
.flami-keep-shopping {
	margin: 14px auto 0; padding: 6px 10px; border: 0; background: none;
	color: var(--flami-muted); font-size: 14px; text-decoration: underline; cursor: pointer;
}
.flami-keep-shopping:hover { background: none; color: var(--flami-ink); }
body.flami-noscroll { overflow: hidden; }
@keyframes flami-fade { from { opacity: 0; } }
@keyframes flami-left { from { transform: translateX(40px); opacity: .4; } }

/* Chips de categorías en la tienda (también en escritorio). */
.flami-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 22px;
}
.flami-filter a {
	padding: 7px 14px;
	border: 1px solid var(--flami-line);
	border-radius: 999px;
	background: #fff;
	color: var(--flami-ink);
	font-size: 14px;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, border-color .15s;
}
.flami-filter a:hover { border-color: var(--flami-pink); color: var(--flami-ink); }
.flami-filter a.is-active {
	border-color: var(--flami-pink);
	background: var(--flami-pink);
	color: #fff;
	font-weight: 700;
}

.flami-ico {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (max-width: 767px) {

	/* ---------- Espacio para la barra inferior ---------- */
	body { padding-bottom: calc(var(--flami-bar-h) + env(safe-area-inset-bottom)); }

	/* ---------- Encabezado compacto ---------- */
	#top-bar-wrap { display: none !important; }            /* barra superior vacía */
	#site-header-inner { padding-top: 6px; padding-bottom: 6px; }
	#site-header #site-logo #site-logo-inner a img,
	#site-header .custom-logo { max-height: 52px !important; width: auto !important; }
	.oceanwp-mobile-menu-icon .oceanwp-text { display: none; } /* oculta la palabra "Menú" */
	.oceanwp-mobile-menu-icon .wcmenucart { display: none !important; } /* el carrito ya está en la barra inferior */
	#content-wrap { padding-top: 14px !important; padding-bottom: 24px !important; } /* menos espacio vacío arriba */
	.owp-product-nav-wrap { display: none !important; }       /* "Producto anterior / siguiente" */
	.woocommerce .oceanwp-toolbar { display: none !important; } /* "Visualización 12 / 24 / Todo" */

	/* Etiquetas "¡OFERTA!" / "AGOTADO" en una sola línea */
	.woocommerce span.onsale,
	.woocommerce .outofstock-badge {
		width: auto !important; height: auto !important; min-height: 0 !important;
		padding: 4px 9px !important; border-radius: 6px !important;
		white-space: nowrap; font-size: 11px !important; line-height: 1.3 !important;
	}

	/* ---------- Barra inferior tipo app ---------- */
	.flami-tabbar {
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 9990;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		height: calc(var(--flami-bar-h) + env(safe-area-inset-bottom));
		padding-bottom: env(safe-area-inset-bottom);
		background: rgba(255, 255, 255, .97);
		border-top: 1px solid var(--flami-line);
		box-shadow: 0 -4px 18px rgba(59, 55, 53, .06);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
	}
	.flami-tabbar a,
	.flami-tabbar button {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
		box-shadow: none;
		color: var(--flami-muted);
		font: 600 11px/1.1 Nunito, sans-serif;
		letter-spacing: 0;
		text-transform: none;
		text-decoration: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}
	.flami-tabbar a:hover,
	.flami-tabbar button:hover,
	.flami-tabbar button:focus { background: none; color: var(--flami-ink); }
	.flami-tabbar .is-active { color: var(--flami-pink); }
	.flami-tabbar .flami-ico { width: 25px; height: 25px; }
	.flami-ico-wrap { position: relative; display: inline-flex; }
	.flami-badge {
		position: absolute;
		top: -5px; right: -9px;
		min-width: 18px; height: 18px;
		padding: 0 5px;
		border-radius: 9px;
		background: var(--flami-pink);
		color: #fff;
		font: 700 11px/18px Nunito, sans-serif;
		text-align: center;
	}
	.flami-badge.is-empty { display: none; }

	/* El botón flotante de WhatsApp se reemplaza por la pestaña de la barra;
	   la ventanita de chat se abre por encima de la barra. */
	.joinchat .joinchat__button { display: none !important; }
	.joinchat { bottom: calc(var(--flami-bar-h) + env(safe-area-inset-bottom)) !important; }

	/* ---------- Paneles (categorías / búsqueda) ---------- */
	.flami-sheet:not([hidden]) {
		position: fixed;
		inset: 0;
		z-index: 9995;
		display: block;
		background: rgba(30, 24, 22, .45);
		animation: flami-fade .18s ease-out;
	}
	.flami-sheet__panel {
		position: absolute;
		left: 0; right: 0; bottom: 0;
		max-height: 82vh;
		overflow-y: auto;
		padding: 6px 18px calc(24px + env(safe-area-inset-bottom));
		border-radius: 20px 20px 0 0;
		background: #fff;
		animation: flami-up .22s ease-out;
		-webkit-overflow-scrolling: touch;
	}
	.flami-sheet__panel--top {
		top: 0; bottom: auto;
		border-radius: 0 0 20px 20px;
		padding-top: calc(10px + env(safe-area-inset-top));
		animation: flami-down .22s ease-out;
	}
	.flami-sheet__head {
		position: sticky; top: -6px;
		display: flex; align-items: center; justify-content: space-between;
		margin: 0 -18px 8px; padding: 12px 18px 10px;
		background: #fff;
		font-size: 18px; color: var(--flami-ink);
	}
	.flami-sheet__close {
		display: inline-flex; padding: 6px; border: 0; border-radius: 50%;
		background: #f5f1f0; color: var(--flami-ink);
	}
	.flami-sheet__close:hover { background: #ece6e4; color: var(--flami-ink); }
	.flami-sheet__all {
		display: block; margin-bottom: 12px; padding: 12px 14px;
		border-radius: 12px; background: var(--flami-pink-soft);
		color: var(--flami-ink); font-weight: 700; text-decoration: none;
	}
	.flami-cat { padding: 10px 0; border-top: 1px solid var(--flami-line); }
	.flami-cat__main {
		display: flex; align-items: center; gap: 12px;
		color: var(--flami-ink); font-size: 16px; font-weight: 700; text-decoration: none;
	}
	.flami-cat__main img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; }
	.flami-cat__main small { margin-left: auto; color: var(--flami-muted); font-weight: 400; }
	.flami-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
	.flami-chips a {
		padding: 7px 12px; border: 1px solid var(--flami-line); border-radius: 999px;
		color: var(--flami-ink); font-size: 13px; text-decoration: none; background: #fff;
	}
	.flami-chips a:active { background: var(--flami-pink-soft); border-color: var(--flami-pink); }
	.flami-search {
		position: relative; display: flex; align-items: center;
		margin: 2px 0 14px;
	}
	.flami-search .flami-ico { position: absolute; left: 14px; color: var(--flami-muted); }
	.flami-search input[type="search"] {
		width: 100%; height: 48px; margin: 0; padding: 0 14px 0 46px;
		border: 1.5px solid var(--flami-line); border-radius: 14px;
		font-size: 16px; /* 16px evita el zoom automático en iPhone */
		background: #faf8f7;
	}
	.flami-search input[type="search"]:focus { border-color: var(--flami-pink); background: #fff; outline: 0; }
	/* Carrito lateral en celular: panel que sube desde abajo */
	.flami-sheet--cart .flami-sheet__panel--side {
		top: auto; left: 0; right: 0;
		width: 100%;
		max-height: 88vh;
		padding: 0 18px calc(18px + env(safe-area-inset-bottom));
		border-radius: 20px 20px 0 0;
		animation: flami-up .22s ease-out;
	}
	.flami-sheet--cart .flami-sheet__head { margin: 0 -18px 6px; padding: 14px 18px 12px; }

	@keyframes flami-fade { from { opacity: 0; } }
	@keyframes flami-up   { from { transform: translateY(40px); opacity: .4; } }
	@keyframes flami-down { from { transform: translateY(-30px); opacity: .4; } }

	/* ---------- Chips de categorías: una fila deslizable ---------- */
	.flami-filter {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin: 0 -16px 16px;
		padding: 2px 16px 6px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.flami-filter::-webkit-scrollbar { display: none; }
	.flami-filter a { flex: 0 0 auto; font-size: 13px; padding: 7px 13px; }

	/* ---------- Grilla de productos en 2 columnas ---------- */
	.woocommerce ul.products,
	.woocommerce-page ul.products {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px 12px;
		margin: 0 0 20px !important;
	}
	.woocommerce ul.products::before,
	.woocommerce ul.products::after { display: none !important; }
	.woocommerce ul.products li.product {
		width: auto !important;
		float: none !important;
		margin: 0 !important;
		padding: 0 !important;
		clear: none !important;
		text-align: left;
	}
	.woocommerce ul.products li.product .product-inner { padding: 0 !important; border: 0 !important; }
	.woocommerce ul.products li.product .woo-entry-image img,
	.woocommerce ul.products li.product .image-wrap img {
		aspect-ratio: 1 / 1; object-fit: cover; width: 100%;
		border-radius: 12px;
	}
	.woocommerce ul.products li.product .woo-entry-inner { padding: 8px 2px 0 !important; text-align: left; }
	.woocommerce ul.products li.product .woo-entry-inner > li { margin: 0 0 4px !important; }
	.woocommerce ul.products li.product .category { display: none !important; }   /* "Palo santo, Sahumerios" */
	.woocommerce ul.products li.product .title,
	.woocommerce ul.products li.product .woocommerce-loop-product__title {
		margin: 0 !important;
	}
	.woocommerce ul.products li.product .title a,
	.woocommerce ul.products li.product .woocommerce-loop-product__title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		min-height: 2.6em;
		font-size: 13.5px !important;
		line-height: 1.3 !important;
		font-weight: 600;
		color: var(--flami-ink);
		text-align: left;
	}
	.woocommerce ul.products li.product .price {
		font-size: 16px !important; font-weight: 800; text-align: left;
	}
	.woocommerce ul.products li.product .button,
	.woocommerce ul.products li.product .added_to_cart {
		display: block !important;
		width: 100%;
		margin: 6px 0 0 !important;
		padding: 9px 6px !important;
		border: 0 !important;
		border-radius: 10px !important;
		background: var(--flami-pink) !important;
		color: #fff !important;
		font-size: 12.5px !important;
		font-weight: 700;
		letter-spacing: 0 !important;
		text-transform: none !important;
		text-align: center;
		line-height: 1.2 !important;
	}
	.woocommerce ul.products li.product.outofstock .button { background: #eee8e6 !important; color: var(--flami-muted) !important; }
	.woocommerce ul.products li.product.outofstock .woo-entry-image img,
	.woocommerce ul.products li.product.outofstock .image-wrap img { opacity: .55; }
	.woocommerce ul.products li.product .outofstock-badge,
	.woocommerce ul.products li.product .onsale {
		top: 8px !important; left: 8px !important; right: auto !important;
	}

	/* ---------- Portada: categorías deslizables en lugar de una columna larga ---------- */
	.elementor-element-0f77e47 > .elementor-container {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding: 0 4px 10px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.elementor-element-0f77e47 > .elementor-container::-webkit-scrollbar { display: none; }
	.elementor-element-0f77e47 > .elementor-container > .elementor-column {
		flex: 0 0 44% !important;
		width: 44% !important;
		scroll-snap-align: start;
	}
	.elementor-element-0f77e47 > .elementor-container > .elementor-column > .elementor-widget-wrap { padding: 0 !important; }
	.elementor-element-0f77e47 img { border-radius: 14px; }
	.elementor-element-9a793a5 .elementor-heading-title,
	.elementor-element-259ba4d .elementor-heading-title,
	.elementor-element-d58a813 .elementor-heading-title { font-size: 40px !important; }

	/* ---------- Ficha de producto ---------- */
	.single-product .product .summary .product_title { font-size: 22px !important; line-height: 1.25; }
	.single-product .product .summary .price { font-size: 24px !important; font-weight: 800; }
	.single-product .flami-trust li { font-size: 13.5px; }
	.single-product form.cart .single_add_to_cart_button {
		width: 100%;
		min-height: 50px;
		border-radius: 12px !important;
		background: var(--flami-pink) !important;
		font-size: 16px !important;
		font-weight: 800;
		text-transform: none !important;
		letter-spacing: 0 !important;
	}
	.single-product form.cart { display: flex; flex-wrap: wrap; gap: 10px; }
	.single-product form.cart .quantity { margin: 0 !important; }
	/* Barra flotante de OceanWP ("Agregar al carrito" al hacer scroll): encima de nuestra barra */
	.owp-floating-bar { bottom: calc(var(--flami-bar-h) + env(safe-area-inset-bottom)) !important; top: auto !important; }

	/* ---------- Carrito y checkout ---------- */
	.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
	.woocommerce-checkout #place_order {
		width: 100%;
		min-height: 52px;
		border-radius: 12px !important;
		background: var(--flami-pink) !important;
		font-size: 16px !important;
		font-weight: 800;
		text-transform: none !important;
		letter-spacing: 0 !important;
	}
	.woocommerce-checkout .woocommerce-billing-fields h3,
	.woocommerce-checkout #order_review_heading { font-size: 18px !important; margin: 18px 0 10px !important; }
	.woocommerce-checkout .form-row { margin-bottom: 10px !important; }
	.woocommerce form .form-row input.input-text,
	.woocommerce form .form-row textarea,
	.woocommerce form .form-row select { font-size: 16px; } /* evita el zoom en iPhone */
}
