@media (min-width: 768px) {
    .col-md-3.d-flex {
        position: relative;
        overflow: visible;
    }

    .img-wrap {
        position: relative;
        display: block;
        overflow: hidden;
    }

    .img-wrap img {
        width: 100%;
        height: 100%;
        display: block;
        transition: opacity 0.15s ease-in-out, transform 0.15s ease;
        backface-visibility: hidden;
        will-change: opacity, transform;
        position: absolute;
        top: 0;
        left: 0;
        object-fit: cover;
        transform: translateX(20%); /* 👈 немного правее */
    }

    .img-main {
        z-index: 1;
        opacity: 1;
        transform: translateX(20%);
    }

    .img-hover {
        z-index: 2;
        opacity: 0;
        transform: translateX(20%);
        pointer-events: none;
    }


    .img-wrap:hover .img-main {
        opacity: 0;
    }

    .img-wrap:hover .img-hover {
        opacity: 1;
    }
}
.card {
    border: none; !important;
}
.btn-cart {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-left: auto; /* сдвигает кнопку вправо */
}

.card-product-grid:hover .btn-cart {
    opacity: 1;
    pointer-events: auto;
}

.price-wrap .btn {
    border-color: transparent;
    font-size: 0.8rem;
    padding: 0.2em 0.5em;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
.col-md-3 {
    padding-left: 0;
    padding-right: 0;
}

/* фиксируем высоту карточки */
.card-product-grid {
    border: 1px solid white;
    /*margin: 0 !important;*/
    /*height: 380px; !* пример фиксированной высоты *!*/
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* изменил чтобы текст не растягивал */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    transform-origin: center center;
    aspect-ratio: 2 / 3;
}
.card-product-grid:hover {
    box-shadow: 0 4px 15px rgba(153, 153, 153, 0.3);
    transition: none; !important;
    border: 1px solid #DCDCDC; !important;
    border-radius: 1px; !important;
}

.text-success {
    margin-left: 0 !important;
}

.extra-info {
    padding-top: 10px;
    font-size: 0.7rem;
    color: #555;
    /*max-height: 0;*/
    /*overflow: hidden;*/
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 1;
}

.responsive-buy-btn {
    white-space: nowrap;
}

button.add-to-cart.in-cart {
    background-color: transparent !important;
    border: none !important;
    color: blue;
    text-decoration: underline dotted;
    font-size: 0.85rem;
    transition: color 0.3s ease, text-decoration 0.3s ease;
    outline: none; /* убираем обводку */
    box-shadow: none !important;
}

button.add-to-cart.in-cart:hover {
    color: orange;
    text-decoration: underline dotted;
    cursor: pointer;
    outline: none;
    box-shadow: none !important;
}

button.add-to-cart.in-cart:focus {
    outline: none;
    border: none !important;
    box-shadow: none !important;
}

.title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: clamp(12px, 1.2vw, 16px);
    line-height: 1.2;
}

.brand-carousel-wrapper {
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: pan-y;
}

.brand-carousel-wrapper:active {
    cursor: grabbing;
}

.brand-carousel {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    transition: transform 0.1s linear;
}

.brand-carousel a {
    flex-shrink: 0; /* Запретим ужимание */
    display: inline-block;
    margin: 0 1.5rem;
    text-align: center;
}

.brand-carousel img {
    max-height: 60px;
    transition: transform 0.3s ease;
}

.brand-carousel a:hover img {
    transform: scale(1.1);
}

.section-heading .btn {
    z-index: 1;
    position: relative;
}

/* для экранов меньше 768px */
@media (max-width: 1000px) {
    .responsive-buy-btn {
        font-size: 13px;
        padding: 4px 8px;
    }
}


@media (max-width: 876px) {
    .responsive-buy-btn {
        font-size: 13px;
        padding: 2px 6px;
    }
      .extra-info {
          visibility: hidden;
      }
    .img-hover {
    display: none !important;
  }
}


@media (max-width: 767px) {

  .card-product-grid {
    transform: none !important;
    height: auto !important;
  }

  .card-product-grid:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .card-product-grid:hover .btn-cart {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

      .extra-info {
          visibility: hidden;
      }

  .card-product-grid:hover .extra-info {
    max-height: 80px;
    opacity: 1;
    pointer-events: auto;
  }
  .btn-cart {
      opacity: 1;
  }
      .img-hover {
    display: none !important;
  }
}
@media (hover: none) {
    .pagination .page-link:hover {
    background-color: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
  }
    .card-product-grid:hover {
    border: none !important;
    box-shadow: none !important;
  }
}
