/* Site additions: checkout, contact widget, product cards, slider and header. Keep rule order. */
/* Прячем всё лишнее в шаге 1 */
#collapse-checkout-option .radio,
#collapse-checkout-option .col-sm-6:last-child,
#collapse-checkout-option h2,
#collapse-checkout-option p {
  display: none !important;
}

/* Кнопка на весь экран */
#button-account {
  display: block;
  width: 100%;
  font-size: 18px;
  padding: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.product-thumb h4 a,
.product-layout .caption a {
  text-transform: none !important;
}

.contact-widget {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 9999;
}

/* кнопка */

.contact-toggle {
  position: relative;
  width: 62px;
  height: 62px;
  cursor: pointer;
}

/* иконки */

.contact-main {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.contact-main img {
  width: 26px;
  height: 26px;
  filter: brightness(0) invert(1);
}

/* WhatsApp */

.whatsapp-main {
  background: #25d366;
  right: 0;
  bottom: 0;
  animation:
    fadeWhatsapp 6s infinite ease-in-out,
    pulse 2s infinite;
}

/* Phone */

.phone-main {
  background: #2d89ef;
  right: 0;
  bottom: 0;
  animation:
    fadePhone 6s infinite ease-in-out,
    pulse 2s infinite;
}

/* смена иконок */

@keyframes fadeWhatsapp {
  0% {
    opacity: 1;
  }
  40% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  90% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadePhone {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* пульсация */

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.35);
  }

  70% {
    box-shadow: 0 0 0 16px rgba(0, 0, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* раскрывающиеся иконки */

.contact-btn {
  position: absolute;
  right: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(20px);
  transition: 0.3s;
  pointer-events: none;
}

.contact-btn img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

/* WhatsApp */

.contact-btn.whatsapp {
  background: #25d366;
  bottom: 72px;
}

/* Phone */

.contact-btn.phone {
  background: #2d89ef;
  bottom: 128px;
}

/* открытие */

.contact-widget.active .contact-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* мобильная версия */

@media (max-width: 768px) {
  .contact-toggle {
    width: 66px;
    height: 66px;
  }

  .contact-main {
    width: 58px;
    height: 58px;
  }

  .contact-main img {
    width: 28px;
    height: 28px;
  }

  .contact-btn {
    width: 54px;
    height: 54px;
  }

  .contact-btn img {
    width: 26px;
    height: 26px;
  }
}

.top_button {
  display: none !important;
}

.rating,
.rating-wrapper,
.star-rating,
#review .fa-stack {
  display: none !important;
}

.product-thumb h4,
.product-thumb h4 a {
  font-weight: 400 !important;
}

.product-title {
  border-bottom: none !important;
}

.qty-plus-minus,
.qty-plus-minus button,
.qty-plus-minus input {
  height: 42px !important;
  line-height: 42px !important;
}

.qty-plus-minus button {
  width: 42px !important;
}

.qty-plus-minus input {
  width: 50px !important;
  text-align: center;
}

#button-cart {
  height: 42px !important;
  line-height: 42px !important;
  padding: 0 20px !important;
}

*:focus,
*:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

#content .product-list .product-block .image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

#content .product-list .product-block .image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-grid .product-block .image {
  aspect-ratio: 4 / 3 !important;
}

/* Сопутствующие товары */
#related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

#related-grid .product-items {
  width: 100%;
  max-width: 100%;
}

/* Планшеты */
@media (max-width: 1200px) {
  #related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Планшеты */
@media (max-width: 768px) {
  #related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Телефоны */
@media (max-width: 480px) {
  #related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  /* Все товары на сайте в 2 колонки */
  .product-layout.product-grid {
    width: 50% !important;
    float: left !important;
    padding: 0 5px !important;
  }

  .product-layout.product-grid .product-block {
    margin-bottom: 10px;
  }

  .product-layout.product-grid .product-details {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .product-layout.product-grid .caption {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .product-layout.product-grid .price {
    display: block !important;
    margin-top: 6px !important;
    line-height: 1.4 !important;
  }
}

/* ==== ChatGPT mobile/product fixes ==== */
.product-grid .product-block .image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.product-grid .product-block .image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.product-thumb .image {
  aspect-ratio: 4/3;
}
@media (max-width: 767px) {
  .product-layout.product-grid {
    width: 50% !important;
    min-height: auto !important;
  }
  .product-grid .product-block {
    height: auto;
  }
  .product-grid .product-details {
    min-height: auto !important;
  }
  .product-thumb:hover .price,
  .product-block:hover .product-details .price,
  .product-block:hover .price {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .product-thumb .price {
    display: block !important;
    width: 100%;
  }
  .product-layout.product-grid .product-thumb h4 {
    min-height: 40px;
  }
}

/* Одинаковая высота карточек */
.product-grid .product-block {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-grid .product-block-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 25px;
}

.product-grid .product-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Название занимает место максимум под 2 строки */
.product-grid .product-thumb h4 {
  min-height: 48px;
  margin: 8px 0 6px;
  line-height: 24px;
}

/* Цена всегда прижимается вниз */
.product-grid .price {
  margin-top: auto;
}

/* Затемнение баннера */
.main-slider .swiper-slide {
  position: relative;
}

.main-slider .swiper-slide:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

/* Текст поверх затемнения */
.main-slider .slider-content {
  position: absolute;
  z-index: 2;
}

/* Белый текст */
.main-slider .slider-title,
.main-slider .slider-description,
.main-slider .slider-details {
  color: #fff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.account {
  display: none !important;
}

.header-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.header-icons .header_search,
.header-icons .header_wishlist,
.header-icons .header_cart {
  float: none !important;
}

@media (max-width: 991px) {
  .header-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 15px 0;
    box-sizing: border-box;
  }

  .header-icons .header_search,
  .header-icons .header_wishlist,
  .header-icons .header_cart {
    display: flex;
    align-items: center;

    float: none !important;
  }

  .header_wishlist > a:before {
    display: block !important;
    content: "" !important;
    width: 24px;
    height: 24px;
    background: url(../image/webdigify/header-wishlist.svg) center center no-repeat !important;
    background-size: 20px !important;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .header_wishlist > a {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
  }

  .header_wishlist .wishlist_count {
    position: absolute;
    top: -6px;
    right: -8px;
  }
}

@media (max-width: 991px) {
  .header_wishlist {
    position: relative !important;
  }

  .header_wishlist .wishlist_count {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;

    width: 16px;
    height: 16px;
    line-height: 16px;

    background: #d37657 !important;
    color: #fff !important;
    border-radius: 50%;
    font-size: 11px !important;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
  }
}
