/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

.site-header.sticky {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

/* Header Left - Logo + Menu */
.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Header Right - Cerca + Newsletter */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Site Branding */
.site-branding {
  flex-shrink: 0;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
  letter-spacing: -0.01em;
}

.site-title a {
  color: var(--color-primary);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--color-secondary);
  text-decoration: none;
}

.site-description {
  display: none;
}

.custom-logo-link {
  display: block;
  line-height: 0;
}

.custom-logo {
  max-height: 50px;
  width: auto;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  padding: 8px 0;
  display: block;
  position: relative;
  transition: color 0.3s ease;
  letter-spacing: 0.01em;
}

.nav-menu a:hover,
.nav-menu a:focus,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  color: var(--color-secondary);
}

/* Underline effect */
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item > a::after,
.nav-menu .current_page_item > a::after {
  width: 100%;
}

/* Search Toggle Button */
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.search-toggle:hover {
  color: var(--color-secondary);
}

.search-toggle svg {
  width: 20px;
  height: 20px;
}

/* Newsletter Link */
.link-newsletter {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
  letter-spacing: 0.01em;
}

.link-newsletter:hover {
  color: var(--color-secondary);
  text-decoration: none;
}

/* Search Overlay - Stile Microsoft */
.header-search-overlay {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-overlay-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.search-overlay-inner .search-form {
  flex: 1;
  max-width: none;
  margin: 0;
}

.search-overlay-inner .search-field {
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

.search-overlay-inner .search-field:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.search-overlay-inner .search-submit {
  display: none;
}

.search-overlay-close {
  padding: 10px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.search-overlay-close:hover {
  background: var(--color-bg-light);
  border-color: var(--color-primary);
}

.search-overlay-close svg {
  width: 20px;
  height: 20px;
}

/* Menu Toggle (Mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  width: 40px;
  height: 40px;
}

.menu-toggle-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  position: relative;
  transition: background 0.3s ease;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  left: 0;
  transition: all 0.3s ease;
}

.menu-toggle-icon::before {
  top: -8px;
}

.menu-toggle-icon::after {
  bottom: -8px;
}

.menu-toggle.active .menu-toggle-icon {
  background: transparent;
}

.menu-toggle.active .menu-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle.active .menu-toggle-icon::after {
  bottom: 0;
  transform: rotate(-45deg);
}

/* Screen Reader Text */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--color-bg-light);
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: var(--color-primary);
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  background: var(--color-primary);
  color: var(--color-white);
  margin-top: var(--spacing-xl);
}

/* Footer Widgets */
.footer-widgets {
  padding: var(--spacing-xl) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-widgets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

.footer-widget-area {
  color: rgba(255, 255, 255, 0.9);
}

.footer-widget-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--spacing-sm);
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-widget li {
  margin-bottom: 8px;
}

.footer-widget a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-widget a:hover {
  color: var(--color-white);
  text-decoration: none;
}

/* Footer Bottom */
.footer-bottom {
  padding: var(--spacing-lg) 0;
}

.footer-bottom-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: start;
  margin-bottom: var(--spacing-md);
}

.footer-branding {
  max-width: 400px;
}

.footer-site-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.footer-site-title a {
  color: var(--color-white);
  text-decoration: none;
}

.footer-site-title a:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.6;
}

/* Footer Navigation */
.footer-navigation {
  display: flex;
  flex-direction: column;
}

.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu li {
  margin-bottom: 8px;
}

.footer-menu a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font-body);
  transition: color 0.3s ease;
}

.footer-menu a:hover {
  color: var(--color-white);
  text-decoration: none;
}

/* Footer Social */
.footer-social {
  display: flex;
  gap: var(--spacing-sm);
}

/* Site Info */
.site-info {
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.site-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.site-info a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.site-info a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE - HEADER & FOOTER
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .header-inner {
    padding: var(--spacing-sm) 0;
  }
  
  .nav-menu {
    gap: var(--spacing-md);
  }
  
  .footer-widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-bottom-inner {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-social {
    grid-column: span 2;
  }
}

/* Mobile */
@media (max-width: 768px) {
  
  /* Header Mobile */
  .header-inner {
    padding: 16px 0;
  }
  
  .header-left {
    gap: 15px;
    flex: 1;
  }
  
  .header-right {
    gap: 12px;
  }
  
  .menu-toggle {
    display: block;
    order: -1;
  }
  
  .main-navigation {
    position: relative;
  }
  
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: var(--spacing-sm);
    min-width: 220px;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    z-index: 100;
  }
  
  .main-navigation.active .nav-menu {
    display: flex;
  }
  
  .nav-menu li {
    width: 100%;
  }
  
  .nav-menu a {
    padding: 12px var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    font-size: 16px;
  }
  
  .nav-menu li:last-child a {
    border-bottom: none;
  }
  
  .nav-menu a::after {
    display: none;
  }
  
  .custom-logo {
    max-height: 40px;
  }
  
  .btn-newsletter {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .link-newsletter {
    font-size: 14px;
  }
  
  .search-overlay-inner {
    gap: 12px;
  }
  
  .search-overlay-close {
    width: 40px;
    height: 40px;
  }
  
  .search-overlay-close svg {
    width: 18px;
    height: 18px;
  }
  
  .search-toggle {
    padding: 6px;
  }
  
  .search-toggle svg {
    width: 18px;
    height: 18px;
  }
  
  /* Footer Mobile */
  .footer-widgets-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .footer-bottom-inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .footer-social {
    grid-column: 1;
  }
}
