:root {
  font-family: 'Fira Sans', sans-serif;
  --background-color: #fff;
  --text-color: #000000;
  --secondary-text: #4a4a4a;
  --primary-color: #37AE6A;
  --primary-hover: #2D8C55;
  --secondary-btn-bg: #D3D3D3;
  --secondary-btn-hover: #8f8f8f;
  --popup-overlay: rgba(0, 0, 0, 0.5);
  --project-bg: #F7F7F7;
  --popup-border: 1px solid rgba(0, 0, 0, 0.1);
  --popup-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 1.5px 6px rgba(0,0,0,0.12);
}

[eco2-theme='dark'] {
  --background-color: #3D3D3D;
  --text-color: #FFFFFF;
  --secondary-text: #B3B3B3;
  --primary-color: #37AE6A;
  --primary-hover: #2D8C55;
  --secondary-btn-bg: #636363;
  --secondary-btn-hover: #777777;
  --popup-overlay: rgba(0, 0, 0, 0.7);
  --project-bg: #2D2D2D;
  --popup-border: 1px solid rgba(255, 255, 255, 0.1);
  --popup-shadow:0 8px 32px rgba(0,0,0,0.28), 0 1.5px 6px rgba(0,0,0,0.12);
}

.eco2-compensation-popup {
  font-family: 'Fira Sans', sans-serif;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.eco2-popup-content,
.eco2-close-btn,
.eco2-compensation-popup h1,
.eco2-compensation-details,
.eco-item,
.action-btn,
.eco2-compensation-question,
.project-info h3,
.project-info p,
.eco2-primary-btn,
.eco2-secondary-btn,
.eco2-compensation-popup footer {
  font-family: inherit;
}

.eco2-popup-content {
  background-color: var(--background-color);
  color: var(--text-color);
  padding: 2rem;
  border-radius: 25px;
  width: 95%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1.30rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border: var(--popup-border);
  box-shadow: var(--popup-shadow);
}

.eco2-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 26px;
  height: 26px;
  font-size: 30px;
  color: white;
  background-color: var(--primary-color);
  cursor: pointer;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.eco2-close-btn:hover {
  background-color: var(--primary-hover);
}

.eco2-compensation-popup h1 {
  color: var(--text-color);
  margin: 0;
  padding-top: 15px;
  padding-left: 10px;
  font-weight: 900;
  font-size: 33px;
}

.eco2-green {
  color: var(--primary-color);
}

.eco2-compensation-details {
  display: flex;
  flex-direction: column;
  text-align: center;
  font-weight: 600;
  font-size: 22px;
}

.eco2-compensation-question {
  margin: 0;
  padding: 0 1rem;
}

.eco2-compensation-question p {
  color: var(--text-color);
  font-weight: 400;
  font-size: 16px;
  width: 380px;
}

.eco2-action-buttons {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.eco2-compensation-popup button,
.eco2-primary-btn,
.eco2-secondary-btn {
  font-family: inherit;
  border-radius: 24px;
  font-weight: 400;
  line-height: 1.2;
  box-sizing: border-box;
  border: none;
  outline: none;
  cursor: pointer;
  min-width: 0;
  transition: background-color 0.2s, color 0.2s;
}

.eco2-primary-btn,
.eco2-primary-btn:hover,
.eco2-primary-btn:focus {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  padding: 1rem 1.5rem !important;
  width: 155px !important;
}

.eco2-primary-btn:hover,
.eco2-primary-btn:focus {
  background-color: var(--primary-hover) !important;
}

a.eco2-primary-btn {
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.eco2-secondary-btn,
.eco2-secondary-btn:hover,
.eco2-secondary-btn:focus {
  background-color: var(--secondary-btn-bg) !important;
  color: #fff !important;
  padding: 1rem 1.5rem !important;
  width: 155px !important;
}

.eco2-secondary-btn:hover,
.eco2-secondary-btn:focus {
  background-color: var(--secondary-btn-hover) !important;
}

.eco2-compensation-question .eco2-primary-btn {
  width: auto !important;
  min-width: 100px !important;
  padding: 0.3rem 1rem !important;
  margin-top: 0 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
}

@media (max-width: 576px) {
  .eco2-popup-content {
    margin: 1rem;
    gap: 1rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .eco2-compensation-popup h1 {
    font-size: 28px;
    margin-bottom: 0.25rem;
    padding-left: 12px;
  }

  .eco2-compensation-question {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-left: 12px;
  }

  .eco2-compensation-question p {
    width: 100%;
  }

  .eco2-project-container {
    margin: 0 -1.2rem;
    width: calc(100% + 2.4rem);
    gap: 0.75rem;
  }

  .eco2-project-image {
    height: 150px;
    width: 100%;
    margin: 0 auto;
  }

  .eco2-project-image img {
    height: 100%;
    width: 100%;
  }

  .eco2-compensation-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: clamp(12px, 4vw, 14px) !important;
    line-height: 1.25 !important;
    padding: 0.25rem 0 !important;
  }

  .eco2-compensation-details > span,
  .eco2-compensation-details .eco2-green {
    white-space: nowrap;
  }

  .eco2-action-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, auto) !important;
    justify-content: center !important;
    align-items: center !important;
    column-gap: 12px !important;
    row-gap: 0 !important;
  }

  .eco2-primary-btn, .eco2-secondary-btn {
    width: 150px !important;
    max-width: 150px !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 0.7rem 0.9rem !important;
    text-align: center !important;
  }

  .eco2-close-btn {
    top: 10px;
    right: 10px;
    font-size: 20px;
  }

  .notification {
    width: 90%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .eco2-compensation-details {
    font-size: clamp(11px, 3.2vw, 14px) !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  .eco2-action-buttons .eco2-primary-btn,
  .eco2-action-buttons .eco2-secondary-btn {
    width: 145px !important;
    max-width: 145px !important;
    font-size: clamp(11px, 3vw, 12.5px) !important;
    padding: 0.7rem 0.8rem !important;
  }
}

@media (max-width: 420px) {
  .eco2-compensation-details {
    font-size: clamp(10.5px, 2.9vw, 13px) !important;
    gap: 4px !important;
  }

  .eco2-action-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
  }
  
  .eco2-action-buttons .eco2-primary-btn,
  .eco2-action-buttons .eco2-secondary-btn {
    width: 140px !important;
    max-width: 140px !important;
    font-size: 12px !important;
    padding: 0.7rem 0.8rem !important;
  }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem;
  border-radius: 4px;
  color: white;
  z-index: 1001;
  animation: slideIn 0.3s ease-out;
}

.notification.success {
  background-color: #37AE6A;
}

.notification.error {
  background-color: #e74c3c;
}

.loading {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 13px;
}

.loading:after {
  content: " ";
  display: block;
  border-radius: 50%;
  width: 0;
  height: 0;
  margin: 6px;
  box-sizing: border-box;
  border: 6px solid #fff;
  border-color: #fff transparent #fff transparent;
  animation: loading 1.2s infinite;
}

@keyframes loading {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

.eco2-popup-footer {
  text-align: center;
  font-size: 14px;
  margin-top: 0.5rem;
}

.eco2-popup-footer .eco2-footer-logo {
  height: 14px;
  object-fit: cover;
  vertical-align: middle;
  padding-bottom: 3px;
}

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

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-20px);
    opacity: 0;
  }
}

