/* ============================================================
   BGC Drawer CSS — cart drawer + overlay + login modal
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────────
   Full-screen semi-transparent backdrop
   ─────────────────────────────────────────────────────────── */
.bgc-overlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
  pointer-events: none;
}
.bgc-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Cart Drawer ────────────────────────────────────────────
   Slides in from the right
   ─────────────────────────────────────────────────────────── */
.bgc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  width: 380px;
  max-width: 95vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
}
.bgc-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

/* Drawer header */
.bgc-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--bgc-line);
  flex-shrink: 0;
}
.bgc-drawer__title {
  font-family: var(--bgc-font-head);
  font-size: 18px;
  font-weight: 500;
  color: var(--bgc-ink);
  margin: 0;
}
.bgc-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--bgc-line);
  cursor: pointer;
  color: var(--bgc-muted);
  padding: 0;
  transition: color .2s, border-color .2s;
}
.bgc-drawer__close:hover { color: var(--bgc-ink); border-color: var(--bgc-ink); }
.bgc-drawer__close .bgc-icon { width: 18px; height: 18px; }

/* Drawer body — scrollable */
.bgc-drawer__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
}

/* Empty state */
.bgc-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 0;
  text-align: center;
  color: var(--bgc-muted);
}
.bgc-drawer__empty p { margin: 0; font-size: 15px; }

/* WooCommerce mini-cart overrides */
.bgc-drawer .woocommerce-mini-cart { list-style: none; margin: 0; padding: 0; }
.bgc-drawer .woocommerce-mini-cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bgc-line);
}
.bgc-drawer .woocommerce-mini-cart-item img { width: 70px; height: 70px; object-fit: cover; flex-shrink: 0; }
.bgc-drawer .woocommerce-mini-cart-item .remove { color: var(--bgc-muted); text-decoration: none; font-size: 18px; }
.bgc-drawer .woocommerce-mini-cart-item .remove:hover { color: #D32F2F; }

/* Drawer footer */
.bgc-drawer__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--bgc-line);
  flex-shrink: 0;
  background: #fafafa;
}
.bgc-drawer__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--bgc-ink);
}
.bgc-drawer__subtotal-amount { font-weight: 600; font-family: var(--bgc-font-head); }
.bgc-drawer__footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bgc-btn--outline {
  background: transparent;
  border: 2px solid var(--bgc-primary);
  color: var(--bgc-primary);
}
.bgc-btn--outline:hover {
  background: var(--bgc-primary);
  color: #fff;
}

