/* =========================================================
   ARRIOLA MOTOR — Mega menú y mejoras de UI
   ========================================================= */

/* ------------------------------------------------------------------
   1. Barra de navegación
------------------------------------------------------------------ */
#amm-nav {
	position: sticky;
	top: 0;
	z-index: 99998;
	background: #ffffff;
	border-bottom: 1px solid #ececec;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.admin-bar #amm-nav { top: 32px; }

#amm-nav .amm-nav-inner {
	max-width: 1320px;
	margin: 0 auto;
	display: flex;
	align-items: stretch;
	padding: 0 20px;
	position: relative;
}

#amm-nav .amm-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
}

#amm-nav .amm-menu > li { position: relative; }

#amm-nav .amm-menu > li > a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 16px 18px;
	color: #111111;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	line-height: 1.2;
	transition: color 0.2s ease;
}

#amm-nav .amm-menu > li > a:hover {
	color: #e02b20;
	text-decoration: none;
}

#amm-nav .amm-menu > li.menu-item-has-children > a::after {
	content: "";
	width: 0;
	height: 0;
	margin-left: 6px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid currentColor;
	opacity: 0.65;
}

/* Botones CTA dentro del menú */
#amm-nav .amm-menu li.cta-btn > a {
	background: #e02b20;
	color: #fff !important;
	border-radius: 8px;
	padding: 9px 18px;
	margin: 10px 0 10px 10px;
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

#amm-nav .amm-menu li.cta-btn.cta-wa > a {
	background: #25d366;
	color: #fff !important;
	margin-left: 14px;
}

#amm-nav .amm-menu li.cta-btn > a:hover {
	background: #a01f17;
	color: #fff !important;
}

#amm-nav .amm-menu li.cta-btn.cta-wa > a:hover {
	background: #17b853;
	color: #fff !important;
}

/* ------------------------------------------------------------------
   1.1 Dropdowns clásicos (sin mega)
------------------------------------------------------------------ */
#amm-nav .amm-menu .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 60;
	min-width: 230px;
	margin: 0;
	padding: 10px 0;
	list-style: none;
	background: #ffffff;
	border-top: 3px solid #e02b20;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

#amm-nav .amm-menu li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

#amm-nav .amm-menu .sub-menu .sub-menu {
	left: 100%;
	top: -13px;
	border-top: none;
	border-left: 3px solid #e02b20;
}

#amm-nav .amm-menu .sub-menu li { position: relative; }

#amm-nav .amm-menu .sub-menu a {
	display: block;
	padding: 9px 20px;
	color: #333333;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
}

#amm-nav .amm-menu .sub-menu a:hover {
	color: #e02b20;
	background: #fafafa;
	text-decoration: none;
}

/* ------------------------------------------------------------------
   1.2 Mega menús (items con clase .mega-menu)
------------------------------------------------------------------ */
#amm-nav .amm-menu > li.mega-menu { position: static; }

#amm-nav .amm-menu > li.mega-menu > .sub-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	width: 100%;
	min-width: 0;
	padding: 30px 32px;
	display: none;
	flex-wrap: wrap;
	gap: 10px 28px;
	background: #ffffff;
	border-top: 3px solid #e02b20;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.16);
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: none;
}

#amm-nav .amm-menu > li.mega-menu:hover > .sub-menu { display: flex; }

#amm-nav .amm-menu > li.mega-menu > .sub-menu > li {
	position: static;
}

#amm-nav .amm-menu > li.mega-menu.mega-2 > .sub-menu > li { width: calc(50% - 14px); }
#amm-nav .amm-menu > li.mega-menu.mega-3 > .sub-menu > li { width: calc(33.333% - 18.66px); }
#amm-nav .amm-menu > li.mega-menu.mega-4 > .sub-menu > li { width: calc(25% - 21px); }

/* Cabecera de grupo (hijos con más hijos) */
#amm-nav .amm-menu > li.mega-menu > .sub-menu > li.menu-item-has-children > a {
	display: inline-block;
	padding: 4px 0 10px;
	color: #e02b20;
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 2px solid #f0c4c0;
	margin-bottom: 8px;
}

