/*
Theme Name: Astra Child — Contrafoc Seguro
Theme URI: https://contrafoc.cat/
Template: astra
Author: Contrafoc Formació
Author URI: https://contrafoc.cat/
Description: Tema fill d'Astra reescrit des de zero. Mateixes funcionalitats i estils que el fill Contrafoc (cursos, contacte, footer, WooCommerce). Sense còpia binària del tema anterior.
Tags: custom-menu, custom-logo, e-commerce, education, translation-ready
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: astra-child
*/

:root {
	--cf-brand: #ee8516;
	--cf-brand-dark: #d67412;
	--cf-ink: #000;
	--cf-white: #fff;
}

/* Menú: blanc; actiu taronja */
#masthead .main-header-menu .menu-link,
#masthead .main-header-menu .ast-menu-toggle,
#masthead .ast-builder-menu .menu-link,
#masthead .ast-builder-menu .ast-menu-toggle {
	color: var(--cf-white) !important;
}

#masthead .main-header-menu .menu-item:hover > .menu-link,
#masthead .main-header-menu .menu-item.focus > .menu-link,
#masthead .ast-builder-menu .menu-item:hover > .menu-link,
#masthead .ast-builder-menu .menu-item.focus > .menu-link {
	color: rgba(255, 255, 255, 0.9) !important;
}

#masthead .main-header-menu .current-menu-item > .menu-link,
#masthead .main-header-menu .current-menu-item > .ast-menu-toggle,
#masthead .main-header-menu .current-menu-ancestor > .menu-link,
#masthead .main-header-menu .current-menu-ancestor > .ast-menu-toggle,
#masthead .ast-builder-menu .current-menu-item > .menu-link,
#masthead .ast-builder-menu .current-menu-item > .ast-menu-toggle,
#masthead .ast-builder-menu .current-menu-ancestor > .menu-link,
#masthead .ast-builder-menu .current-menu-ancestor > .ast-menu-toggle {
	color: var(--cf-brand) !important;
}

#masthead .contrafoc-megamenu-parent > a {
	color: var(--cf-white) !important;
}

#masthead .contrafoc-megamenu-parent:hover > a,
#masthead .contrafoc-megamenu-parent.focus > a {
	color: rgba(255, 255, 255, 0.9) !important;
}

#masthead .contrafoc-megamenu-parent.current-menu-ancestor > a {
	color: var(--cf-brand) !important;
}

.ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item {
	line-height: 40px !important;
}

#masthead .main-header-menu > .menu-item:first-child,
#masthead .ast-builder-menu > .menu-item:first-child {
	padding-right: 0 !important;
	margin-right: 0 !important;
}

#masthead .main-header-menu > .menu-item:nth-child(2),
#masthead .ast-builder-menu > .menu-item:nth-child(2) {
	padding-left: 0 !important;
	margin-left: 0 !important;
}

#menu-item-287 a {
	padding-left: 0 !important;
}

#ast-scroll-top {
	background-color: var(--cf-brand) !important;
	color: var(--cf-white) !important;
}

#ast-scroll-top:hover {
	background-color: var(--cf-brand-dark) !important;
	color: var(--cf-white) !important;
}

#ast-scroll-top .ast-arrow-svg,
#ast-scroll-top .ast-arrow-svg path {
	fill: var(--cf-white) !important;
}

a:hover,
a:focus,
a:focus-visible {
	text-decoration-color: var(--cf-brand) !important;
}

.ast-woocommerce-container,
#content .woocommerce {
	padding-top: 100px !important;
}

.ast-site-title-wrap,
.entry-title {
	display: none !important;
}

.wc-block-components-product-metadata {
	display: none !important;
}

/* WooCommerce: menú en negre */
body:has(.woocommerce) #masthead .main-header-menu .menu-link,
body:has(.woocommerce) #masthead .main-header-menu .ast-menu-toggle,
body:has(.woocommerce) #masthead .ast-builder-menu .menu-link,
body:has(.woocommerce) #masthead .ast-builder-menu .ast-menu-toggle,
body:has(.woocommerce) #masthead .contrafoc-megamenu-parent > a,
body.woocommerce-page #masthead .main-header-menu .menu-link,
body.woocommerce-page #masthead .main-header-menu .ast-menu-toggle,
body.woocommerce-page #masthead .ast-builder-menu .menu-link,
body.woocommerce-page #masthead .ast-builder-menu .ast-menu-toggle,
body.woocommerce-page #masthead .contrafoc-megamenu-parent > a {
	color: var(--cf-ink) !important;
}