/* ── Ücretsiz kargo ilerleme çubuğu ──────────────────────────── */
.bgc-cart-bar-wrap { flex-shrink: 0; }
.bgc-cart-bar-wrap:empty { display: none; }
.bgc-cart-bar {
  padding: 14px 24px 16px;
  border-bottom: 1px solid var(--bgc-line);
  background: #faf7f3;
}
.bgc-cart-bar--always {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2e7d32;
  font-size: 13px;
  font-weight: 500;
}
.bgc-cart-bar--always .bgc-icon { width: 18px; height: 18px; }
.bgc-cart-bar__msg {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--bgc-ink);
  line-height: 1.4;
}
.bgc-cart-bar__msg strong { color: var(--bgc-primary); }
.bgc-cart-bar.is-reached .bgc-cart-bar__msg { color: #2e7d32; }
.bgc-cart-bar__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #e8e0d6;
  overflow: visible;
}
.bgc-cart-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 999px;
  background: var(--bgc-primary);
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.bgc-cart-bar.is-reached .bgc-cart-bar__fill { background: #2e7d32; }
.bgc-cart-bar__truck {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bgc-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left .4s cubic-bezier(.4, 0, .2, 1);
}
.bgc-cart-bar.is-reached .bgc-cart-bar__truck { background: #2e7d32; }
.bgc-cart-bar__truck .bgc-icon { width: 15px; height: 15px; }

/* ── Mini-cart öğesi (yeni: stepper + sil + üstü çizili fiyat) ── */
.bgc-drawer .bgc-mini-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--bgc-line);
  position: relative;
}
.bgc-mini-cart-item__thumb { flex-shrink: 0; display: block; width: 64px; }
.bgc-mini-cart-item__thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; display: block; }
.bgc-mini-cart-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bgc-mini-cart-item__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--bgc-ink);
  text-decoration: none;
  line-height: 1.35;
  display: block;
  padding-right: 24px;
}
.bgc-mini-cart-item__name:hover { color: var(--bgc-primary); }
.bgc-mini-cart-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bgc-mini-cart-item__price { text-align: right; font-family: var(--bgc-font-head); white-space: nowrap; }
.bgc-mini-cart-item__was { color: #bbb; font-weight: 400; font-size: 12px; text-decoration: line-through; display: block; }
.bgc-mini-cart-item__now { color: var(--bgc-ink); font-weight: 600; font-size: 14px; text-decoration: none; }

/* Adet stepper */
.bgc-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--bgc-line);
  border-radius: 6px;
  overflow: hidden;
}
.bgc-qty__btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: #fff;
  color: var(--bgc-ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.bgc-qty__btn:hover { background: #f3efe9; color: var(--bgc-primary); }
.bgc-qty__val { min-width: 30px; text-align: center; font-size: 13px; font-weight: 600; color: var(--bgc-ink); }

/* Sil (çöp) */
.bgc-mini-cart-item__remove {
  position: absolute;
  top: 12px;
  right: 0;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--bgc-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color .2s;
}
.bgc-mini-cart-item__remove:hover { color: #D32F2F; }
.bgc-mini-cart-item__remove .bgc-icon { width: 16px; height: 16px; }

/* Drawer meşgulken hafif kilit */
.bgc-drawer.is-busy .bgc-drawer__body,
.bgc-drawer.is-busy .bgc-cart-bar-wrap { opacity: .55; pointer-events: none; transition: opacity .2s; }

/* ── Yeni footer: promosyon + toplam + Devam Et ──────────────── */
.bgc-drawer__promo { margin-bottom: 14px; }
.bgc-drawer__promo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--bgc-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.bgc-drawer__promo-toggle .bgc-icon { width: 15px; height: 15px; }
.bgc-drawer__promo-form { display: flex; gap: 8px; margin-top: 10px; }
.bgc-drawer__promo-form[hidden] { display: none; } /* hidden attribute display:flex'i ezmesin */
.bgc-drawer__promo-input {
  flex: 1;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--bgc-line);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.bgc-drawer__promo-input:focus { border-color: var(--bgc-primary); }
.bgc-drawer__promo-apply {
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--bgc-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.bgc-drawer__promo-apply:hover { background: var(--bgc-primary); }
.bgc-drawer__promo-msg { margin: 8px 0 0; font-size: 12px; }
.bgc-drawer__promo-msg:empty { display: none; }
.bgc-drawer__promo-msg.is-error { color: #D32F2F; }
.bgc-drawer__promo-msg.is-success { color: #2e7d32; }

.bgc-drawer__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--bgc-ink);
}
.bgc-drawer__total-amount { font-family: var(--bgc-font-head); color: var(--bgc-primary); }

.bgc-drawer__continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--bgc-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--bgc-font-accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background .2s;
}
.bgc-drawer__continue:hover { background: var(--bgc-primary-dark); color: #fff; }
.bgc-drawer__continue-arrow { font-size: 18px; line-height: 1; }
.bgc-drawer__view-cart {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--bgc-muted);
  text-decoration: none;
}
.bgc-drawer__view-cart:hover { color: var(--bgc-primary); text-decoration: underline; }

/* ── Sepet upsell: EN ÇOK SATANLAR ──────────────────────────── */
.bgc-cart-upsell { flex-shrink: 0; }
.bgc-cart-upsell:empty { display: none; }
.bgc-cart-upsell__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 24px;
  background: #faf7f3;
  border: 0;
  border-top: 1px solid var(--bgc-line);
  font-family: var(--bgc-font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--bgc-ink);
  text-transform: uppercase;
  cursor: pointer;
}
.bgc-cart-upsell__caret { width: 16px; height: 16px; color: var(--bgc-muted); transition: transform .2s; }
.bgc-cart-upsell__toggle[aria-expanded="true"] .bgc-cart-upsell__caret { transform: rotate(180deg); }
.bgc-cart-upsell__list {
  display: flex;
  gap: 10px;
  padding: 12px 24px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: #faf7f3;
}
.bgc-cart-upsell__list[hidden] { display: none; }
.bgc-upsell-card {
  flex: 0 0 128px;
  width: 128px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--bgc-line);
  border-radius: 8px;
}
.bgc-upsell-card__thumb { display: block; }
.bgc-upsell-card__thumb img { width: 100%; height: 96px; object-fit: cover; border-radius: 4px; display: block; }
.bgc-upsell-card__name {
  font-size: 12px;
  line-height: 1.3;
  color: var(--bgc-ink);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 31px;
}
.bgc-upsell-card__name:hover { color: var(--bgc-primary); }
.bgc-upsell-card__price { font-family: var(--bgc-font-head); font-size: 13px; font-weight: 600; color: var(--bgc-primary); }
.bgc-upsell-card__price del { color: #bbb; font-weight: 400; font-size: .85em; margin-right: 3px; }
.bgc-upsell-card__price ins { text-decoration: none; }
.bgc-upsell-card__add {
  margin-top: 2px;
  padding: 7px 6px;
  background: var(--bgc-dark);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-family: var(--bgc-font-accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.bgc-upsell-card__add:hover { background: var(--bgc-primary); }
.bgc-upsell-card__add.is-loading { opacity: .6; pointer-events: none; }

/* ── Login Modal ────────────────────────────────────────────
   Centered scale/fade overlay
   ─────────────────────────────────────────────────────────── */
.bgc-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.bgc-modal[aria-hidden="false"] {
  pointer-events: auto;
}
.bgc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .3s;
}
.bgc-modal[aria-hidden="false"] .bgc-modal__backdrop { opacity: 1; }

/* Modal panel */
.bgc-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  opacity: 0;
  transform: scale(.94);
  transition: opacity .3s, transform .3s;
  max-height: 90vh;
  overflow-y: auto;
}
.bgc-modal[aria-hidden="false"] .bgc-modal__panel {
  opacity: 1;
  transform: scale(1);
}

/* Modal header */
.bgc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--bgc-line);
}
.bgc-modal__title {
  font-family: var(--bgc-font-head);
  font-size: 20px;
  font-weight: 500;
  color: var(--bgc-ink);
  margin: 0;
}
.bgc-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--bgc-line);
  cursor: pointer;
  color: var(--bgc-muted);
  padding: 0;
  transition: color .2s, border-color .2s;
}
.bgc-modal__close:hover { color: var(--bgc-ink); border-color: var(--bgc-ink); }
.bgc-modal__close .bgc-icon { width: 18px; height: 18px; }