/* Enlaces planos (marcas, categorías) */
#amm-nav .amm-menu > li.mega-menu .sub-menu a {
	display: block;
	padding: 6px 0;
	color: #333333;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	background: none;
}

#amm-nav .amm-menu > li.mega-menu .sub-menu a:hover {
	color: #e02b20;
	padding-left: 6px;
	text-decoration: none;
}

#amm-nav .amm-menu > li.mega-menu .sub-menu > li > ul.sub-menu {
	position: static;
	display: block;
	min-width: 0;
	padding: 0;
	background: none;
	border: none;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* ------------------------------------------------------------------
   1.3 Móvil
------------------------------------------------------------------ */
#amm-nav-toggle {
	display: none;
	position: relative;
	width: 42px;
	height: 42px;
	margin: 8px 0 8px 8px;
	background: none;
	border: none;
	cursor: pointer;
}

#amm-nav-toggle span {
	display: block;
	width: 24px;
	height: 3px;
	margin: 5px auto;
	background: #111111;
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

#amm-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#amm-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
#amm-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 981px) {
	#amm-nav-toggle { display: block; }

	#amm-nav .amm-nav-inner {
		display: block;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		background: #ffffff;
		box-shadow: 0 30px 50px rgba(0, 0, 0, 0.18);
		max-height: calc(100vh - 90px);
		overflow-y: auto;
		display: none;
		padding: 10px 16px 18px;
	}

	#amm-nav.amm-nav-open .amm-nav-inner { display: block; }

	#amm-nav .amm-menu { display: block; }

	#amm-nav .amm-menu > li > a {
		padding: 13px 8px;
		border-bottom: 1px solid #f2f2f2;
		justify-content: space-between;
	}

	#amm-nav .amm-menu > li.mega-menu { position: relative; }

	#amm-nav .amm-menu .sub-menu {
		position: static;
		display: none;
		min-width: 0;
		padding: 0 0 8px 14px;
		background: none;
		border: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	#amm-nav .amm-menu li.open > .sub-menu { display: block; }

	#amm-nav .amm-menu .sub-menu a { padding: 9px 6px; }

	#amm-nav .amm-menu > li.mega-menu > .sub-menu > li {
		width: 100%;
		margin-bottom: 8px;
	}

	#amm-nav .amm-menu li.cta-btn > a,
	#amm-nav .amm-menu li.cta-wa > a {
		margin: 10px 0 0;
		text-align: center;
		justify-content: center;
	}
}

/* ------------------------------------------------------------------
   2. Fondos blancos coherentes
------------------------------------------------------------------ */
/* El body tiene custom-background (negro). Se fuerza blanco con la
   misma especificidad para que no se vea en ningún hueco transparente. */
body.custom-background,
body {
	background-color: #ffffff !important;
	background-image: none !important;
}

#page-container,
#et-main-area,
#main-content {
	background: #ffffff;
}

/* Ficha de producto: garantizar fondo blanco en el contenedor y columnas */
.single-product #main-content,
.single-product #content-area,
.single-product #left-area,
.single-product .woocommerce div.product,
.single-product .summary.entry-summary {
	background-color: #ffffff;
}

.et-l--body > .et_builder_inner_content,
.et-l--footer > .et_builder_inner_content {
	background: #ffffff;
}

/* Títulos de sección con acento (solo h2 de módulos de texto, no títulos de producto) */
.et_pb_module.et_pb_text h2:not(.woocommerce-loop-product__title) {
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #111111;
	position: relative;
	padding-bottom: 14px;
	margin-bottom: 24px;
}

.et_pb_module.et_pb_text h2:not(.woocommerce-loop-product__title)::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 56px;
	height: 4px;
	border-radius: 2px;
	background: #e02b20;
}

/* ------------------------------------------------------------------
   3. Tarjetas de producto
------------------------------------------------------------------ */
ul.products li.product,
.et_pb_shop_grid_item {
	background: #ffffff;
	border: 1px solid #e6e6e6;
	border-radius: 12px;
	overflow: hidden;
	padding-bottom: 16px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

ul.products li.product:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
	border-color: #e02b20;
}

