@charset "utf-8";

/* CSS Document */
:root {

	/* Layout */
	--container-padding: 20px;
	--content-max-width: 1200px;
	--grid-gap: 20px;
	--item-min-width: 200px;
	--header-height: 70px;
	--header-after-height: 30px;
	--total-header-height: calc(var(--header-height) + var(--header-after-height));
	--submenu-width: 200px;
	--logo-width: 200px;
	--logo-min-width: 180px;
	
	/* Colors */
	--bg-color: #fff;
	--bg-hover: #f0f0f0;
	--bg-cart: #f3f3f3;
	--bg-mobile-submenu: #f8f8f8;
	--bg-page: #ffffff;
	--text-color: #000;
	--border-color: #ddd;
	--shadow-color: rgba(0,0,0,0.1);
	
	/* Typography */
	--font-size-base: 16px;
	--font-size-small: 9pt;
	--font-size-large: 22px;
	--font-size-cart: 18px;
	--font-size-mobile: 14px;
	--font-size-hamburger: 1.5em;
	
	/* Spacing */
	--spacing-xs: 5px;
	--spacing-sm: 10px;
	--spacing-md: 15px;
	--spacing-lg: 20px;
	--spacing-xl: 30px;
	--text-padding: 20px;
	--menu-gap: 3px;
	--menu-padding: 10px;
	--submenu-padding: 10px;
	--submenu-item-padding: 8px 20px;
	--mobile-menu-padding: 15px 20px;
	--hamburger-left: 20px;
	
	/* Borders */
	--border-radius-sm: 4px;
	--border-radius-md: 8px;
	--border-radius-lg: 10px;
	--border-radius-xl: 25px;
	--border-radius-circle: 50%;
	--border-radius: 5px;
	
	/* Transitions */
	--transition-speed: 0.3s;
	--transition-timing: ease;
	
	/* Cart */
	--cart-width: 600px;
	--cart-item-img-size: 80px;
	--cart-quantity-width: 40px;
	--cart-btn-size: 32px;
	
	/* Effects */
	--box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	
	/* Z-index */
	--z-hamburger: 1001;
	--z-submenu: 1000;
	--z-mobile-menu: 999;
}

/* Estilos base */
body {
	font-family: Arial, sans-serif;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	padding-top: var(--header-height);
	min-height: 100vh;
	background-color: var(--bg-page);
	overflow-x: hidden;
	margin-bottom: var(--total-header-height);
}

/* Header styles */
body > header {
	background-color: var(--bg-color) !important;
	width: 100%;
	padding: 0;
	height: var(--header-height);
	z-index: 9999;
	position: fixed;
	top: 0;
	left: 0;
	margin: 0 !important;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
	box-shadow: var(--box-shadow);
}

/* Contenedor del menú hamburguesa */
.menu-container {
	position: absolute;
	left: var(--hamburger-left);
	top: 50%;
	transform: translateY(-50%);
	z-index: var(--z-hamburger);
	display: none; /* Oculto por defecto */
}

/* Contenedor principal del header */
body > header > div:last-child {
	width: var(--content-max-width);
	max-width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 var(--text-padding) !important;
	box-sizing: border-box;
	margin: 0 auto !important;
	height: 100%;
}

body > header > div:last-child > div {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

body > header > div:last-child > div > a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

body > header img {
	display: block;
	width: var(--logo-width) !important;
	height: auto !important;
	margin: 0 !important;
	transition: width var(--transition-speed) var(--transition-timing);
	max-height: 100% !important;
	object-fit: contain !important;
	min-width: var(--logo-min-width) !important;
}

body > header > div:last-child > div > a > img {
	width: var(--logo-width) !important;
	height: auto !important;
	min-width: var(--logo-min-width) !important;
	max-width: none !important;
	object-fit: contain !important;
}

img {
	border-radius: var(--border-radius);
}

a {
	-webkit-tap-highlight-color: transparent;
	text-decoration: none;
	color: var(--text-color);
}

/* Estilos del menú */
.menu,
.menu ul,
.menu li,
.submenu,
.submenu ul,
.submenu li,
.submenu-content,
.submenu-content ul,
.submenu-content li,
.submenu-elements {
	list-style: none;
	margin: 0;
	padding: 0;
	line-height: 1;
}

body > header nav {
	margin-right: auto;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Estilos base del menú - visible en desktop, oculto en móvil */
body > header nav .menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--menu-gap);
	height: 100%;
}

