@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* === Карточка === */
.custom-card-wrapper {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.custom-card {
  cursor: pointer;
  background: #f2f2f2;
  border-radius: 40px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow .3s ease;
}
.custom-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.custom-img {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  border-radius: 12px;
}
.custom-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .3s;
}
.custom-card:hover .custom-img img { transform: scale(1.07); }

.custom-title {
  font-size: 40px;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  margin: 0;
  color: #000;
}
.custom-desc {
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  margin: 0;
  color: #333;
}

/* === Футер карточки === */
.custom-footer {
  display: flex;
  align-items: center;
  margin-top: auto;
  position: relative;
  z-index: 5;
}
.custom-price {
  font-size: 22px;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  color: #000;
  flex-shrink: 0;
}
.custom-footer .btn-group {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

/* === Кнопки === */
.custom-btn {
  padding: 10px 16px !important;
  border-radius: 100px !important;
  border: 2px solid transparent;
  font-size: 18px !important;
  font-weight: 400 !important;
  font-family: 'Roboto', sans-serif !important;
  text-decoration: none !important;
  text-align: center !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  display: inline-block !important;
  color: #000 !important;
}
.custom-btn.primary {
  background:#000 !important;
  color:#fff !important;
  border-color:#000 !important;
}
.custom-btn.primary:hover {
  background:#222 !important;
  border-color:#222 !important;
}
.custom-btn.outline {
  background:#fff !important;
  color:#000 !important;
  border:2px solid #000 !important;
}
.custom-btn.outline:hover {
  background:#000 !important;
  color:#fff !important;
}

/* === Иконка корзины === */
.logo-bag { position: relative; display:inline-block; cursor:pointer; }
.bag-shape { stroke:#404040; transition:stroke .3s; }
.logo-bag:hover .bag-shape { stroke:#000; }

/* === Модалка корзины === */
#bgd-cart-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.95);

  width: 90%;
  max-width: 560px;
  max-height: calc(100% - 60px); /* 🔥 15px сверху и снизу при переполнении */

  background: #f2f2f2;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  z-index: 2000;
  padding: 20px;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: all .3s;
  font-family: 'Roboto', sans-serif;
}

#bgd-cart-modal.bgd-show {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}




#bgd-cart-modal h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 15px;
  color: #000;
}

/* Контент с прокруткой */
#bgd-cart-content {
  flex: 1;
  overflow-y: auto;         /* включаем вертикальный скролл */
  margin-bottom: 12px;

  padding-right: 12px;       /* ✅ отступ для текста */
  box-sizing: content-box;   /* чтобы отступ не сжимал ширину */
}
/* Чтобы скролл выглядел аккуратнее */
#bgd-cart-content::-webkit-scrollbar {
  width: 8px;                /* ширина скролла */
}

#bgd-cart-content::-webkit-scrollbar-thumb {
  background: #bbb;          /* цвет бегунка */
  border-radius: 4px;
}

#bgd-cart-content::-webkit-scrollbar-thumb:hover {
  background: #888;
}
/* === Items === */
#bgd-cart-items { flex: 1; margin: 10px 0; }
.bgd-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto; /* картинка | текст | qty | крестик */
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

.bgd-cart-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
}
.bgd-cart-item-name {
  font-size: 20px;
  font-weight: 700;
  color: #000;
}
.bgd-cart-item-price {
  font-size: 18px;
  color: #333;
  margin-top: 4px;
}

/* === Количество (иконки в стиле крестика) === */
.bgd-cart-qty {
  justify-self: end;   /* прижимаем вправо внутри своей колонки */
  margin-right: -8px;  /* сдвигаем ближе к крестику */
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-width: 80px; /* фиксируем ширину блока qty */
}

.bgd-cart-qty button.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.bgd-cart-qty button.qty-btn svg {
  width: 14px;
  height: 14px;
  stroke: #666;          /* серый как у крестика */
  stroke-width: 2;
  stroke-linecap: round;
}