/* Modal body */
.bgc-modal__body { padding: 24px; }
.bgc-modal__body label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--bgc-ink);
  margin-bottom: 4px;
}
.bgc-modal__body input[type="text"],
.bgc-modal__body input[type="email"],
.bgc-modal__body input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--bgc-line);
  background: #fff;
  font-family: var(--bgc-font-body);
  font-size: 14px;
  color: var(--bgc-ink);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.bgc-modal__body input:focus { border-color: var(--bgc-primary); }
.bgc-modal__body .login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 12px 0; }
.bgc-modal__body .login-submit { margin-top: 8px; }
.bgc-modal__body .login-submit input[type="submit"],
.bgc-modal__body input[type="submit"] {
  width: 100%;
  height: 44px;
  background: var(--bgc-primary);
  border: 0;
  color: #fff;
  font-family: var(--bgc-font-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.bgc-modal__body .login-submit input[type="submit"]:hover,
.bgc-modal__body input[type="submit"]:hover {
  background: var(--bgc-primary-dark);
}

/* WC form overrides */
.bgc-modal__body .woocommerce-form-login { margin: 0; }
.bgc-modal__body .woocommerce-form-row { margin-bottom: 14px; }

.bgc-modal__lost-pw {
  font-size: 13px;
  color: var(--bgc-muted);
  margin: 12px 0 0;
  text-align: right;
}
.bgc-modal__lost-pw a { color: var(--bgc-primary); text-decoration: none; }
.bgc-modal__lost-pw a:hover { text-decoration: underline; }

/* Modal footer */
.bgc-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--bgc-line);
  text-align: center;
  font-size: 14px;
  color: var(--bgc-muted);
}
.bgc-modal__register-link {
  color: var(--bgc-primary);
  font-weight: 500;
  text-decoration: none;
}
.bgc-modal__register-link:hover { text-decoration: underline; }

/* ── Body scroll lock (JS adds this class) ─────────────────── */
.bgc-body-locked {
  overflow: hidden !important;
}

/* ── Sepete eklendi toast ──────────────────────────────────── */
.bgc-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 380px;
  padding: 14px 18px;
  background: #fff;
  color: var(--bgc-ink);
  border-left: 4px solid var(--bgc-primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  font-family: var(--bgc-font-body);
  font-size: 14px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .3s;
}
.bgc-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.bgc-toast__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bgc-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.bgc-toast__msg { flex: 1 1 auto; line-height: 1.4; }
.bgc-toast__action {
  flex: 0 0 auto;
  border: 0;
  background: var(--bgc-dark);
  color: #fff;
  font-family: var(--bgc-font-accent);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.bgc-toast__action:hover { background: var(--bgc-primary); }
@media (max-width: 480px) {
  .bgc-toast { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}
