/**
 * DIGITALDOCS.SHOP — Dedicated AJAX Slide-Out Mini Cart Drawer Stylesheet
 * Strictly reproduces approved design reference media_1794318776172_ad35d542.jpg
 */

:root {
  --cart-primary: #078A42;
  --cart-primary-dark: #057035;
  --cart-primary-gradient: linear-gradient(180deg, #189830 0%, #067B27 100%);
  --cart-mint-bg: #E8F7EE;
  --cart-mint-card: #F0FAF3;
  --cart-mint-border: #D0EBD8;
  --cart-dark-navy: #101828;
  --cart-muted: #475467;
  --cart-border: #E5EAE7;
  --cart-red-delete: #E03131;
}

/* 1. Background Scroll Lock */
body.mini-cart-open {
  overflow: hidden !important;
  touch-action: none;
}

/* 2. Dark Transparent Backdrop Overlay */
.mini-cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 99998;
}

.mini-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* 3. Slide-Out Drawer from Right */
.mini-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88vw;
  max-width: 420px;
  background-color: #ffffff;
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
  box-shadow: -10px 0 32px rgba(16, 24, 40, 0.16);
  z-index: 99999;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.mini-cart-drawer.is-open {
  transform: translateX(0);
}

.mini-cart-drawer-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 18px;
  box-sizing: border-box;
  background-color: #ffffff;
  position: relative;
}

/* 4. Drawer Header (Soft Mint Rounded Card) */
.cart-drawer-header {
  background-color: var(--cart-mint-bg);
  border-radius: 18px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.cart-drawer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--cart-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-drawer-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--cart-dark-navy);
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cart-drawer-count {
  color: var(--cart-primary);
  font-weight: 800;
}

.cart-drawer-close-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cart-dark-navy);
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.cart-drawer-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 5. Scrollable Body Container */
.cart-drawer-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Custom Scrollbar for Drawer */
.cart-drawer-scrollable::-webkit-scrollbar {
  width: 4px;
}
.cart-drawer-scrollable::-webkit-scrollbar-thumb {
  background: #E5EAE7;
  border-radius: 4px;
}

/* 6. Product Cards List */
.cart-drawer-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-drawer-item {
  background-color: #ffffff;
  border: 1px solid var(--cart-border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-drawer-item.is-updating {
  opacity: 0.5;
  pointer-events: none;
}

.cart-item-thumb-box {
  width: 66px;
  height: 66px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #F2F4F7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  text-align: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-item-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.cart-item-name {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--cart-dark-navy);
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-item-remove-btn {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--cart-red-delete);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  transition: transform 0.15s ease;
}

.cart-item-remove-btn:hover {
  transform: scale(1.1);
}

.cart-item-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cart-item-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--cart-primary);
  letter-spacing: -0.01em;
}

/* Quantity Selector: [ − | 1 | + ] */
.cart-drawer-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--cart-border);
  border-radius: 8px;
  background-color: #FAFAFA;
  height: 32px;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.cart-drawer-qty-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--cart-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.cart-drawer-qty-btn.cart-drawer-qty-minus {
  border-right: 1px solid var(--cart-border);
}

.cart-drawer-qty-btn.cart-drawer-qty-plus {
  border-left: 1px solid var(--cart-border);
}

.cart-drawer-qty-btn:hover {
  background-color: #ECEFF1;
  color: var(--cart-dark-navy);
}

.cart-drawer-qty-val {
  min-width: 26px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--cart-dark-navy);
  padding: 0 4px;
  background-color: #ffffff;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 7. Coupon Section */
.cart-drawer-coupon-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.cart-drawer-coupon-box {
  background-color: var(--cart-mint-card);
  border: 1px solid var(--cart-mint-border);
  border-radius: 12px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.coupon-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.coupon-box-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coupon-tag-icon {
  flex-shrink: 0;
}

.coupon-prompt-text {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--cart-dark-navy);
}

.coupon-apply-action-btn {
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--cart-primary);
  cursor: pointer;
  padding: 0;
}