body > header .menu li {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

/* Estilos comunes para enlaces y botones del menú */
body > header .menu a,
body > header .menu .submenu-button {
	padding: 10px 20px !important;
	width: 100%;
	height: auto !important;
	margin: 0 !important;
	border-bottom: none !important;
	min-height: 0 !important;
	line-height: 1 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	font-size: 16px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
}

/* Estilos del submenu */
.submenu {
	position: relative;
}

/* Ocultar elementos móviles en desktop */
.mobile-only {
	display: none !important;
}

/* Estilos específicos del botón Tienda - heredar estilos de los enlaces */
.submenu-button {
	width: 100%;
	text-align: center;
	background: none;
	border: none;
	padding: var(--menu-padding);
	font-size: var(--font-size-base);
	color: var(--text-color);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	display: flex;
	align-items: center;
	justify-content: center;
}

.submenu-content {
	display: none;
	position: absolute;
	min-width: var(--submenu-width);
	background-color: var(--bg-color);
	padding: var(--submenu-padding) 0;
	box-shadow: var(--box-shadow);
	border-radius: var(--border-radius);
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	z-index: var(--z-submenu);
}

.submenu-content a {
	padding: 8px 30px !important;
	border-bottom: 1px solid var(--border-color) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	line-height: 1 !important;
	display: flex;
	align-items: center;
}

.submenu-content a:hover {
	background-color: var(--bg-hover);
}

/* Mostrar submenu en hover para desktop */
@media screen and (min-width: 769px) {
	.submenu:hover .submenu-content {
		display: block;
	}
}

/* Estilos del botón de hamburguesa */
.menu-toggle {
	position: relative;
	width: 48px;
	height: 48px;
	padding: 0;
	margin: 0;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: var(--text-color);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: var(--z-hamburger);
}

.menu-toggle:focus {
	outline: none;
}

/* Breakpoints responsivos */
@media screen and (max-width: 1200px) {
	:root {
		--content-max-width: 1000px;
		--item-min-width: 220px;
		--grid-gap: 20px;
		--logo-width: 180px;
		--logo-min-width: 160px;
	}
}

@media screen and (max-width: 768px) {
	:root {
		--header-height: 50px;
		--container-padding: 15px;
		--font-size-large: 20px;
		--cart-item-img-size: 60px;
		--cart-quantity-width: 35px;
		--cart-btn-size: 28px;
		--logo-width: 150px;
		--logo-min-width: 120px;
		--menu-gap: 1px;
	}

	body {
		padding-top: calc(var(--header-height) + 20px);
	}

	body > header img {
		margin: 0;
	}

	.menu-container {
		left: 15px;
	}

	body > header > div:last-child {
		padding: 0 15px;
	}

	body > header nav {
		margin-right: 0;
	}

	.articulo-container {
		margin-top: 20px;
	}

	/* Ocultar elementos de escritorio en móvil */
	.desktop-only {
		display: none !important;
	}

	/* Asegurar que el submenu completo se oculte en móvil */
	.submenu {
		display: none !important;
	}

	/* Fuerza para ocultar el encabezado 'Tienda' en móvil */
	.mobile-only.mobile-menu-heading {
		display: none !important;
		height: 0 !important;
		font-size: 0 !important;
		padding: 0 !important;
	}

	/* Mostrar contenedor del botón hamburguesa en móvil */
	.menu-container {
		display: block !important;
	}

	/* Mostrar elementos móviles en pantallas pequeñas */
	body > header nav .menu .mobile-only {
		display: block !important;
	}

	/* Ocultar menú por defecto en móvil y asegurar que solo se muestre con .show */
	body > header nav .menu:not(.show) {
		display: none !important;
	}

	/* Mostrar menú solo cuando tiene la clase show */
	body > header nav .menu.show {
		display: flex !important;
		width: 100vw;
		padding-bottom: 30px !important;
	}

	/* Resto de estilos móviles */
	body > header nav .menu li {
		width: calc(100% - 50px);
		text-align: left;
		margin: 0 0 0 50px !important;
		padding: 0 !important;
		line-height: 1.2 !important;
		display: block !important;
		border-bottom: none !important;
		height: auto !important;
		background-color: var(--bg-color);
		font-size: 20px !important;
		box-sizing: border-box;
	}

	body > header nav .menu li:last-child {
		border-bottom: none !important;
	}

	/* Estilos para los elementos del submenú directamente en móvil */
	.mobile-submenu-item {
		border-bottom: none !important;
		padding: 0 !important;
		display: block !important;
		height: auto !important;
		line-height: 1.2 !important;
		margin: 0 !important;
		background-color: var(--bg-color);
	}

	.mobile-submenu-item a {
		padding: 15px 20px !important;
		font-size: 20px !important;
		font-weight: 600 !important;
		line-height: 1.2 !important;
		border-bottom: none !important;
		background-color: var(--bg-color);
		display: block !important;
		width: 100%;
		height: auto !important;
		margin: 0 !important;
		box-sizing: border-box;
	}

	.mobile-submenu-item:last-of-type {
		border-bottom: none !important;
	}

	/* Aplicar estilos a otros elementos clicables dentro del menú móvil principal */
	body > header nav .menu a,
	body > header nav .menu .submenu-button {
		padding: 15px 20px !important;
		width: 100%;
		height: auto !important;
		margin: 0 !important;
		border-bottom: none !important;
		min-height: 0 !important;
		line-height: 1.2 !important;
		display: flex;
		align-items: center;
		justify-content: flex-start;
		box-sizing: border-box;
		font-size: 20px !important;
		font-weight: 600 !important;
		letter-spacing: 0 !important;
		background-color: var(--bg-color);
	}

	/* Ocultar el submenu-content que ya no se usa directamente en móvil */
	.submenu-content {
		display: none !important;
	}

	.submenu.active .submenu-content {
		display: none !important;
	}

	.submenu-content a {
		display: none !important;
	}

	/* Fuerza para ocultar el botón 'Tienda' en móvil */
	.submenu.desktop-only .submenu-button {
		display: none !important;
	}

	/* Estilos para el encabezado 'Tienda' en móvil */
	.mobile-only.mobile-menu-heading {
		display: block !important;
		padding: 25px 20px !important;
		font-size: 24px !important;
		font-weight: bold !important;
		background-color: var(--bg-color);
		width: 100%;
		box-sizing: border-box;
	}

	/* Ocultar menú por defecto en móvil */
	body > header nav .menu {
		position: fixed;
		top: var(--header-height);
		left: 0;
		width: 100vw;
		background-color: var(--bg-color);
		flex-direction: column;
		padding: 30px 0;
		box-shadow: var(--box-shadow);
		z-index: var(--z-mobile-menu);
		margin: 0;
		max-height: calc(100vh - var(--header-height));
		overflow-y: auto;
		overflow-x: hidden;
		gap: 0;
		line-height: 1;
		height: auto !important;
	}
}

@media screen and (max-width: 480px) {
	:root {
		--container-padding: 10px;
		--grid-gap: 15px;
		--font-size-large: 18px;
		--font-size-cart: 16px;
		--cart-item-img-size: 50px;
		--cart-quantity-width: 30px;
		--cart-btn-size: 24px;
		--logo-width: 120px;
		--logo-min-width: 100px;
	}
}

@media screen and (max-width: 320px) {
	:root {
		--font-size-large: 16px;
		--font-size-cart: 14px;
		--cart-item-img-size: 40px;
		--cart-quantity-width: 25px;
		--cart-btn-size: 20px;
		--logo-width: 100px;
		--logo-min-width: 80px;
	}
}

#menu-toggle {
	display: none;
}

/* Ajustar el contenido de los artículos */
.articulo-container {
	width: var(--content-max-width);
	max-width: 100%;
	margin: 30px auto var(--text-padding) auto;
	padding: 0 20px;
	box-sizing: border-box;
	position: relative;
	z-index: 1;
}

/* Mostrar menú solo cuando tiene la clase show */
body > header nav .menu.show {
	display: flex !important;
	width: 100vw;
	padding-bottom: 30px !important;
}