.buying {
  color: var(--text);
  background: linear-gradient(to bottom, var(--bg-deep), var(--bg-deep), var(--bg-slate)); 
  padding: 60px 15px;
  overflow: hidden;  
  position: relative;
}

.buying-title {
  z-index: 3;
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
  background-position: center center;
  text-align: center;
  min-height: 100px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-image: url(../images/buy_auto.png.webp);
  background-position: center left;
  background-size: min(100%, 520px) auto;
  background-repeat: no-repeat;
  margin-bottom: 16px;
  position: relative;
}

.buying-cards-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  z-index: 3;
  position: relative;
}

.buying-card {
  flex: 1 1 300px;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 12px;
  align-content: start;
  background-image: url(../images/Rectangle_69.png.webp);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-origin: border-box;
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.8vw, 28px);
  z-index: 3;
  position: relative;
}

.buying-card-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px 16px;
  width: 100%;
  min-width: 0;
}


.buying-card-number {
  color: var(--highlight);
  font-size: clamp(24px, 2.8vw, 30px);
  font-family: var(--font-sans);
  line-height: 1;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 2.35ch;
  text-align: right;
}

.buying-card-title {
  color: var(--text-muted);
  font-size: clamp(13px, 1.35vw, 15px);
  font-weight: 600;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.buying-card-bottom {
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding-top: 0;
  overflow-wrap: anywhere;
}

.buying-bg {
  position: absolute;
  bottom: -300px;
  right: -320px;
  width: 100%;
  height: 100%;
  object-fit: cover; /* картинка розтягується */
  opacity: 0.2; /* якщо треба трохи затемнити */
  z-index: 0; /* фон під контентом */
}

.buying-bg-2 {
  position: absolute;
  bottom: -200px;
  left: 0px;
  width: 500px;
  height: 500px;
  object-fit: cover; /* картинка розтягується */
  opacity: 0.85; /* якщо треба трохи затемнити */
  z-index: 0; /* фон під контентом */
}

.buying-bg-3 {
  position: absolute;
  top: 150px;
  left: -150px;
  width: 600px;
  height: 600px;
  object-fit: cover; /* картинка розтягується */
  opacity: 0.25; /* якщо треба трохи затемнити */
  z-index: 0; /* фон під контентом */
}


@media (max-width: 960px) {
  .buying-bg {
    bottom: -300px;
    right: 0px;
  }
  
  .buying-bg-2 {
    position: absolute;
    bottom: -100px;
    left: 0px;
    width: 500px;
    height: 500px;
  }
  
  .buying-bg-3 {
    position: absolute;
    top: 150px;
    left: -150px;
    width: 600px;
    height: 600px;
    object-fit: cover; /* картинка розтягується */
    opacity: 0.25; /* якщо треба трохи затемнити */
    z-index: 0; /* фон під контентом */
  }
  
}

@media (max-width: 720px) {
  .buying-title {
    font-size: clamp(18px, 4.5vw, 24px);
    background-size: contain;
    background-position: bottom;
    min-height: 72px;
  }

  .buying-card {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
    padding: 16px 18px;
  }

  .buying-card-number {
    font-size: 24px;
    width: auto;
  }

  .buying-card-title {
    font-size: 12.5px;
  }

  .buying-card-bottom {
    font-size: 12.5px;
  }
}