.coupon-input-collapsible {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--cart-mint-border);
}

.coupon-input-collapsible.is-open {
  display: block;
}

.coupon-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-coupon-input {
  flex: 1;
  height: 36px;
  border: 1px solid var(--cart-mint-border);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  background-color: #ffffff;
  color: var(--cart-dark-navy);
  box-sizing: border-box;
}

.drawer-coupon-input:focus {
  outline: none;
  border-color: var(--cart-primary);
  box-shadow: 0 0 0 2px rgba(7, 138, 66, 0.15);
}

.drawer-coupon-submit-btn {
  height: 36px;
  padding: 0 14px;
  background-color: var(--cart-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.drawer-coupon-submit-btn:hover {
  background-color: var(--cart-primary-dark);
}

.drawer-coupon-msg {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
}

.drawer-coupon-msg.success {
  color: #078A42;
  background-color: #E8F7EE;
}

.drawer-coupon-msg.error {
  color: #D92D20;
  background-color: #FEF3F2;
}

/* Applied coupon chips */
.cart-applied-coupons-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}

.applied-coupon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--cart-mint-bg);
  border: 1px solid var(--cart-mint-border);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--cart-primary);
}

.remove-coupon-btn {
  background: transparent;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: #E03131;
  cursor: pointer;
  padding: 0 2px;
}

/* 8. Cart Summary / Totals */
.cart-drawer-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 2px;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subtotal-row .summary-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--cart-dark-navy);
}

.subtotal-row .summary-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--cart-dark-navy);
}

.discount-row .summary-label,
.discount-row .summary-val {
  font-size: 14px;
  font-weight: 650;
  color: var(--cart-primary);
}

.total-row {
  margin-top: 4px;
}

.total-label {
  font-size: 21px;
  font-weight: 850;
  color: var(--cart-dark-navy);
  letter-spacing: -0.01em;
}

.total-val {
  font-size: 21px;
  font-weight: 850;
  color: var(--cart-dark-navy);
  letter-spacing: -0.01em;
}

/* 9. Proceed to Checkout Button */
.cart-drawer-checkout-btn {
  width: 100%;
  height: 50px;
  background: var(--cart-primary-gradient);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(7, 138, 66, 0.28);
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
}

.cart-drawer-checkout-btn:hover {
  background: linear-gradient(180deg, #1fa837 0%, #088b2d 100%);
  box-shadow: 0 6px 18px rgba(7, 138, 66, 0.35);
  color: #ffffff;
}

.cart-drawer-checkout-btn:active {
  transform: translateY(1px);
}

.checkout-btn-icon {
  flex-shrink: 0;
}

/* 10. Bottom Trust Section */
.cart-drawer-trust-box {
  background-color: var(--cart-mint-card);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.drawer-trust-icon {
  flex-shrink: 0;
}

.drawer-trust-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.3;
}

.drawer-trust-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #101828;
}

.drawer-trust-divider {
  color: #D0EBD8;
  font-weight: 400;
}

.drawer-trust-line2 {
  font-size: 11px;
  font-weight: 600;
  color: var(--cart-muted);
}

/* 11. Empty Cart View */
.cart-drawer-empty-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 16px;
  box-sizing: border-box;
}

.cart-empty-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--cart-mint-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.cart-empty-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--cart-dark-navy);
  margin: 0 0 8px;
}

.cart-empty-desc {
  font-size: 13.5px;
  color: var(--cart-muted);
  margin: 0 0 20px;
  max-width: 240px;
  line-height: 1.4;
}

.cart-empty-shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: var(--cart-primary-gradient);
  color: #ffffff;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(7, 138, 66, 0.28);
  transition: all 0.15s ease;
}

.cart-empty-shop-btn:hover {
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(7, 138, 66, 0.35);
}

/* 12. Desktop Responsiveness */
@media (min-width: 768px) {
  .mini-cart-drawer {
    width: 390px;
  }
}
