/* Layout base web v2 — tokens y shell (sin depender de css/ externo) */

:root {
	--spanish-gray: hsl(0, 0%, 60%);
	--sonic-silver: hsl(0, 0%, 47%);
	--eerie-black: hsl(0, 0%, 13%);
	--sandy-brown: hsl(29, 90%, 65%);
	--bittersweet: hsl(0, 100%, 70%);
	--ocean-green: hsl(152, 51%, 52%);
	--davys-gray: hsl(0, 0%, 33%);
	--cultured: hsl(0, 0%, 93%);
	--white: hsl(0, 100%, 100%);
	--onyx: hsl(0, 0%, 27%);
	--fs-5: 1rem;
	--fs-7: 0.875rem;
	--fs-8: 0.813rem;
	--fs-9: 0.75rem;
	--weight-500: 500;
	--weight-600: 600;
	--border-radius-md: 10px;
	--border-radius-sm: 5px;
	--transition-timing: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body { background: var(--white); color: var(--eerie-black); line-height: 1.5; }
main { background: #ededed; padding-top: 8px; }
a { text-decoration: none; color: inherit; }
button { font: inherit; cursor: pointer; background: none; border: none; }
img { display: block; max-width: 100%; }
input { font: inherit; }

.container { padding: 0 15px; width: 100%; margin: 0 auto; }
.has-scrollbar { padding-bottom: 5px; }

.overlay {
	position: fixed; inset: 0; background: hsla(0, 0%, 0%, 0.5);
	opacity: 0; pointer-events: none; z-index: 15; transition: 0.5s ease;
}
.overlay.active { opacity: 1; pointer-events: all; }

/* Header */
.desktop-navigation-menu { display: none; }

.header-main {
	padding: 16px 0 10px;
	border-bottom: 1px solid var(--cultured);
}
.header-top-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
}
.header-logo { flex-shrink: 0; }
.header-logo img,
#web-header-logo-img {
	width: 44px;
	height: 44px;
	max-width: 44px;
	max-height: 44px;
	object-fit: contain;
	display: block;
	margin: auto;
}
.header-tools {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
}
.header-search-container {
	position: relative;
	flex: 1;
	min-width: 0;
}
.header-search-container .search-field {
	width: 100%;
	font-size: var(--fs-7);
	color: var(--onyx);
	padding: 10px 15px;
	padding-right: 50px;
	border: 1px solid var(--cultured);
	border-radius: var(--border-radius-md);
}
.search-field::-webkit-search-cancel-button { display: none; }
.search-btn {
	position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
	padding: 8px 15px; border-radius: var(--border-radius-md);
	background: var(--white);
}
.search-btn:hover { opacity: 0.85; }
.header-user-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}
.header-user-actions .action-btn { position: relative; padding: 2px; line-height: 0; }
.header-user-actions .action-btn img { display: block; width: 36px; height: auto; }
.header-user-actions .count {
	position: absolute; top: -2px; right: -3px;
	background: var(--bittersweet); color: var(--white);
	font-size: 11px; font-weight: var(--weight-500);
	line-height: 1; padding: 2px 4px; border-radius: 20px;
	min-width: 16px; text-align: center;
}

/* Sidebar móvil */
.sidebar {
	background: var(--white);
	position: fixed; top: 0; left: -100%; bottom: 0;
	width: 100%; max-width: 320px; padding: 30px;
	overflow-y: auto; overscroll-behavior: contain;
	visibility: hidden; transition: 0.5s ease; z-index: 20;
}
.sidebar.active { left: 0; visibility: visible; }
.sidebar-category { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--cultured); }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sidebar-title {
	color: var(--onyx); font-size: var(--fs-5); text-transform: uppercase;
	letter-spacing: 0.8px; font-weight: var(--weight-600);
}
.sidebar-close-btn { font-size: 22px; font-weight: var(--weight-600); }
.sidebar-menu-category-list { list-style: none; }

/* Nav inferior móvil */
.mobile-bottom-navigation {
	background: var(--white);
	position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
	width: 100%; max-width: 500px;
	display: flex; justify-content: space-around; align-items: center;
	padding: 5px 0; box-shadow: 0 0 10px hsla(0, 0%, 0%, 0.25); z-index: 9990;
}
.mobile-bottom-navigation .action-btn { position: relative; padding: 10px; }
.mobile-bottom-navigation .count {
	background: var(--bittersweet); color: var(--white);
	position: absolute; top: 0; right: 0;
	font-size: 12px; font-weight: var(--weight-500);
	line-height: 1; padding: 2px 4px; border-radius: 20px;
}

.product-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

@media (min-width: 570px) {
	.header-top-row {
		flex-direction: row;
		align-items: center;
		gap: 16px;
	}
	.header-logo img { margin: 0; }
	.header-tools { flex: 1; }
}

@media (min-width: 768px) {
	.container { max-width: 980px; }
	.header-main { padding: 18px 0 8px; }
	.header-user-actions { gap: 10px; }
	.header-user-actions .action-btn img { width: 40px; }
}

@media (min-width: 1024px) {
	.container { max-width: 1200px; }
	.header-tools { max-width: 720px; margin-left: auto; }
	.header-user-actions .action-btn img { width: 43px; }
	.desktop-navigation-menu { display: block; padding: 10px 0; border-top: 1px solid var(--cultured); }
	.web-desktop-nav-inner {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 16px;
	}
	.web-desktop-nav-left,
	.web-desktop-nav-right {
		display: flex;
		align-items: center;
		gap: 24px;
		list-style: none;
		flex-wrap: wrap;
	}
	.web-desktop-nav-right { margin-left: auto; }
	.desktop-menu-category-list {
		display: flex; justify-content: flex-start; align-items: center; gap: 30px;
		list-style: none; flex-wrap: wrap;
	}
	.mobile-bottom-navigation { display: none; }
	/* Legacy: sidebar lateral oculto en escritorio; catálogo a ancho completo */
	.product-container .container { display: block; }
	.product-box { width: 100%; }
	.web-sidebar-desk { display: none !important; }
}

@media (max-width: 1023px) {
	.web-sidebar-desk { display: none !important; }
	/* Favoritos y carrito solo en barra inferior móvil */
	.header-user-actions { display: none !important; }
	.header-tools { width: 100%; }
	.header-logo img { margin: 0; }
}

/* Nav contextual — catálogo del local (#/l/{slug}) */
body.is-local-context .web-nav-marketplace-only {
	display: none !important;
}
body.is-local-context #web-home-hero,
body.is-local-context #web-home-filtros {
	display: none !important;
}
