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


/* =========================================================
   КАРТОЧКИ
   ========================================================= */

.custom-card-wrapper {
  display: block;
  position: relative;
  width: 100%;
  margin: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.custom-card {
  width: 100%;
  cursor: pointer;
  background: #f2f2f2;
  border-radius: 40px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow .3s ease;
  box-sizing: border-box;
}

.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;
  box-sizing: border-box;
}

.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;
}


/* =========================================================
   СКИДОЧНАЯ ЦЕНА
   ========================================================= */

.old-price {
  text-decoration: line-through;
  opacity: 0.45;
  font-size: 16px;
}

.new-price {
  font-size: 28px;
  font-weight: 800;
  color: #ff2d2d;
  background: #fff1f1;
  padding: 4px 10px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(255,45,45,.25);
}


/* =========================================================
   КНОПКИ
   ========================================================= */

.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 .2s ease !important;
  display: inline-block !important;
  color: #000 !important;
  cursor: pointer !important;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

.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);

  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;
  box-sizing: border-box;
  overflow: hidden;
}

#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 1 auto !important;
  overflow-y: auto !important;
  margin-bottom: 0 !important;
  padding-right: 12px;
  box-sizing: content-box;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#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;
}


/* =========================================================
   ТОВАРЫ В КОРЗИНЕ
   ========================================================= */

#bgd-cart-items {
  flex: 1;
  margin: 10px 0;
}

.bgd-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  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;
  box-sizing: border-box;
}

.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;
}

.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;
}


/* =========================================================
   УДАЛЕНИЕ ТОВАРА
   ========================================================= */

.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 {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 10;

  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;

  margin-top: 0 !important;
  padding-top: 14px !important;
  padding-bottom: 0 !important;

  background: #f2f2f2 !important;
}

.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;
  box-sizing: border-box;
}

.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;
}


/* =========================================================
   CLOSE / CHECKOUT
   ========================================================= */

#bgd-cart-close {
  background: #fff;
  color: #000;
  border: 2px solid #000;
}

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

#bgd-cart-checkout {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;

  height: 30px;
  padding: 0 18px !important;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 16px !important;
  border-radius: 18px !important;
  line-height: 1.1 !important;
  min-height: 0 !important;

  margin-bottom: 0 !important;
}

#bgd-cart-checkout:hover {
  background: #000 !important;
  color: #fff !important;
}

html body #bgd-cart-modal {
  padding-bottom: 10px !important;
}

html body #bgd-cart-modal .bgd-cart-actions {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}


/* =========================================================
   OVERLAY
   ========================================================= */

#bgd-cart-overlay {
  position: fixed;
  inset: 0;

  background: rgba(255,255,255,.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;
}


/* =========================================================
   BADGE
   ========================================================= */

#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;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;

  line-height: 1 !important;
}


/* =========================================================
   NO SCROLL
   ========================================================= */

html.bgd-noscroll,
body.bgd-noscroll {
  overflow: hidden !important;
  height: 100% !important;
}

body.bgd-noscroll {
  position: fixed !important;
  width: 100% !important;
  left: 0 !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (min-width: 769px) and (max-width: 1200px) {

  .custom-title {
    font-size: 36px;
  }

  .custom-footer .btn-group {
    gap: 10px;
  }
}


/* =========================================================
   ТЕЛЕФОН — КАРТОЧКИ + КОРЗИНА
   ========================================================= */

@media (max-width: 768px) {

  html body .custom-card-wrapper {
  width: 100% !important;
  max-width: 100% !important;

  margin-left: auto !important;
  margin-right: auto !important;

  left: auto !important;
  right: auto !important;

  transform: none !important;
  box-sizing: border-box !important;
}

html body .custom-card {
  width: 100% !important;
  max-width: 100% !important;

  margin-left: auto !important;
  margin-right: auto !important;

  box-sizing: border-box !important;
}

  .custom-title {
    font-size: 34px !important;
  }

  .custom-desc {
    font-size: 15px !important;
  }

  .custom-footer {
    gap: 10px;
  }

  .custom-footer .btn-group {
    gap: 8px;
  }

  .custom-btn {
    font-size: 15px !important;
    padding: 9px 14px !important;
  }


  /* ===== Корзина на телефоне ===== */

  #bgd-cart-modal {
    position: fixed;

    top: 15px !important;
    right: 15px !important;
    bottom: 15px !important;
    left: 15px !important;

    width: auto !important;
    height: auto !important;

    max-width: none !important;
    max-height: none !important;

    border-radius: 20px;
    padding: 15px;

    transform: none !important;
  }

  #bgd-cart-modal.bgd-show {
    transform: none !important;
  }

  #bgd-cart-modal h2 {
    font-size: 20px;
  }

  .bgd-cart-item {
    grid-template-columns: 52px 1fr auto auto;
    gap: 8px;
  }

  .bgd-cart-item img {
    width: 52px;
    height: 52px;
  }

  .bgd-cart-item-name {
    font-size: 14px;
  }

  .bgd-cart-item-price {
    font-size: 13px;
  }

  .bgd-cart-qty {
    margin-right: -10px;
    min-width: 70px;
  }

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

  .bgd-cart-qty button.minus {
    margin-right: -10px;
  }

  .bgd-cart-qty button.plus {
    margin-left: -10px;
  }

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

  .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,.2);
    border-radius: 2px;
  }

  html body #bgd-cart-modal {
    padding-bottom: calc(
      15px + env(safe-area-inset-bottom)
    ) !important;
  }
}


/* =========================================================
   ОЧЕНЬ УЗКИЙ ТЕЛЕФОН
   ========================================================= */

@media (max-width: 420px) {

  html body .custom-card-wrapper {
    width: 100% !important;
max-width: 100% !important;
  }

  .custom-title {
    font-size: 30px !important;
  }

  .custom-footer {
    flex-wrap: wrap;
  }

  .custom-footer .btn-group {
    margin-left: auto;
  }
}



/* ===== КОРЗИНА НА КОМПЬЮТЕРЕ ===== */
@media (min-width: 769px) {

  html body #bgd-cart-modal {
    position: fixed !important;

    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    width: 90% !important;
    max-width: 560px !important;

    height: auto !important;
    max-height: calc(100vh - 60px) !important;

    padding: 20px !important;
    border-radius: 40px !important;

    box-sizing: border-box !important;
    z-index: 2000 !important;

    transform: translate(-50%, -50%) scale(.95) !important;
  }

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



#bgd-cart-checkout {
  height: 46px !important;
  padding: 0 24px !important;
  font-size: 17px !important;
  border-radius: 18px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}



@media (max-width: 768px) {
  .custom-card-wrapper[data-href="https://barigadam.com/little-robot"] .old-price {
    font-size: 10px !important;
  }

  .custom-card-wrapper[data-href="https://barigadam.com/little-robot"] .new-price {
    font-size: 16px !important;
    padding: 2px 5px !important;
  }

  .custom-card-wrapper[data-href="https://barigadam.com/little-robot"] .custom-price {
    gap: 4px !important;
  }
}
