/* ==========================================================================
   Unimac Automazioni - Core Styles (2026)
   ========================================================================== */

:root {
  /* Color Palette - Premium Light Theme (Tactile Brutalism) */
  --bg-dark: #f8fafc; /* Sfondo principale chiaro ghiaccio */
  --bg-darker: #f1f5f9; /* Sfondo alternativo chiaro */
  --bg-card: #ffffff; /* Card bianche pure */
  
  --text-main: #0f172a; /* Antracite per leggibilitÃƒÂ  massima */
  --text-muted: #475569;
  
  --primary: #004b87; /* Blu Logo Unimac (Corporate) */
  --primary-hover: #003057;
  --accent: #1e9d3f; /* Verde (preso dai vecchi css) */
  
  --dark-insert: #020617; /* Per gli inserti scuri di forte contrasto */
  --dark-insert-text: #f8fafc;
  
  --border-color: #e2e8f0; /* Bordi netti e visibili 1px */
  --glass-bg: rgba(255, 255, 255, 0.85); /* Light glassmorphism */
  --glass-border: rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  
  /* Transitions & Shadows */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
  --shadow-card: 0 10px 30px rgba(0,0,0,0.03);
  
  /* Spacing */
  --section-pad: 6rem 2rem;
  --container-width: 1280px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.grid {
  display: grid;
  gap: 2rem;
}

.flex {
  display: flex;
}

/* Header - Floating Pill Design */
.site-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 1200px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(30, 41, 59, 0.08);
  color: var(--primary);
}

/* Dropdown Styles */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  margin-top: 15px;
  left: 0;
  background-color: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 260px;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  z-index: 1001;
  padding: 0.8rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
}

/* Invisible bridge to keep hover state active */
.dropdown-content::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  height: 15px;
}

.dropdown-content li {
  list-style: none;
}

.dropdown-content a {
  color: #f8fafc;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: var(--transition);
}

.dropdown-content a::after {
  display: none;
}

.dropdown-content a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Caret for dropdown */
.dropdown > a {
  display: flex;
  align-items: center;
  gap: 5px;
}


/* Lang Switcher */
.lang-switcher {
  display: flex;
  gap: 1rem;
}
.lang-switcher a {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lang-switcher a.active, .lang-switcher a:hover {
  color: var(--primary);
}

/* Mobile Offcanvas & Top Bar */
.mobile-top-actions {
  display: none;
  align-items: center;
  gap: 0.8rem;
  margin-left: 1rem;
}
.mobile-top-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(0, 75, 135, 0.08);
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
.mobile-top-actions a:hover {
  background-color: var(--primary);
  color: #ffffff;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
}
.offcanvas-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.offcanvas-overlay.active {
  display: block;
  opacity: 1;
}
.mobile-lang-switcher {
  display: none;
}

@media (max-width: 992px) {
  .site-header .container {
    padding: 0 1rem;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -350px;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 1001;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
  }
  .nav-links.active {
    right: 0;
  }
  .mobile-top-actions {
    display: flex;
  }
  .hamburger {
    display: block;
    z-index: 1002;
  }
  .lang-switcher {
    display: none;
  }
  .mobile-lang-switcher {
    display: block;
  }
  .dropdown-content {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding-left: 1rem;
    display: block;
  }
  .dropdown-content a {
    color: var(--text-main);
  }
  
}

/* Footer */
.site-footer {
  background: var(--dark-insert); /* Inserto scuro */
  color: var(--dark-insert-text);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--dark-insert);
}
.site-footer a {
  color: var(--dark-insert-text);
}
.site-footer a:hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Sector Grid (Homepage) */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.sector-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.sector-card .sector-name {
  font-weight: 600;
  font-size: 1.05rem;
  text-align: left;
}

.sector-card .sector-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.3s ease, color 0.3s ease;
}

.sector-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(135deg, #ffffff, rgba(0, 75, 135, 0.03));
  border-color: var(--primary);
  box-shadow: 0 15px 30px -5px rgba(0, 75, 135, 0.1);
  color: var(--primary);
}

