@use "../variables" as *;

.servicesContainer {
  padding: 4rem 1rem;
  background-color: $servicesBg;
  max-width: 70%;
  margin: 0 auto;

  .grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(2, 1fr);

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

    @media (max-width: 768px) {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }

    @media (max-width: 480px) {
      padding: 1rem 0;
      gap: 1rem;
    }
  }

  .card {
    background-color: $servicesCardBg;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px $servicesCardBoxShadow;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;

    &:hover {
      box-shadow: 0 8px 16px $servicesCardHoverShadow;
    }

    .imageWrapper {
      width: 100%;
      height: 220px;
      overflow: hidden;

      .image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s ease;

        &:hover {
          transform: scale(1.08);
        }
      }
    }

    .textWrapper {
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      flex-grow: 1;

      h3 {
        font-size: 1.5rem;
        font-weight: 700;
        color: $servicesTitle;
        margin-bottom: 0.5rem;

        @media (max-width: 768px) {
          font-size: 1.4rem;
        }

        @media (max-width: 480px) {
          font-size: 1.2rem;
        }
      }

      p {
        font-size: 1rem;
        color: $servicesSecondaryTextColor;
        line-height: 1.6;

        @media (max-width: 768px) {
          font-size: 0.95rem;
        }

        @media (max-width: 480px) {
          font-size: 0.9rem;
        }
      }

      .readMoreButton {
        align-self: flex-end;
        margin-top: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        color: white;
        background-color: orange;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s;

        &:hover {
          background-color: darkorange;
        }

        @media (max-width: 480px) {
          font-size: 0.8rem;
          padding: 0.4rem 0.8rem;
        }
      }
    }
  }

  .modalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: $serviesModalOverlayBg;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .modalContent {
    background-color: $serviesModalContentBg;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 15px $servicesModalContentBoxShadow;

    @media (max-width: 768px) {
      padding: 1.5rem;
    }

    @media (max-width: 480px) {
      padding: 1rem;
    }
  }

  .closeButton {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: $servicesSecondaryTextColor;
    cursor: pointer;
    transform: translate(50%, -50%);

    @media (max-width: 480px) {
      font-size: 1.2rem;
    }
  }

  .modalImageWrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;

    .modalImage {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .modalTitle {
    font-size: 1.75rem;
    font-weight: 700;
    color: $servicesTitle;
    margin-bottom: 1rem;

    @media (max-width: 768px) {
      font-size: 1.5rem;
    }

    @media (max-width: 480px) {
      font-size: 1.3rem;
    }
  }

  .modalDescription {
    font-size: 1rem;
    color: $servicesSecondaryTextColor;
    line-height: 1.8;

    @media (max-width: 768px) {
      font-size: 0.95rem;
    }

    @media (max-width: 480px) {
      font-size: 0.9rem;
    }
  }
}
