.cart-wrapper {
  padding: 12px;
}

.cart-header {
  position: sticky;
  top: 0;
  z-index: 100;

  height: 64px;
  margin: -12px -12px 16px -12px; /* full width */
  padding: 0 16px 0 56px;

  display: flex;
  align-items: center;
  gap: 10px;

  background: var(--primary);
  color: #fff;

  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.cart-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .5px;
}

.back-btn {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

.cart-header .back-btn {
  margin-left: 8px;
}

.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cart-image img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
}

.cart-info {
  flex: 1;
  font-size: 14px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #f7f7f7;
}

.cart-remove {
  color: #dc3545;
  cursor: pointer;
  font-size: 18px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin: 14px 0;
}

.cart-loading,
.cart-empty {
  text-align: center;
  padding: 30px;
  color: #777;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #ccc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===============================
   FULL PAGE LOADER
================================ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===============================
   SPINNER RING (SMOOTH)
================================ */
.spinner-ring {
  width: 46px;
  height: 46px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinSmooth 0.9s ease-in-out infinite;
}

/* TEXT */
.loader-text {
  margin-top: 12px;
  font-size: 14px;
  color: #555;
}

/* ANIMATION */
@keyframes spinSmooth {
  to { transform: rotate(360deg); }
}

/* body cart harus relative */
.cart-body {
  position: relative;
  padding-bottom: 150px;
}

/* ===============================
   BODY LOADER (CONTENT ONLY)
================================ */
.body-loader {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(1px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* spinner */
.spinner-ring {
  width: 42px;
  height: 42px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
}


/* ===============================
   ACTION BAR
================================ */
.cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ===============================
   SELECTBOX STYLE
================================ */
.select-action {
  flex: 1;
  padding: 10px 36px 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background-color: #fff;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;

  /* hilangkan style bawaan browser */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* panah custom */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* hover */
.select-action:hover {
  background-color: #f0f6ff;
}

/* focus */
.select-action:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* disabled (kalau nanti dipakai) */
.select-action:disabled {
  background-color: #f1f1f1;
  border-color: #ccc;
  color: #888;
  cursor: not-allowed;
}

/* ===============================
   TOASTR CENTER
================================ */
.toast-center {
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}

/* KHUSUS shipment list */
.cart-item.shipment-row {
  align-items: flex-start;
}

/* tombol kanan ikut naik */
.cart-item.shipment-row > div:last-child {
  align-self: flex-start;
}

/* carousel */
.carousel-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #fff;
}

.carousel-track {
    display: flex;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
    text-align: center;
    margin-top: 10px;
}

.carousel-dots .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 4px;
    cursor: pointer;
}

.carousel-dots .dot.active {
    background: #000;
}


/* ===================== */
/* THUMBNAIL STYLE */
/* ===================== */

.carousel-thumbs {
  display: flex;
  justify-content: center; /* CENTER */
  gap: 8px;
  margin-top: 0;
  padding: 12px 16px 0;
  background: #fff;
  flex-wrap: wrap; /* kalau banyak thumbnail */
}

.thumb-item {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-item.active {
  border: 2px solid #000;
  transform: scale(1.05);
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(2px);
}

/* ===================== */
/* SLIDE INACTIVE EFFECT */
/* ===================== */

.detail-img.inactive {
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}