.sector-card:hover .sector-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .sector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sector-grid {
    grid-template-columns: 1fr;
  }
}

/* Sector Features */
.sector-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.sector-feature-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.sector-feature-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.sector-feature-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Lightbox Gallery */
.gallery-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}
.gallery-img-wrapper img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-img-wrapper::after {
  content: '\1F50D';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 2rem;
  color: white;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
  z-index: 2;
}
.gallery-img-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.gallery-img-wrapper:hover img {
  transform: scale(1.05);
}
.gallery-img-wrapper:hover::before {
  opacity: 1;
}
.gallery-img-wrapper:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: contain;
}
.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: var(--primary);
}
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  z-index: 10001;
}
.lightbox-prev:hover, .lightbox-next:hover {
  background: var(--primary);
  color: white;
}
.lightbox-prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}
.lightbox-next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-card);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: var(--primary);
}
.modal-html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  overflow-y: auto;
  padding-right: 10px;
  margin-top: 1rem;
}
.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Additional Mobile Adjustments */
@media (max-width: 992px) {
  .hero-media {
    margin-top: 100px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-pad: 4rem 1.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  h1 {
    font-size: 2.5rem !important;
  }
  
  h2 {
    font-size: 2rem !important;
  }
}
/* ==========================================================================
   AccessibilitÃ  & GDPR Styles
   ========================================================================== */

/* Skip Link per Screen Reader */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 9999;
    transition: top 0.2s;
    text-decoration: none;
    font-weight: bold;
}
.skip-link:focus {
    top: 0;
}

/* Cookie Banner Base */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 8000;
    display: none; /* Gestito da JS */
    padding: 1.5rem 0;
}
.cookie-banner-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
.cookie-text h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.cookie-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Revoke Consent Floating Button */
.cookie-revoke-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: none; /* Gestito da JS */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 7999;
    color: var(--text-main);
    transition: var(--transition);
}
.cookie-revoke-btn:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.1);
}

/* ==========================================================================
   Mobile Menu Redesign (Accordion & Offcanvas)
   ========================================================================== */
.mobile-menu-header {
  display: none;
}

@media (max-width: 992px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -400px;
    width: 320px;
    height: 100vh;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 0;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: -10px 0 25px rgba(0,0,0,0.3);
    overflow-y: auto;
  }
  .nav-links.active {
    right: 0;
  }
  
  .nav-links > li {
    width: 100%;
  }
  .nav-links a {
    color: #f8fafc !important;
    width: 100%;
    padding: 1.2rem 2rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: block;
  }
  .nav-links a:hover, .nav-links a.active {
    background: rgba(255,255,255,0.05);
  }
  
  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.5rem 2rem;
    background: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .mobile-menu-title {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
  }
  .mobile-lang-top {
    display: flex;
    gap: 15px;
  }
  .mobile-lang-top a {
    padding: 0;
    width: auto;
    border: none;
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.9rem;
    font-weight: 600;
  }
  .mobile-lang-top a.active {
    color: white !important;
    background: none;
  }
  .close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }

  /* Dropdown changes for accordion */
  .dropdown {
    width: 100%;
  }
  .dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .dropdown-content {
    display: none !important; /* Hidden by default on mobile now */
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(0,0,0,0.2) !important;
    padding-left: 0;
  }
  .dropdown-content a {
    padding: 1rem 2rem 1rem 3rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
  }
  .dropdown.expanded .dropdown-content {
    display: block !important;
  }
  
  
}

/* ================== DROPODWN CARET ================== */
.dropdown > a::after {
  content: " ▼";
  font-size: 0.8em;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

@media (max-width: 992px) {
  .dropdown > a::after {
    content: "+";
    font-size: 1.8rem;
    margin-left: auto; /* spinge a destra */
    line-height: 1;
    font-weight: 300;
  }
  .dropdown.expanded > a::after {
    transform: rotate(45deg);
  }
}