/* ==========================================================================
   ARY Chase - Mini Cart
   Self-contained widget styles so they work on BOTH the shared site header
   and the isolated homepage header (which strips main.css).
   ========================================================================== */

html,
body {
  overflow-x: clip;
}

/* â”€â”€ Panel shell (position fixed via JS, right-aligned to the Cart icon) â”€â”€ */
.mini-cart {
  position: fixed;
  top: 64px;
  right: 14px;
  width: 380px;
  max-width: calc(100vw - 28px);
  max-height: 520px;
  background: #ffffff;
  color: #1c1d1f;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e3e6e8;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.99);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.mini-cart.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* â”€â”€ Header row â”€â”€ */
.mini-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #ebedef;
  flex-shrink: 0;
}

.mini-cart__title {
  font-size: 14px;
  font-weight: 600;
  color: #1c1d1f;
  line-height: 1.3;
}

.mini-cart__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #6f7377;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mini-cart__close:hover {
  background-color: #f0f1f2;
  color: #1c1d1f;
}

/* â”€â”€ Scrollable body â”€â”€ */
.mini-cart__inner {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* â”€â”€ Cart items list â”€â”€ */
.mini-cart__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.mini-cart__item {
  display: flex;
  gap: 10px;
  padding: 12px 30px 12px 16px;
  border-bottom: 1px solid #f1f2f3;
  position: relative;
  align-items: center;
}

.mini-cart__remove {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 5px;
  margin: auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f4f5f6;
  color: #6f7377;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mini-cart__remove:hover {
  background-color: #fce4e4;
  color: #c0392b;
}

.mini-cart__thumb {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 6px;
}

.mini-cart__thumb-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid #e8eaec;
  border-radius: 4px;
  background: #ffffff;
  padding: 2px;
  display: block;
}

.mini-cart__meta {
  flex: 1;
  min-width: 0;
  padding-right: 20px;
}

.mini-cart__name {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: #1c1d1f;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.mini-cart__name:hover {
  color: #15408a;
  text-decoration: underline;
}

/* Variation / options */
.mini-cart__variation {
  margin-top: 2px;
  font-size: 11px;
  color: #6f7377;
  line-height: 1.4;
}

.mini-cart__variation p,
.mini-cart__variation dl,
.mini-cart__variation dt,
.mini-cart__variation dd {
  margin: 0;
  display: inline;
}

.mini-cart__variation dt {
  font-weight: 600;
}

.mini-cart__variation dd {
  margin-right: 6px;
}

/* Quantity stepper */
.mini-cart__stepper {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  border: 1px solid #d5d9d9;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.mini-cart__stepper-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #1c1d1f;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mini-cart__stepper-btn:hover {
  background-color: #f0f1f2;
}

.mini-cart__stepper-btn.mini-cart__is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.mini-cart__stepper-qty {
  min-width: 30px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #1c1d1f;
  border-left: 1px solid #e8eaec;
  border-right: 1px solid #e8eaec;
  padding: 0 4px;
  height: 26px;
  line-height: 26px;
}

.mini-cart__line-total {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1c1d1f;
  white-space: nowrap;
}

/* â”€â”€ Footer: subtotal + actions â”€â”€ */
.mini-cart__footer {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid #ebedef;
  background: #fafbfb;
  border-radius: 0 0 8px 8px;
}

.mini-cart__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mini-cart__subtotal-label {
  font-size: 13px;
  color: #6f7377;
}

.mini-cart__subtotal-value {
  font-size: 16px;
  font-weight: 700;
  color: #1c1d1f;
}

.mini-cart__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-cart__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mini-cart__btn--primary {
    background: #f7a800;
    border: 1px solid #f7a800;
    color: #0b2450;
}

.mini-cart__btn--primary:hover {
  background: #e69a00;
  border-color: #e69a00;
  color: #fff;
}

.mini-cart__btn--outline {
  background: #ffffff;
  border: 1px solid #15408a;
  color: #15408a;
}

.mini-cart__btn--outline:hover {
  background: #15408a;
  color: #ffffff;
}

/* â”€â”€ Empty state â”€â”€ */
.mini-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  gap: 6px;
}

.mini-cart__empty-icon {
  color: #d5d9d9;
  margin-bottom: 8px;
}

.mini-cart__empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #1c1d1f;
  margin: 0;
}

.mini-cart__empty-text {
  font-size: 13px;
  color: #6f7377;
  margin: 0 0 14px;
  max-width: 240px;
}

.mini-cart__empty .mini-cart__btn {
  max-width: 220px;
}

/* â”€â”€ Count bump animation â”€â”€ */
.header__cart-count,
.hp-cart__count {
  transition: transform 0.2s ease;
}

.mini-cart__bump {
  transform: scale(1.25);
}

/* â”€â”€ Dark theme (shared header only) â”€â”€ */
body.dark-theme .mini-cart {
  background: #23262b;
  border-color: #3a3f46;
  color: #e8eaec;
}

body.dark-theme .mini-cart__head,
body.dark-theme .mini-cart__footer {
  border-color: #3a3f46;
}

body.dark-theme .mini-cart__footer {
  background: #1d2024;
}

body.dark-theme .mini-cart__title,
body.dark-theme .mini-cart__name,
body.dark-theme .mini-cart__line-total,
body.dark-theme .mini-cart__subtotal-value,
body.dark-theme .mini-cart__empty-title,
body.dark-theme .mini-cart__stepper-qty {
  color: #e8eaec;
}

body.dark-theme .mini-cart__item {
  border-bottom-color: #2f343a;
}

body.dark-theme .mini-cart__variation,
body.dark-theme .mini-cart__subtotal-label,
body.dark-theme .mini-cart__empty-text {
  color: #9aa2ab;
}

body.dark-theme .mini-cart__thumb-img {
  border-color: #3a3f46;
  background: #23262b;
}

body.dark-theme .mini-cart__stepper-btn:hover {
  background-color: #2f343a;
  color: #e8eaec;
}

body.dark-theme .mini-cart__btn--outline {
  background: transparent;
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 768px) {
  .mini-cart {
    width: 360px;
  }
}

@media (max-width: 576px) {
  .mini-cart {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 12px);
    border-radius: 10px;
  }

  .mini-cart__item {
    gap: 8px;
    padding: 12px 14px;
  }

  .mini-cart__thumb-img {
    width: 56px;
    height: 56px;
  }

  .mini-cart__head {
    padding: 12px 14px;
  }

  .mini-cart__footer {
    padding: 10px 14px 12px;
  }
}