ul.products li.product a.woocommerce-LoopProduct-link,
ul.products li.product a.woocommerce-loop-product__link {
	display: flex !important;
	flex-direction: column !important;
	height: 100%;
}

ul.products li.product .et_shop_image {
	margin: 0 0 10px;
	border-bottom: 1px solid #f2f2f2;
}

ul.products li.product .woocommerce-loop-product__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	color: #111111;
	padding: 6px 16px 2px;
	min-height: 42px;
}

/* ------------------------------------------------------------------
   4. Badges de oferta SIN superponerse
------------------------------------------------------------------ */
/* Badge en las tarjetas: se sitúa al final de la tarjeta, justo
   encima/junto al botón "Añadir al carrito" (order fuerza que se
   renderice tras el precio). */
ul.products li.product .onsale {
	position: relative !important;
	top: auto;
	left: auto;
	right: auto;
	order: 99 !important;
	display: inline-block !important;
	align-self: flex-start !important;
	width: auto !important;
	margin: 4px 0 0 16px !important;
	padding: 4px 12px !important;
	background: #e02b20 !important;
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-align: center;
	border-radius: 20px !important;
	line-height: 1.4;
	transform: none;
}

/* Precios */
ul.products li.product .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	padding: 4px 16px 10px;
	color: #111111;
	font-size: 18px;
	font-weight: 800;
}

ul.products li.product .price ins {
	background: none;
	text-decoration: none;
	color: #e02b20;
}

ul.products li.product .price del {
	color: #999999;
	font-weight: 400;
	font-size: 14px;
	text-decoration: line-through;
}

/* Botón Añadir / Ver */
ul.products li.product a.button,
ul.products li.product .add_to_cart_button,
ul.products li.product a.added_to_cart {
	display: block;
	margin: 6px 16px 0;
	padding: 12px 16px;
	background: #e02b20;
	color: #ffffff;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	font-size: 13px;
	text-align: center;
	border-radius: 8px;
	border: none;
	transition: background 0.2s ease, transform 0.2s ease;
}

ul.products li.product a.button:hover,
ul.products li.product .add_to_cart_button:hover,
ul.products li.product a.added_to_cart:hover {
	background: #a01f17;
	color: #ffffff;
	transform: translateY(-1px);
}

ul.products li.product .added_to_cart {
	margin-top: 4px;
}

/* ------------------------------------------------------------------
   5. Página de producto (galería y badges de la ficha)
------------------------------------------------------------------ */
/* Badge de la ficha: movido por JS junto al botón "Añadir al
   carrito" (dentro del summary, justo encima del form). */
.single-product div.product .onsale,
.woocommerce div.product > .onsale,
.woocommerce div.product .summary .onsale {
	position: relative !important;
	top: auto;
	left: auto;
	right: auto;
	display: inline-block !important;
	margin: 0 0 12px;
	padding: 6px 14px;
	background: #e02b20;
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 20px !important;
	line-height: 1.2;
	transform: none;
	z-index: 5;
	width: auto;
	text-align: center;
}

.single-product .images .onsale {
	position: relative !important;
	top: auto;
	left: auto;
	right: auto;
	display: inline-block;
	margin: 0 0 12px;
	padding: 6px 14px;
	background: #e02b20;
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	border-radius: 6px;
	transform: none;
	z-index: 5;
}

/* ------------------------------------------------------------------
   6. Logotipo de la empresa en la topbar (a la izquierda del teléfono)
------------------------------------------------------------------ */
.amm-topbar .amm-contact .et_pb_text_inner {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: nowrap;
}

.amm-topbar .amm-contact p {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
}

.amm-topbar .amm-contact .amm-logo {
	display: inline-block;
	height: 34px;
	width: auto;
	max-width: 160px;
	flex: 0 0 auto;
	object-fit: contain;
}

@media (max-width: 767px) {
	.amm-topbar .amm-contact .amm-logo {
		height: 26px;
	}
}