.bgd-cart-qty button.qty-btn:hover svg {
  stroke: #000;          /* при наведении чёрный */
}

.bgd-cart-qty span {
  min-width: 28px;
  text-align: center;
  font-size: 18px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
}

/* === Крестик (X) === */
.bgd-cart-item-remove {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

.bgd-cart-item-remove svg {
  width: 14px;
  height: 14px;
  stroke: #666;
  stroke-width: 2;
  stroke-linecap: round;
}

.bgd-cart-item-remove:hover svg {
  stroke: #000;
}


/* === Total === */
#bgd-cart-total {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
  text-align: right;
}

/* === Форма === */
#bgd-cart-form {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#bgd-cart-form label {
  font-size: 16px;
  font-weight: 500;
  color: #000;
}
#bgd-cart-form input,
#bgd-cart-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
  box-sizing: border-box;
}
#bgd-cart-form textarea {
  min-height: 70px;
  resize: vertical;
}
#bgd-cart-form input:focus,
#bgd-cart-form textarea:focus {
  outline: none;
  border-color: #000;
}

/* === Actions === */
.bgd-cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}
.bgd-cart-actions button {
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 18px;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
}
.bgd-cart-primary {
  background: #000;
  color: #fff;
  border-color: #000;
}
.bgd-cart-primary:hover {
  background: #222;
}
.bgd-cart-secondary {
  background: #fff;
  color: #000;
  border: 2px solid #000;
}
.bgd-cart-secondary:hover {
  background: #000;
  color: #fff;
}

#bgd-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease;
}
#bgd-cart-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* === Бейджик корзины (фикс дублирования) === */
#bgd-cart-badge {
  position: absolute;
  bottom: -1px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 1px 6px 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  font-family: 'Roboto', sans-serif;
  display: flex;                   /* 🔥 всегда flex, JS сам включает/выключает */
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1 !important;
}



/* Телефон — с зазорами */
@media (max-width: 768px) {
  #bgd-cart-modal {
    position: fixed;
    inset: 15px;             /* одинаковый зазор со всех сторон */
    width: auto;
    height: auto;
    max-width: none;
    max-height: calc(100% - 30px); /* учитываем зазоры сверху/снизу */
    border-radius: 20px;
    padding: 15px;
    transform: none !important;
  }

  #bgd-cart-modal h2 {
    font-size: 20px;   /* Заголовок поменьше */
  }

  .bgd-cart-item-name {
    font-size: 14px;   /* Название товара */
  }

  .bgd-cart-item-price {
    font-size: 13px;   /* Цена */
  }

  .bgd-cart-qty span {
    font-size: 14px;
    min-width: 24px;
  }

  #bgd-cart-total {
    font-size: 16px;   /* Total */
  }

  .bgd-cart-actions button {
    font-size: 14px;
    padding: 8px 14px;
  }

  #bgd-cart-form label {
    font-size: 14px;   /* Лейблы формы */
  }

  #bgd-cart-form input,
  #bgd-cart-form textarea {
    font-size: 14px;
    padding: 8px 10px;
  }
  #bgd-cart-content::-webkit-scrollbar {
    width: 4px;   /* тонкий */
  }

  #bgd-cart-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2); /* полупрозрачный */
    border-radius: 2px;
  
}
.bgd-cart-qty {
    margin-right: -10px; /* ещё ближе на мобилках */
  }
  .bgd-cart-qty button.minus {
    margin-right: -10px;  /* двигаем минус ближе к цифре */
  }
  .bgd-cart-qty button.plus {
    margin-left: -10px;   /* двигаем плюс ближе к цифре */
  }
}
/* === Fix cursor for buttons === */
.custom-card .custom-btn {
  cursor: pointer !important;
  position: relative;
  z-index: 10; /* чтобы кнопки были поверх кликабельной карточки */
}
/* Кнопка Close (outline-стиль) */
#bgd-cart-close {
  background: #fff;
  color: #000;
  border: 2px solid #000
}

#bgd-cart-close:hover {
  background: #000;
  color: #fff;
}














