/**
 * California Wild Ales - Custom Header & Footer Styles
 * Matching "New homepage design" tokens and components
 */

/* ==========================================================================
   Astra Header Enhancements
   (Alignment and layout are natively handled by Astra Header Builder)
   ========================================================================== */

/* Apply background, blur, and border to .main-header-bar ONLY.
   Do NOT apply backdrop-filter or transform to #masthead: in CSS, any
   non-none backdrop-filter/filter on an ancestor creates a new containing
   block for position:fixed descendants, which causes Astra's sticky header
   (.ast-sticky-active) to scroll off-screen inside #masthead instead of
   sticking to the viewport. */
.main-header-bar {
	background: rgba(13, 13, 13, 0.92) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border-hairline, #2A2A2A);
}

/* Ensure Astra sticky header maintains backdrop blur, styling, and z-index */
.main-header-bar.ast-sticky-active,
.main-header-bar.ast-header-sticked,
.ast-primary-sticky-header-active .main-header-bar {
	background: rgba(13, 13, 13, 0.92) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border-hairline, #2A2A2A);
	z-index: 999 !important;
}

/* Remove box around WooCommerce cart icon */
.ast-site-header-cart .ast-addon-cart-wrap,
.ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap,
.ast-site-header-cart.ast-menu-cart-with-border .ast-addon-cart-wrap {
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
}

.ast-site-header-cart .cart-container .astra-icon {
	color: var(--text-muted, #A9A08A);
	transition: color var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2, .7, .3, 1));
}

.ast-site-header-cart .cart-container:hover .astra-icon,
.ast-site-header-cart .cart-container:focus-visible .astra-icon {
	color: var(--text-highlight, #A8D46B) !important;
}

/* Account icon styling (next to cart) */
.ast-header-account:empty {
	display: none !important;
}

.ast-header-account .ast-header-account-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--text-muted, #A9A08A);
	transition: color var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2, .7, .3, 1));
	text-decoration: none;
	padding: 0 4px;
}

