/* cart-drawer.css - Vanilla CSS for BeeCart Frontend & Admin Preview */

.bc-drawer-wrap {
  font-family: inherit;
}

/* Overlay */
.bc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}
.bc-overlay.is-active,
.bc-drawer-wrap.is-open .bc-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Panel */
.bc-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background-color: #fff;
  z-index: 10000;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  box-shadow:
    -10px 0 25px -5px rgba(0, 0, 0, 0.1),
    -8px 0 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  box-sizing: border-box;
}
.bc-drawer-panel.is-active,
.bc-drawer-wrap.is-open .bc-drawer-panel {
  transform: translateX(0);
}
.bc-drawer-panel * {
  box-sizing: border-box;
}

body.admin-bar .bc-drawer-panel {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .bc-drawer-panel {
    top: 46px;
  }
}

/* Header */
.bc-drawer-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid #e5e7eb;
}
.bc-drawer-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  line-height: 1;
}
.bc-drawer-title-sep {
  margin: 0 6px;
  opacity: 0.6;
}
.bc-drawer-close {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.bc-drawer-close:hover {
  filter: brightness(0.95);
}

/* Announcements & Timers */
.bc-announcement {
  text-align: center;
  font-weight: 500;
  width: 100%;
  border-bottom: 1px solid #d1d5db;
}
.bc-announcement.size-small {
  padding: 8px;
  font-size: 12px;
}
.bc-announcement.size-medium {
  padding: 12px;
  font-size: 14px;
}
.bc-announcement.size-large {
  padding: 16px;
  font-size: 16px;
}

/* Body Content Area */
.bc-drawer-body {
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: transparent;
  transition: opacity 0.3s;
}
.bc-cart-contents-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.bc-drawer-body.is-loading {
  opacity: 0.5;
  pointer-events: none;
}
.bc-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

/* Progress Bar */
.bc-rewards-bars-wrap {
  padding: 16px 24px;
  display: flex;
  column-gap: 8px;
  row-gap: 32px;
}
.bc-progress-wrap {
  padding-right: 12px;
  flex: 1;
}
.bc-progress-text {
  font-size: 15.5px;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.25;
}
.bc-progress-text strong {
  font-weight: 600;
}
.bc-progress-bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  margin-top: 8px;
}
.bc-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
}
.bc-checkpoints {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bc-checkpoint {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.bc-checkpoint .bc-checkpoint-icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  display: block;
}
.bc-checkpoint-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* items List */
.bc-item-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  flex-shrink: 0;
  border-top: 1px solid #e5e7eb;
}
.bc-item {
  display: flex;
  gap: 18px;
  position: relative;
  width: 100%;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}
.bc-item-img-wrap {
  width: 96px;
  height: 96px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #f3f4f6;
}
.bc-item-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bc-item-img-wrap .dashicons {
  font-size: 30px;
  width: 30px;
  height: 30px;
  color: #d1d5db;
  opacity: 0.5;
}
.bc-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  min-width: 0;
}
.bc-item-remove {
  position: absolute;
  top: 0;
  right: 0;
  color: #9ca3af;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.bc-item-remove:hover {
  color: #ef4444;
}
.bc-item-remove .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.bc-item-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  padding-right: 24px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-item-meta {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  margin: 0 0 6px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bc-item-prices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.bc-item-old-price {
  font-size: 13px;
  text-decoration: line-through;
  color: #9ca3af;
}
.bc-item-price {
  font-size: 15px;
}

.bc-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 6px;
  height: 32px;
}
.bc-qty-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  overflow: hidden;
  height: 100%;
  background: #fff;
}
.bc-qty-btn {
  width: 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}
.bc-qty-btn:hover {
  background: #f9fafb;
}
.bc-qty-btn.minus {
  border-right: 1px solid #d1d5db;
}
.bc-qty-btn.plus {
  border-left: 1px solid #d1d5db;
}
.bc-qty-val {
  width: 40px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.bc-item-discount-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  background-color: #f3f4f6;
  border-radius: 4px;
  padding: 4px 8px;
  line-height: 1;
  border: 1px solid #f3f4f6;
}
.bc-badge-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  color: #6b7280;
}
.bc-badge-text {
  font-size: 10px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bc-summary-discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f0fff4; /* Light green bg */
  border: 1px dashed #22c55e; /* Dashed green border */
  border-radius: 99px;
  padding: 4px 6px 4px 10px;
  line-height: 1;
  transition: all 0.2s;
  margin-left: 4px;
}
.bc-summary-badge-text {
  font-size: 11px;
  font-weight: 600;
  color: #166534;
  letter-spacing: 0.02em;
}
.bc-badge-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background-color: #9ca3af;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}
.bc-badge-remove:hover {
  background-color: #6b7280;
}
.bc-badge-remove svg {
  width: 10px;
  height: 10px;
  stroke-width: 3px;
}

.bc-discount-val {
  color: #22c55e !important;
  font-weight: 600 !important;
}