.eco2-sliding-out {
  animation: slideOut 0.3s ease-in forwards;
}

.eco2-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: text-bottom;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eco2-primary-btn:focus,
.eco2-secondary-btn:focus,
.eco2-close-btn:focus {
  outline: 3px solid #37AE6A;
  outline-offset: 2px;
}

.eco2-primary-btn:disabled {
  background-color: #37AE6A;
  cursor: not-allowed;
  opacity: 0.8;
}

.eco2-secondary-btn:disabled {
  background-color: #3d3d3d4f;
  cursor: not-allowed;
  opacity: 0.8;
}

.eco2-popup-content:focus {
  outline: none;
}

/* Hides the native background of the modal from Magento */
.eco2mmitment-carbon-modal .modal-inner-wrap {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  padding: 0 !important;
}

.eco2mmitment-carbon-modal.modal-popup._inner-scroll .modal-inner-wrap {
  max-height: none !important;
  overflow-y: visible !important;
}

.eco2mmitment-carbon-modal .modal-content {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.eco2mmitment-carbon-modal.modal-popup._inner-scroll .modal-content {
  overflow-y: visible !important;
  max-height: none !important;
}

.eco2mmitment-carbon-modal .modal-header,
.eco2mmitment-carbon-modal .action-close {
  display: none !important;
}

.eco2mmitment-carbon-modal .modal-header {
    display: none !important;
}

@media only screen and (max-width: 768px) {
  .eco2mmitment-carbon-modal.modal-popup.modal-slide {
    left: 0 !important;
  }
}

.eco2-project-container {
  margin: 0 -2rem;
  width: calc(100% + 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eco2-project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: var(--project-bg);
  position: relative;
}

.eco2-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast;
  will-change: transform;
  transition: none;
}