/* CSS per il popup CO2 tooltip */

/* Centra il popup - regole più robuste */
.mfp-wrap {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1043 !important;
  outline: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mfp-container {
  text-align: center !important;
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mfp-content {
  position: relative !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin: 0 auto !important;
  text-align: left !important;
  z-index: 1045 !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
}

.mfp-inline-holder {
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.mfp-inline-holder .mfp-content {
  width: auto !important;
  max-width: 90vw !important;
  max-height: 90vh !important;
}

/* Stile del popup */
.co2-popup-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 600px;
  width: 90%;
  margin: 20px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.co2-popup-header {
  background: #f8f9fa;
  padding: 20px 25px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.co2-popup-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #343a40;
}

.co2-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.co2-close-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.co2-popup-body {
  padding: 25px;
  line-height: 1.6;
}

.co2-popup-body p {
  margin-bottom: 16px;
  color: #495057;
  font-size: 14px;
}

.co2-popup-body p:last-child {
  margin-bottom: 0;
}

.co2-note {
  font-style: italic;
  color: #6c757d !important;
  font-size: 12px !important;
  border-top: 1px solid #e9ecef;
  padding-top: 15px;
  margin-top: 20px !important;
}

/* Responsive */
@media (max-width: 768px) {
  .co2-popup-content {
    width: 95%;
    margin: 10px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
  }
  
  .co2-popup-header {
    padding: 15px 20px;
    flex-shrink: 0;
  }
  
  .co2-popup-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
  }
}

/* Media query specifica per iPhone SE (375x667) e dispositivi simili */
@media (max-width: 425px) and (max-height: 700px) {
  .co2-popup-content {
    width: 95%;
    margin: 5px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
  }
  
  .co2-popup-header {
    padding: 12px 16px;
    flex-shrink: 0;
  }
  
  .co2-popup-header h4 {
    font-size: 16px;
  }
  
  .co2-popup-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch; 
  }
  
  .co2-popup-body p {
    font-size: 13px;
    margin-bottom: 14px;
  }
  
  .co2-note {
    font-size: 11px !important;
    margin-top: 16px !important;
    padding-top: 12px;
  }
}