/* Mini-cart: modal + sticky badge + panel */

/* Modal */
.cart-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.cart-modal--open {
  opacity: 1;
  visibility: visible;
}
.cart-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 19, 21, .4);
}
.cart-modal__box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(16, 19, 21, .18);
  border: 1px solid rgba(16, 19, 21, .08);
  padding: 20px 22px;
}
.cart-modal__title {
  margin: 0 0 14px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text, #222222);
}
.cart-modal__product {
  margin: 0 0 6px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--text, #222222);
}
.cart-modal__length,
.cart-modal__price {
  margin: 0 0 6px 0;
  font-size: 14px;
  color: var(--muted, #4B5563);
}
.cart-modal__qty {
  margin: 14px 0 18px 0;
}
.cart-modal__qty label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #4B5563);
  margin-bottom: 6px;
}
.cart-modal__qty input {
  width: 100%;
  max-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(16,19,21,.12));
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}
.cart-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cart-modal__actions .btn { flex: 1; min-width: 100px; }

/* Sticky badge */
.cart-badge {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: linear-gradient(180deg, var(--brand, #1F5A3A), var(--brand-2, #18482E));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(31, 90, 58, .35);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cart-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(31, 90, 58, .4);
}

/* Panel */
.cart-panel {
  position: fixed;
  right: 16px;
  bottom: 60px;
  z-index: 89;
  width: 100%;
  max-width: 380px;
  max-height: 70vh;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(16, 19, 21, .2);
  border: 1px solid var(--border, rgba(16,19,21,.12));
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
.cart-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, rgba(16,19,21,.1));
  font-weight: 800;
  font-size: 16px;
}
.cart-panel__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--muted, #4B5563);
  cursor: pointer;
  border-radius: 12px;
}
.cart-panel__close:hover { background: rgba(16,19,21,.06); color: var(--text, #222222); }
.cart-panel__list {
  padding: 12px 18px;
  overflow: auto;
  flex: 1;
  min-height: 80px;
}
.cart-panel__empty {
  margin: 0;
  font-size: 14px;
  color: var(--muted, #4B5563);
}
.cart-panel__row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(16,19,21,.08);
}
.cart-panel__row:last-child { border-bottom: none; }
.cart-panel__row-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.cart-panel__row-meta {
  font-size: 13px;
  color: var(--muted, #4B5563);
  margin-bottom: 8px;
}
.cart-panel__row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-qty-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, rgba(16,19,21,.12));
  border-radius: 10px;
  background: #fff;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  color: var(--brand, #1F5A3A);
}
.cart-qty-btn:hover { background: rgba(31,90,58,.08); }
.cart-qty-val { min-width: 24px; text-align: center; font-weight: 700; font-size: 14px; }
.cart-remove-btn {
  width: 40px;
  height: 40px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(16,19,21,.06);
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  color: var(--muted, #4B5563);
  cursor: pointer;
}
.cart-remove-btn:hover { background: rgba(197,48,48,.12); color: #c53030; }
.cart-panel__footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border, rgba(16,19,21,.1));
}
.cart-panel__total-wrap {
  font-size: 14px;
  margin-bottom: 10px;
}
.cart-panel__total-wrap strong { font-size: 18px; color: var(--brand, #1F5A3A); }
.cart-panel-submit { width: 100%; }

@media (max-width: 720px) {
  .cart-badge {
    right: 12px;
    bottom: 12px;
    padding: 11px 16px;
    font-size: 14px;
  }
  .cart-panel {
    right: 12px;
    left: 12px;
    bottom: 60px;
    max-width: none;
    max-height: 65vh;
  }
  .cart-qty-btn{width:44px;height:44px}
  .cart-remove-btn{width:44px;height:44px}
  .cart-panel__close{width:44px;height:44px}
}