/* Upsells */
.bc-upsells {
  padding: 24px;
  flex-shrink: 0;
  width: 100%;
}
.bc-upsells-divider {
  width: calc(100% + 48px);
  margin-left: -24px;
  margin-right: -24px;
  height: 1px;
  background-color: #e5e7eb;
  margin-bottom: 32px;
}
.bc-upsells-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 24px;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1;
}
.bc-upsells-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bc-upsell-item {
  padding: 12px;
  border-radius: 4px;
  display: flex;
  gap: 16px;
  align-items: center;
  border: 1px solid #f0f0f0;
  background-color: #fff;
}
.bc-upsell-img-wrap {
  width: 96px;
  height: 96px;
  border-radius: 4px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  mix-blend-mode: multiply;
  opacity: 0.9;
  flex-shrink: 0;
  border: 1px solid #f3f4f6;
}
.bc-upsell-link {
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s ease-in-out;
}
.bc-upsell-link:hover {
  opacity: 0.8;
}
.bc-upsell-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.bc-upsell-img-wrap .dashicons {
  font-size: 30px;
  width: 30px;
  height: 30px;
  color: #d1d5db;
  opacity: 0.5;
}
.bc-upsell-details {
  flex: 1;
  min-width: 0;
}
.bc-upsell-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-upsell-prices {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  line-height: 1;
}
.bc-upsell-old-price {
  font-size: 13px;
  text-decoration: line-through;
  color: #9ca3af;
}
.bc-upsell-price {
  font-size: 15px;
  font-weight: 500;
}
.bc-upsell-actions {
  display: flex;
  gap: 8px;
}
.bc-upsell-select-wrap {
  position: relative;
  flex: 1;
}
.bc-upsell-select {
  width: 100%;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0 8px;
  height: 34px;
  appearance: none;
  background: #fff;
  box-shadow: none;
}

/* TO FIX WP ADMIN STYLE OVERRIDING */
body.wp-admin .bc-upsell-select {
  font-size: 13px;
  color: #374151;
  border-radius: 4px;
  padding: 0 8px;
  appearance: none;
  background: #fff;
  box-shadow: none;
  border: 1px solid #d1d5db;
}

.bc-upsell-select:focus {
  outline: none;
  border-color: #9ca3af;
}
.bc-upsell-select-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  width: 14px;
  height: 14px;
  color: #6b7280;
  pointer-events: none;
}
.bc-upsell-add {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
  transition: all 0.2s ease-in-out;
}
.bc-upsell-add:hover {
  opacity: 0.9;
}

/* Empty Cart */
.bc-empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  flex-shrink: 0;
}
.bc-empty-cart-icon {
  margin-bottom: 16px;
  color: #9ca3af;
}
.bc-empty-cart-text {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 24px;
  text-align: center;
}
.bc-empty-cart-btn {
  height: 44px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.bc-empty-cart-btn:hover {
  opacity: 0.9;
}

/* Fixed Footer Area */
.bc-drawer-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  margin-top: auto;
}

.bc-coupon-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  padding: 4px;
  background: #fff;
  transition: border-color 0.2s;
  margin-top: 12px;
}
.bc-coupon-wrap:focus-within {
  border-color: #9ca3af;
}
.bc-coupon-input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  border: none !important;
  background: transparent !important;
  margin: 0 !important;
  appearance: none;
  box-shadow: none !important;
  min-width: 0;
  outline: none !important;
}
.bc-coupon-btn {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.bc-coupon-btn:hover {
  opacity: 0.9;
}
.bc-coupon-accordion {
  width: 100%;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 16px;
  margin-bottom: 4px;
}
.bc-coupon-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
}
.bc-coupon-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.bc-coupon-toggle-icon.is-open {
  transform: rotate(180deg);
}
.bc-coupon-accordion-content {
  overflow: hidden;
}

.bc-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15.5px;
  padding-top: 4px;
  width: 100%;
}
.bc-summary-row .label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bc-summary-row .val-wrap {
  font-weight: 500;
}
.bc-total-row {
  font-weight: 700 !important;
}
.bc-total-row .val-wrap {
  font-weight: 700 !important;
}
.bc-shipping-notice {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
  line-height: 1.4;
}

.bc-checkout-btn-wrap {
  padding-top: 4px;
  width: 100%;
}
.bc-checkout-btn {
  width: 100%;
  height: 52px;
  font-size: 16.5px;
  font-weight: 600;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  text-decoration: none;
  line-height: 1;
}
.bc-checkout-sep {
  margin: 0 8px;
  font-weight: 700;
  opacity: 0.8;
  font-size: 14px;
  margin-top: 1px;
}

.bc-trust-badges {
  padding-top: 8px;
  text-align: center;
  display: flex;
  justify-content: center;
  width: 100%;
}
.bc-trust-badges img {
  height: auto;
  max-height: 60px;
  width: auto;
  max-width: 100%;
  opacity: 1;
  object-fit: contain;
  margin: 0 auto;
}