.ast-header-account .ast-header-account-link:hover,
.ast-header-account .ast-header-account-link:focus-visible {
	color: var(--text-highlight, #A8D46B);
}

.ast-header-account .account-icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* Mobile Menu Trigger Button */
.main-header-bar .main-header-menu-toggle,
.ast-mobile-header-wrap .main-header-menu-toggle,
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle {
	color: var(--text-muted, #A9A08A) !important;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 4px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: color var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2, .7, .3, 1));
	cursor: pointer;
}

.main-header-bar .main-header-menu-toggle:hover,
.main-header-bar .main-header-menu-toggle:focus-visible,
.ast-mobile-header-wrap .main-header-menu-toggle:hover,
.ast-mobile-header-wrap .main-header-menu-toggle:focus-visible,
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle:hover,
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle:focus-visible {
	color: var(--text-highlight, #A8D46B) !important;
}

.main-header-bar .main-header-menu-toggle .mobile-menu-toggle-icon svg,
.ast-mobile-header-wrap .main-header-menu-toggle .mobile-menu-toggle-icon svg,
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle .mobile-menu-toggle-icon svg {
	fill: currentColor !important;
	width: 22px;
	height: 22px;
}

/* ==========================================================================
   Mobile Flyout (Off-Canvas) Drawer
   ========================================================================== */

.ast-mobile-popup-drawer {
	z-index: 100000 !important;
}

.ast-mobile-popup-drawer .ast-mobile-popup-overlay {
	background-color: rgba(0, 0, 0, 0.75) !important;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.ast-mobile-popup-drawer .ast-mobile-popup-inner {
	background: var(--surface-page, #0D0D0D) !important;
	border-right: 1px solid var(--border-hairline, #2A2A2A);
	border-left: 1px solid var(--border-hairline, #2A2A2A);
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.8) !important;
	color: var(--text-body, #F2EAD6) !important;
	max-width: 320px !important;
	width: 85% !important;
	padding: 24px 24px 32px !important;
	box-sizing: border-box;
}

/* Close Button */
.ast-mobile-popup-drawer .ast-mobile-popup-header {
	display: flex !important;
	justify-content: flex-end !important;
	align-items: center !important;
	margin-bottom: 20px !important;
	min-height: auto !important;
	padding: 0 !important;
}

.ast-mobile-popup-drawer .menu-toggle-close {
	color: var(--text-muted, #A9A08A) !important;
	background: transparent !important;
	border: none !important;
	padding: 6px !important;
	line-height: 1 !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: color var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2, .7, .3, 1));
}

.ast-mobile-popup-drawer .menu-toggle-close:hover,
.ast-mobile-popup-drawer .menu-toggle-close:focus-visible {
	color: var(--text-highlight, #A8D46B) !important;
}

.ast-mobile-popup-drawer .menu-toggle-close svg {
	fill: currentColor !important;
	width: 22px;
	height: 22px;
}

/* Mobile Flyout Navigation Items */
.ast-mobile-popup-drawer .ast-mobile-popup-content .ast-builder-menu-mobile .main-header-menu {
	background: transparent !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	list-style: none !important;
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
}

.ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu .menu-item {
	width: 100% !important;
	border-bottom: 1px solid var(--border-hairline, #2A2A2A) !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
}

.ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu .menu-item:last-child {
	border-bottom: none !important;
}

.ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu .menu-item .menu-link {
	display: flex !important;
	align-items: center;
	padding: 14px 4px !important;
	font-family: var(--font-condensed, 'Barlow Condensed', sans-serif) !important;
	font-weight: 700 !important;
	font-size: 19px !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	color: var(--text-body, #F2EAD6) !important;
	text-decoration: none !important;
	background: transparent !important;
	border: none !important;
	transition: color var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2, .7, .3, 1)),
	            padding-left var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2, .7, .3, 1));
}

.ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu .menu-item .menu-link:hover,
.ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu .menu-item .menu-link:focus-visible {
	color: var(--text-highlight, #A8D46B) !important;
	padding-left: 6px !important;
}

.ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu .current-menu-item > .menu-link {
	color: var(--text-accent, #E5842F) !important;
}

/* Hide arrow icons on menu items without children */
.ast-mobile-popup-drawer .main-header-menu .menu-item:not(.menu-item-has-children) .ast-icon.icon-arrow {
	display: none !important;
}


/* ==========================================================================
   Site Footer
   ========================================================================== */

footer.cwa-site-footer {
	border-top: 1px solid var(--border-hairline, #2A2A2A);
	background: var(--surface-sunken, #101010);
	color: var(--text-body, #F2EAD6);
	width: 100%;
	box-sizing: border-box;
}

.cwa-footer-inner {
	max-width: var(--content-max, 1440px);
	margin: 0 auto;
	padding: var(--space-11, 48px) var(--gutter-page, 44px) var(--space-9, 32px);
	box-sizing: border-box;
}

.cwa-footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: var(--space-10, 40px);
}

/* Brand Column */
.cwa-footer-brand {
	display: flex;
	flex-direction: column;
}

.cwa-footer-logo {
	display: inline-block;
	line-height: 0;
	border: 0;
	text-decoration: none;
}

.cwa-footer-logo img {
	width: 200px;
	height: auto;
	display: block;
	max-width: 100%;
}

.cwa-footer-strapline {
	font-family: var(--font-display, Anton, sans-serif);
	text-transform: uppercase;
	font-size: 15px;
	letter-spacing: .04em;
	color: var(--text-muted, #A9A08A);
	margin-top: var(--space-6, 16px);
	line-height: 1.2;
}

.cwa-footer-script-wrap {
	margin-top: var(--space-5, 12px);
}

.cwa-footer-script {
	display: inline-block;
	font-family: var(--font-script, 'Permanent Marker', cursive);
	font-size: 26px;
	line-height: 1.1;
	color: var(--highlight, #86C043);
	transform: rotate(-3deg);
}

.cwa-footer-phone {
	font-family: var(--font-mono, 'Space Mono', monospace);
	font-size: 12px;
	letter-spacing: .08em;
	color: var(--text-muted, #A9A08A);
	margin-top: var(--space-6, 16px);
}

.cwa-footer-phone a {
	color: inherit;
	text-decoration: none;
	transition: color var(--dur-fast, 140ms);
}

.cwa-footer-phone a:hover {
	color: var(--text-highlight, #A8D46B);
}

/* Column Titles */
.cwa-footer-col-title {
	font-family: var(--font-mono, 'Space Mono', monospace);
	font-size: var(--text-label-sm, 11px);
	letter-spacing: var(--tracking-label, 0.18em);
	text-transform: uppercase;
	color: var(--text-accent, #E5842F);
	margin-bottom: var(--space-6, 16px);
	font-weight: 700;
}

/* Location Columns */
.cwa-footer-address {
	font-size: var(--text-body-sm, 13.5px);
	color: var(--text-body, #F2EAD6);
	line-height: 1.6;
	font-family: var(--font-body, Barlow, sans-serif);
}

.cwa-footer-hours {
	font-size: var(--text-body-sm, 13.5px);
	color: var(--text-subtle, #6B6558);
	line-height: 1.6;
	margin-top: var(--space-3, 6px);
	font-family: var(--font-body, Barlow, sans-serif);
}

.cwa-footer-schedule {
	margin-top: var(--space-4, 8px);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cwa-footer-schedule__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-4, 8px);
	font-size: var(--text-body-sm, 13px);
	line-height: 1.5;
}

.cwa-footer-schedule__day {
	font-family: var(--font-body, Barlow, sans-serif);
	color: var(--text-muted, #A9A08A);
	flex-shrink: 0;
}

.cwa-footer-schedule__hours {
	font-family: var(--font-mono, 'Space Mono', monospace);
	font-size: 11.5px;
	letter-spacing: .02em;
	color: var(--text-body, #F2EAD6);
	text-align: right;
	white-space: nowrap;
}

.cwa-footer-schedule__hours--closed {
	color: var(--text-subtle, #6B6558);
	font-family: var(--font-body, Barlow, sans-serif);
	font-size: 12.5px;
}

/* Links Column */
.cwa-footer-links-col {
	display: grid;
	gap: var(--space-8, 24px);
}

.cwa-footer-links-group {
	display: grid;
	gap: var(--space-3, 8px);
}

.cwa-footer-link {
	font-size: var(--text-body-sm, 13.5px);
	color: var(--text-muted, #A9A08A);
	text-decoration: none;
	border-bottom: 0;
	font-family: var(--font-body, Barlow, sans-serif);
	transition: color var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(.2,.7,.3,1));
	line-height: 1.4;
}

.cwa-footer-link:hover,
.cwa-footer-link:focus-visible {
	color: var(--text-highlight, #A8D46B);
	text-decoration: none;
}

/* Footer Divider & Bottom */
.cwa-footer-divider {
	height: 1px;
	background: var(--border-hairline, #2A2A2A);
	margin: var(--space-9, 32px) 0 var(--space-6, 16px);
	border: 0;
}

.cwa-footer-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: var(--font-mono, 'Space Mono', monospace);
	font-size: var(--text-label-sm, 11px);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--text-subtle, #6B6558);
	flex-wrap: wrap;
	gap: 12px;
}

/* Responsive Footer */
@media (max-width: 960px) {
	.cwa-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 32px;
	}
}

@media (max-width: 560px) {
	.cwa-footer-inner {
		padding: 36px var(--gutter-page-sm, 20px) 24px;
	}

	.cwa-footer-grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.cwa-footer-bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}
