/**
 * Gnutech Starter - Mobile Styles
 * Stili specifici per schermi < 1024px
 */

/* ========================================
   Layout Mobile
   ======================================== */
.wp-site-blocks {
	padding: 0;
}

.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

/* ========================================
   Header Mobile - TSA Style
   ======================================== */
.site-header {
	background: #fff;
	border-bottom: 1px solid #e5e7eb;
	position: sticky;
	top: 0;
	z-index: 1000;
}

.site-header .header-wrapper {
	padding: 0.75rem 1rem !important;
}

/* Header Row Main - always visible */
.header-row-main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

/* Logo */
.site-header .site-branding {
	flex-shrink: 0;
}

.site-header .header-logo img,
.site-header .custom-logo {
	max-width: 120px !important;
	height: auto !important;
}

/* Header Actions: Phone + CTA + Hamburger */
.site-header .header-actions {
	display: flex !important;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

/* Phone Link */
.site-header .phone-link {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	color: var(--gnutech-primary, #1E90FF);
	font-weight: 700;
	font-size: 0.9rem;
	text-decoration: none;
	white-space: nowrap;
}

.site-header .phone-link svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

/* CTA Button - hide on small mobile, show on larger */
.site-header .header-cta-wrapper {
	display: none;
}

@media (min-width: 480px) {
	.site-header .header-cta-wrapper {
		display: block;
	}
	
	.site-header .header-cta-btn .wp-block-button__link {
		padding: 0.5rem 1rem !important;
		font-size: 0.8rem !important;
	}
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: var(--gnutech-primary, #1E90FF);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
}

.mobile-menu-toggle svg {
	stroke: #fff;
	width: 22px;
	height: 22px;
}

.mobile-menu-toggle .menu-icon-close {
	display: none;
}

.mobile-menu-toggle.is-active .menu-icon-open {
	display: none;
}

.mobile-menu-toggle.is-active .menu-icon-close {
	display: block;
}

/* Hide desktop navigation on mobile */
.desktop-nav-container {
	display: none !important;
}

/* Ensure proper flex layout on mobile */
.header-row-main {
	flex-wrap: nowrap !important;
}

/* ========================================
   Mobile Navigation - Slide Down Menu
   ======================================== */
.mobile-nav-container {
	display: block;
	max-height: 0;
	overflow: hidden;
	background: #f8f9fa;
	border-top: 1px solid #e5e7eb;
	transition: max-height 0.3s ease;
}

.mobile-nav-container.is-open {
	max-height: 500px;
}

.mobile-nav {
	padding: 0;
}

.mobile-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-nav-item {
	border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-item:last-child {
	border-bottom: none;
}

.mobile-nav-item > a,
.mobile-nav-item > button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 1rem 1.25rem;
	font-size: 1rem;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	background: #fff;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}

.mobile-nav-item > a:hover,
.mobile-nav-item > button:hover {
	background: #f3f4f6;
	color: var(--gnutech-primary, #1E90FF);
}

/* First item highlighted */
.mobile-nav-item:first-child > a {
	background: var(--gnutech-primary, #1E90FF);
	color: #fff;
}

.mobile-nav-item:first-child > a:hover {
	background: #1a7fd4;
	color: #fff;
}

/* Submenu with parent link + toggle button */
.mobile-nav-item.has-submenu {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
}

.mobile-nav-item.has-submenu .submenu-parent-link {
	flex: 1;
	display: flex;
	align-items: center;
	padding: 1rem 0.5rem 1rem 1.25rem;
	font-size: 1rem;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	background: #fff;
}

.mobile-nav-item.has-submenu .submenu-parent-link:hover {
	background: #f3f4f6;
	color: var(--gnutech-primary, #1E90FF);
}

/* Submenu Toggle Button */
.submenu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	padding: 1rem;
	background: #fff;
	border: none;
	border-left: 1px solid #e5e7eb;
	cursor: pointer;
}

.submenu-toggle:hover {
	background: #f3f4f6;
}

.submenu-toggle svg {
	transition: transform 0.2s ease;
	flex-shrink: 0;
	stroke: #6b7280;
}

.submenu-toggle:hover svg {
	stroke: var(--gnutech-primary, #1E90FF);
}

.submenu-toggle.is-open svg {
	transform: rotate(180deg);
}

/* Submenu spans full width */
.mobile-nav-item.has-submenu .mobile-submenu {
	flex-basis: 100%;
}

/* Submenu */
.mobile-submenu {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	background: #f3f4f6;
	transition: max-height 0.2s ease;
}

.mobile-submenu.is-open {
	max-height: 300px;
}

.mobile-submenu li {
	border-top: 1px solid #e5e7eb;
}

.mobile-submenu a {
	display: block;
	padding: 0.875rem 1.25rem 0.875rem 2.5rem;
	font-size: 0.9375rem;
	color: #6b7280;
	text-decoration: none;
}

.mobile-submenu a:hover {
	background: #e5e7eb;
	color: var(--gnutech-primary, #1E90FF);
}

/* ========================================
   Hero Mobile
   ======================================== */
.hero-section .wp-block-cover {
	min-height: 85vh;
	padding-top: 3rem !important;
	padding-bottom: 3rem;
}

.hero-visual-col {
	display: none !important;
}

.hero-title {
	font-size: 2rem !important;
	line-height: 1.1;
}

.hero-description {
	font-size: 1rem;
}

.hero-buttons .wp-block-button {
	width: 100%;
}

.hero-buttons .wp-block-button__link {
	width: 100%;
	justify-content: center;
}

.hero-stats {
	flex-direction: column;
	gap: 1.5rem !important;
	margin-top: 2rem !important;
}

.stat-item {
	border-right: none;
	padding-right: 0;
	text-align: center;
	flex-direction: row;
	gap: 1rem;
	justify-content: center;
}

.hero-badge {
	align-self: flex-start;
}

/* ========================================
   Sections Mobile
   ======================================== */
.section-servizi,
.section-why,
.section-blog,
.section-cta,
.section-altri-servizi {
	padding: 3rem 0 !important;
}

/* ========================================
   Why Choose Us - Stats Grid Mobile
   ======================================== */
.stats-grid-modern {
	padding: 1.5rem !important;
}

.stats-grid-modern .wp-block-columns {
	gap: 1rem !important;
}

.stat-card {
	padding: 1rem !important;
}

.stat-card h3 {
	font-size: 1.5rem !important;
}

/* Features list */
.features-list {
	gap: 1rem !important;
}

.feature-item-modern {
	padding: 1rem 1.25rem !important;
}

/* ========================================
   Services Mobile
   ======================================== */
.services-grid,
.service-grid {
	grid-template-columns: 1fr !important;
	gap: 1.25rem;
}

.service-card-modern {
	padding: 1.5rem;
}

.service-card-modern h3 {
	font-size: 1.125rem;
}

/* Altri servizi cards */
.altri-servizi-card {
	padding: 1.75rem !important;
}

/* ========================================
   Columns Mobile
   ======================================== */
.wp-block-columns {
	flex-direction: column;
	gap: 1.5rem;
}

.wp-block-column {
	flex-basis: 100% !important;
	width: 100%;
}

/* ========================================
   Typography Mobile
   ======================================== */
h1, .has-gigantic-font-size {
	font-size: 1.875rem !important;
}

h2, .has-huge-font-size {
	font-size: 1.5rem !important;
}

h3, .has-x-large-font-size {
	font-size: 1.125rem;
}

.has-large-font-size {
	font-size: 1rem;
}

/* ========================================
   Buttons Mobile
   ======================================== */
.wp-block-buttons {
	flex-direction: column;
	gap: 0.75rem;
}

.wp-block-button__link {
	padding: 0.875rem 1.25rem;
	font-size: 0.9375rem;
}

/* ========================================
   Blog Mobile
   ======================================== */
.blog-grid,
.wp-block-post-template {
	grid-template-columns: 1fr !important;
	gap: 1.25rem;
}

.blog-card-modern {
	border-radius: 16px !important;
}

/* ========================================
   Contact Form Mobile
   ======================================== */
.gnutech-contact-form {
	padding: 1.25rem;
	border-radius: 16px;
}

.gnutech-form-row {
	grid-template-columns: 1fr;
	gap: 0;
}

.gnutech-form-group input,
.gnutech-form-group select,
.gnutech-form-group textarea {
	padding: 0.875rem 1rem;
	font-size: 16px;
}

.gnutech-form-submit button {
	width: 100%;
	justify-content: center;
}

.contact-info-card {
	padding: 1.25rem;
}

/* ========================================
   Footer Mobile
   ======================================== */
.site-footer {
	padding: 2.5rem 0 1.5rem;
}

.site-footer .wp-block-columns {
	gap: 1.5rem;
}

.footer-col {
	text-align: center;
}

.footer-col:first-child {
	max-width: 100%;
}

.social-links {
	justify-content: center;
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.25rem;
}

.footer-links li {
	margin-bottom: 0;
}

.footer-bottom {
	flex-direction: column;
	gap: 0.75rem;
	text-align: center;
}

/* ========================================
   Page Templates Mobile
   ======================================== */
.page-hero {
	padding: 4rem 0 2.5rem;
}

.page-hero h1 {
	font-size: 1.75rem;
}

.page-content {
	padding: 2.5rem 0;
}

/* ========================================
   Trusted By Mobile
   ======================================== */
.trusted-by {
	padding: 1.5rem 0 !important;
}

.partner-logos {
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

.partner-logo {
	font-size: 0.8rem;
}

/* ========================================
   CTA Section Mobile
   ======================================== */
.section-cta {
	padding: 3rem 0 !important;
}

.section-cta h2 {
	font-size: 1.375rem !important;
}

.cta-feature {
	margin: 0.25rem 0.5rem !important;
}

/* ========================================
   Tablet (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
	.site-header .header-logo img,
	.site-header .custom-logo {
		max-width: 150px !important;
	}
	
	.site-header .phone-link {
		font-size: 1rem;
	}
	
	.services-grid,
	.service-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
	
	.blog-grid,
	.wp-block-post-template {
		grid-template-columns: repeat(2, 1fr) !important;
	}
	
	.hero-title {
		font-size: 2.5rem !important;
	}
	
	.wp-block-buttons {
		flex-direction: row;
		flex-wrap: wrap;
	}
	
	.footer-col {
		text-align: left;
	}
	
	.site-footer .wp-block-columns {
		flex-direction: row;
		flex-wrap: wrap;
	}
	
	.site-footer .wp-block-column {
		flex-basis: 48% !important;
	}
}

/* ========================================
   Small Phones (< 400px)
   ======================================== */
@media (max-width: 400px) {
	.site-header .header-logo img,
	.site-header .custom-logo {
		max-width: 100px !important;
	}
	
	.site-header .phone-link span {
		display: none;
	}
	
	.hero-section .wp-block-cover {
		padding: 2.5rem 0;
	}
	
	.hero-title {
		font-size: 1.625rem !important;
	}
	
	.service-card-modern {
		padding: 1.25rem;
	}
	
	.stats-grid-modern {
		padding: 1.25rem !important;
	}
	
	.stat-card h3 {
		font-size: 1.25rem !important;
	}
}

/* ========================================
   Chi Siamo - Value Icons Mobile
   ======================================== */
.value-icon-image {
	width: 56px;
	height: 56px;
	margin-bottom: 0.75rem;
}

.story-visual-images {
	padding: 1.25rem;
	min-height: 250px;
}

.story-image-grid {
	gap: 0.75rem;
}

.story-image-item {
	border-radius: 12px;
}

.image-overlay {
	padding: 0.75rem;
}

.image-label {
	font-size: 0.8rem;
}

/* ========================================
   Service Cards Grid (Mobile/Tablet)
   ======================================== */
.service-cards-grid {
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

@media (max-width: 640px) {
	.service-cards-grid {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
}

/* ========================================
   Hero Services Cards (Mobile/Tablet)
   ======================================== */
.hero-services-cards {
	margin-top: 3rem;
}

.hero-visual-col {
	order: 2;
}

/* ========================================
   Hero Service Icons (Mobile)
   ======================================== */
@media (max-width: 768px) {
	.hero-service-icon {
		width: 40px;
		height: 40px;
		min-width: 40px;
	}
	
	.hero-service-icon svg {
		width: 24px;
		height: 24px;
	}
	
	.altri-servizi-icon {
		width: 56px;
		height: 56px;
	}
}

/* ========================================
   Back to Top Button (Mobile)
   Posizionato a sinistra del chatbot
   ======================================== */
@media (max-width: 480px) {
	.back-to-top {
		bottom: 1rem !important;
		right: calc(1rem + 66px) !important; /* chatbot 54px + gap 12px */
		width: 46px !important;
		height: 46px !important;
	}
}
