/* Side drawer cart */
body.ahlmall-cart-open {
  overflow: hidden;
}

.ahlmall-cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ahlmall-cart-drawer-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.ahlmall-cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1000002;
  visibility: hidden;
  pointer-events: none;
  width: min(400px, 100vw);
  max-width: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease;
  transform: translateX(100%);
}

html[dir="rtl"] .ahlmall-cart-drawer,
body[dir="rtl"] .ahlmall-cart-drawer {
  left: 0;
  right: auto;
  transform: translateX(-100%);
  box-shadow: 8px 0 32px rgba(15, 23, 42, 0.12);
}

html[dir="ltr"] .ahlmall-cart-drawer,
body[dir="ltr"] .ahlmall-cart-drawer {
  right: 0;
  left: auto;
}

.ahlmall-cart-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.ahlmall-cart-drawer__panel.cart_box {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  position: static !important;
  transform: none !important;
}

.ahlmall-cart-drawer .ahlmall-mini-cart {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ahlmall-cart-drawer .ahlmall-mini-cart__scroll {
  flex: 1 1 auto;
  max-height: none;
}

.cart_dropdown .dropdown-menu.cart_box {
  display: none !important;
}

/* Light mini-cart — overrides legacy dark .cart_box rules */

.navbar-nav .dropdown-menu.cart_box.ahlmall-mini-cart-dropdown {
  width: min(400px, 96vw);
  max-width: 96vw;
  background: #ffffff !important;
  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.12) !important;
  padding: 0 !important;
  overflow: hidden;
  transform-origin: top right;
}

html[dir="rtl"] .navbar-nav .dropdown-menu.cart_box.ahlmall-mini-cart-dropdown {
  transform-origin: top left;
  left: 0 !important;
  right: auto !important;
}

.navbar-nav .dropdown-menu.cart_box.ahlmall-mini-cart-dropdown.show {
  transform: scale(1) !important;
}

.ahlmall-mini-cart {
  color: #111827;
  text-align: start;
  direction: inherit;
}

.ahlmall-mini-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #eef0f3;
}

.ahlmall-mini-cart__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  flex: 1;
}

.ahlmall-mini-cart__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #c9a24d;
  background: #fff;
  color: #1f2937;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.ahlmall-mini-cart__close:hover {
  background: #faf7ef;
  color: #111827;
}

.ahlmall-mini-cart__scroll {
  max-height: min(52vh, 360px);
  overflow-y: auto;
  padding: 12px 14px;
}

.ahlmall-mini-cart__item {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 12px 12px 10px;
  margin-bottom: 10px;
}

.ahlmall-mini-cart__item:last-child {
  margin-bottom: 0;
}

.ahlmall-mini-cart__item-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ahlmall-mini-cart__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: block;
}

.ahlmall-mini-cart__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ahlmall-mini-cart__info {
  flex: 1;
  min-width: 0;
}

.ahlmall-mini-cart__name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 4px;
}

.ahlmall-mini-cart__name:hover {
  color: #b8860b;
}

.ahlmall-mini-cart__unit-price {
  font-weight: 600;
  color: #b8860b;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.ahlmall-mini-cart__attrs {
  font-size: 0.8rem;
  line-height: 1.35;
}

.ahlmall-mini-cart__stock {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 4px;
}

.ahlmall-mini-cart__item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ahlmall-mini-cart__qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.ahlmall-mini-cart__qtybtn {
  width: 36px;
  height: 36px;
  border: none;
  background: #fff;
  color: #111827;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.ahlmall-mini-cart__qtybtn:hover {
  background: #f9fafb;
}

.ahlmall-mini-cart__qtybtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ahlmall-mini-cart__qtyval {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
}

.ahlmall-mini-cart__remove {
  color: #dc2626 !important;
  font-size: 1.25rem;
  padding: 6px;
  line-height: 1;
}

.ahlmall-mini-cart__remove:hover {
  color: #b91c1c !important;
}

.ahlmall-mini-cart__summary {
  background: #f3f4f6;
  margin: 0 14px 12px;
  padding: 12px 14px;
  border-radius: 12px;
}

.ahlmall-mini-cart__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: #374151;
  margin: 0 0 8px;
}

.ahlmall-mini-cart__row:last-child {
  margin-bottom: 0;
}

.ahlmall-mini-cart__row--total {
  font-weight: 800;
  color: #111827;
  font-size: 1rem;
}

.ahlmall-mini-cart__money {
  font-variant-numeric: tabular-nums;
}

.ahlmall-mini-cart__divider {
  height: 1px;
  background: #e5e7eb;
  margin: 10px 0;
}

.ahlmall-mini-cart__actions {
  padding: 0 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ahlmall-mini-cart__btn {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  border: none !important;
  text-decoration: none !important;
  line-height: 1.3 !important;
}

.ahlmall-mini-cart__btn--primary {
  background: #c9a24d !important;
  color: #fff !important;
}

.ahlmall-mini-cart__btn--primary:hover {
  background: #b8923f !important;
  color: #fff !important;
}

.ahlmall-mini-cart__btn--ghost {
  background: #fff !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
}

.ahlmall-mini-cart__btn--ghost:hover {
  background: #f9fafb !important;
  color: #111827 !important;
}

.ahlmall-mini-cart--empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.ahlmall-mini-cart__empty-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 24px 32px;
}

.ahlmall-mini-cart__empty-icon {
  color: #c9a24d;
  margin-bottom: 16px;
}

.ahlmall-mini-cart__empty-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
}

.ahlmall-mini-cart__empty-sub {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 0.95rem;
}

.ahlmall-mini-cart__btn--outline {
  background: transparent !important;
  color: #c9a24d !important;
  border: 2px solid #c9a24d !important;
  max-width: 280px;
}

.ahlmall-mini-cart__btn--outline:hover {
  background: #faf7ef !important;
  color: #111827 !important;
}