body:has(.woocommerce) #masthead .main-header-menu .menu-item:hover > .menu-link,
body:has(.woocommerce) #masthead .main-header-menu .menu-item.focus > .menu-link,
body:has(.woocommerce) #masthead .ast-builder-menu .menu-item:hover > .menu-link,
body:has(.woocommerce) #masthead .ast-builder-menu .menu-item.focus > .menu-link,
body.woocommerce-page #masthead .main-header-menu .menu-item:hover > .menu-link,
body.woocommerce-page #masthead .main-header-menu .menu-item.focus > .menu-link,
body.woocommerce-page #masthead .ast-builder-menu .menu-item:hover > .menu-link,
body.woocommerce-page #masthead .ast-builder-menu .menu-item.focus > .menu-link {
	color: var(--cf-ink) !important;
}

body:has(.woocommerce) #masthead .main-header-menu .current-menu-item > .menu-link,
body:has(.woocommerce) #masthead .main-header-menu .current-menu-item > .ast-menu-toggle,
body:has(.woocommerce) #masthead .main-header-menu .current-menu-ancestor > .menu-link,
body:has(.woocommerce) #masthead .main-header-menu .current-menu-ancestor > .ast-menu-toggle,
body:has(.woocommerce) #masthead .ast-builder-menu .current-menu-item > .menu-link,
body:has(.woocommerce) #masthead .ast-builder-menu .current-menu-item > .ast-menu-toggle,
body:has(.woocommerce) #masthead .ast-builder-menu .current-menu-ancestor > .menu-link,
body:has(.woocommerce) #masthead .ast-builder-menu .current-menu-ancestor > .ast-menu-toggle,
body.woocommerce-page #masthead .main-header-menu .current-menu-item > .menu-link,
body.woocommerce-page #masthead .main-header-menu .current-menu-item > .ast-menu-toggle,
body.woocommerce-page #masthead .main-header-menu .current-menu-ancestor > .menu-link,
body.woocommerce-page #masthead .main-header-menu .current-menu-ancestor > .ast-menu-toggle,
body.woocommerce-page #masthead .ast-builder-menu .current-menu-item > .menu-link,
body.woocommerce-page #masthead .ast-builder-menu .current-menu-item > .ast-menu-toggle,
body.woocommerce-page #masthead .ast-builder-menu .current-menu-ancestor > .menu-link,
body.woocommerce-page #masthead .ast-builder-menu .current-menu-ancestor > .ast-menu-toggle {
	color: var(--cf-ink) !important;
}

@media (max-width: 921px) {
	.ast-woocommerce-container,
	#content .woocommerce {
		padding-top: 100px !important;
	}

	#masthead .main-header-menu .menu-link,
	#masthead .main-header-menu .ast-menu-toggle,
	#masthead .ast-builder-menu .menu-link,
	#masthead .ast-builder-menu .ast-menu-toggle,
	#masthead .contrafoc-megamenu-parent > a {
		color: var(--cf-brand) !important;
	}

	#masthead .contrafoc-megamenu-parent > a {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}

	#ast-mobile-site-navigation .contrafoc-megamenu-trigger {
		touch-action: manipulation;
		-webkit-tap-highlight-color: transparent;
	}

	#ast-mobile-site-navigation .main-navigation,
	#ast-mobile-site-navigation #ast-hf-mobile-menu {
		position: relative;
	}

	#ast-mobile-site-navigation .contrafoc-megamenu-parent > .contrafoc-megamenu-cursos {
		display: none !important;
		position: absolute !important;
		top: -85px !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 8px 16px 12px !important;
		transform: none !important;
		background: var(--cf-white) !important;
		z-index: 999 !important;
		box-shadow: none !important;
		border-radius: 0 !important;
		max-height: 70vh;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}

	#ast-mobile-site-navigation .contrafoc-megamenu-parent.contrafoc-megamenu-open > .contrafoc-megamenu-cursos {
		display: block !important;
	}

	#ast-mobile-site-navigation .contrafoc-megamenu-inner {
		display: block !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		gap: 0 !important;
	}

	#ast-mobile-site-navigation .contrafoc-megamenu-list {
		padding: 0 !important;
		margin: 0 !important;
	}

	#ast-mobile-site-navigation .contrafoc-megamenu-list li a {
		display: block;
		width: 100%;
	}
}
