*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Shared variables handled by global.css */
}

body {
  font-family: var(--font);
  background: #fafafa;
  color: var(--black);
  min-height: 100vh;
}

.profile-chip-wrapper {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
  z-index: 300;
  overflow: hidden;
  padding: 6px;
}

.profile-chip-wrapper:hover .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown a {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
  cursor: pointer;
  box-sizing: border-box;
}

.profile-dropdown-item:hover {
  background: var(--gray-100);
  color: var(--black);
}

.profile-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--gray-600);
  transition: color 0.15s;
}

.profile-dropdown-item:hover svg {
  color: var(--black);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 6px 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}

.checkout-header {
  margin-bottom: 32px;
}

.checkout-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

@media (max-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.customer-info {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-700);
}

.customer-info strong {
  color: var(--black);
}

/* Payment Accordions inline */
.payment-group {
  border-bottom: 1px solid var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
  transition: border-color 0.2s;
}

.payment-group-header {
  padding: 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  transition: background 0.2s;
}

.payment-group-header:hover {
  background: var(--gray-100);
}

.payment-group-header svg {
  transition: transform 0.3s;
}

.payment-group.active {
  border-color: var(--black);
}

.payment-group.active .payment-group-header svg {
  transform: rotate(180deg);
}

.payment-group-content {
  display: none;
  padding: 0 16px 16px;
  background: var(--white);
}

.payment-group.active .payment-group-content {
  display: block;
}

.bank-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bank-item {
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  transition: border-color 0.2s;
}

.bank-item:hover {
  border-color: var(--black);
}

.bank-item.selected {
  border-color: var(--black);
  background: var(--gray-100);
}


.bank-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.bank-logo {
  height: 20px;
  max-width: 60px;
  object-fit: contain;
}

/* Summary Block */
.summary-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  max-height: 400px;
  overflow-y: auto;
}

.summary-item {
  display: flex;
  gap: 12px;
}

.summary-item-img {
  width: 50px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--gray-100);
}

.summary-item-details {
  flex: 1;
  min-width: 0;
}

.summary-item-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.summary-item-price {
  font-size: 12px;
  color: var(--gray-600);
}

.voucher-section {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-100);
}

.voucher-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  outline: none;
}

.voucher-input:focus {
  border-color: var(--black);
}

.btn-apply-voucher {
  padding: 0 16px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
}

.btn-apply-voucher:hover {
  background: var(--gray-100);
  color: var(--black);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--gray-600);
}

.totals-row.discount-row {
  color: var(--green);
  display: none;
}

.totals-row.discount-row.show {
  display: flex;
}

.totals-row.grand-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.btn-checkout {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  text-align: center;
  cursor: pointer;
  margin-top: 24px;
  transition:
    background var(--transition),
    transform 0.1s ease;
}

.btn-checkout:hover {
  background: #333;
  transform: translateY(-1px);
}

.btn-checkout:disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  transform: none;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--black);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--red);
}

/* ══════════════════════════════════════════
   AUTH MODAL
══════════════════════════════════════════ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-overlay.open {
  opacity: 1;
  visibility: visible;
}

.auth-modal {
  background: var(--white);
  width: 400px;
  max-width: 90vw;
  border-radius: 12px;
  position: relative;
}

.auth-overlay.open .auth-modal {
  transform: translateY(0);
}

.auth-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.auth-close-btn:hover {
  color: var(--black);
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.auth-input::placeholder,
.voucher-input::placeholder {
  color: var(--gray-500);
}

.auth-input:focus {
  border-color: var(--black);
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  opacity: 0.9;
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}

.auth-switch a {
  color: var(--black);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Customer Info Card ── */
.customer-info-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--gray-100);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}

.customer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111 0%, #444 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.customer-info-details {
  flex: 1;
  min-width: 0;
}

.customer-info-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-info-name .verified-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

.customer-info-name .verified-icon svg {
  width: 10px;
  height: 10px;
  stroke: white;
  stroke-width: 3;
  fill: none;
}

.customer-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.customer-info-row svg {
  width: 14px;
  height: 14px;
  stroke: var(--gray-500);
  flex-shrink: 0;
}

/* ── Inline Auth Panel ── */
.auth-panel-inline {
  padding: 4px 0 0;
}

.auth-panel-inline .auth-header-illust {
  text-align: center;
  margin-bottom: 16px;
}

.auth-panel-inline .auth-header-illust .lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-100);
  margin-bottom: 10px;
}

.auth-panel-inline .auth-header-illust .lock-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--gray-500);
}

.auth-panel-inline .auth-header-illust h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-panel-inline .auth-header-illust p {
  font-size: 13px;
  color: var(--gray-500);
}

.auth-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.auth-input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-input-wrap .input-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--gray-500);
}

.auth-input-wrap .auth-input {
  padding-left: 38px;
}

/* ══════════════════════════════════════════
   UPSELL / RECOMMENDED PRODUCTS
══════════════════════════════════════════ */
.upsell-section {
  margin-top: 8px;
}

.upsell-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
}

.upsell-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #111 0%, #333 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  flex-shrink: 0;
}

.upsell-badge svg {
  width: 10px;
  height: 10px;
  fill: #facc15;
  stroke: none;
}

.upsell-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  flex: 1;
}

.upsell-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.upsell-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .upsell-grid {
    grid-template-columns: 1fr;
  }
}

/* Product card — identical to products page */
.upsell-section .product-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--black);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.upsell-section .product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  border-color: var(--gray-300);
}

.upsell-section .card-img-wrap {
  background: var(--gray-100);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.upsell-section .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.upsell-section .product-card:hover .card-img-wrap img {
  transform: scale(1.07);
}

.upsell-section .card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--gray-400);
}

.upsell-section .card-img-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.upsell-section .card-body {
  padding: 12px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upsell-section .card-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upsell-section .card-subtitle {
  font-size: 11.5px;
  color: var(--gray-500);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upsell-section .card-color {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.upsell-section .card-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 6px;
}

.upsell-section .card-price {
  font-size: 17px;
  font-weight: 700;
}

.upsell-section .card-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.upsell-section .btn-beli {
  flex: 1;
  padding: 7px 0;
  background: var(--black);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.upsell-section .btn-beli:hover {
  background: #333;
  transform: scale(1.02);
}

.upsell-section .btn-beli svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.upsell-section .btn-beli.in-cart {
  background: var(--gray-200);
  color: var(--gray-600);
  cursor: default;
  transform: none;
}

.upsell-section .btn-keranjang {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: var(--white);
  color: var(--black);
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.15s ease;
}

.upsell-section .btn-keranjang:hover {
  border-color: var(--black);
  background: var(--gray-100);
  transform: scale(1.06);
}

.upsell-section .btn-keranjang svg {
  width: 15px;
  height: 15px;
}

.upsell-skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.upsell-loading-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.upsell-skeleton-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}

.upsell-skeleton-img {
  aspect-ratio: 4 / 3;
}

.upsell-skeleton-body {
  padding: 12px;
}

.upsell-skeleton-line {
  height: 10px;
  margin-bottom: 8px;
  border-radius: 4px;
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 768px)
══════════════════════════════════════════ */
@media (max-width: 768px) {
  nav.navbar {
    padding: 0 16px;
    height: 52px;
  }

  .nav-logo {
    font-size: 18px;
  }

  .container {
    padding: 28px 20px;
  }

  .checkout-header h1 {
    font-size: 24px;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .checkout-right .panel {
    position: static !important;
  }

  .panel {
    padding: 20px 16px;
  }

  .upsell-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .upsell-loading-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .desktop-only {
    display: none;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 540px)
══════════════════════════════════════════ */
@media (max-width: 540px) {
  nav.navbar {
    padding: 0 12px;
    height: 50px;
  }

  .nav-logo {
    font-size: 17px;
  }

  .nav-profile-name {
    display: none;
  }

  .nav-profile-chip {
    padding: 3px;
  }

  .container {
    padding: 16px 12px;
  }

  .checkout-header {
    margin-bottom: 20px;
  }

  .checkout-header h1 {
    font-size: 22px;
  }

  .checkout-grid {
    gap: 16px;
  }

  .panel {
    padding: 16px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .panel-title {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  /* Customer Info */
  .customer-info-box {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 14px;
  }

  .customer-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .customer-info-name {
    justify-content: center;
    font-size: 14px;
  }

  .customer-info-row {
    justify-content: center;
    font-size: 12px;
  }

  /* Payment Methods */
  .payment-group-header {
    padding: 14px 12px;
    font-size: 13px;
  }

  .payment-group-content {
    padding: 0 12px 12px;
  }

  .bank-item {
    padding: 10px 12px;
    gap: 10px;
  }

  .bank-name {
    font-size: 13px;
  }

  .bank-logo {
    height: 18px;
    max-width: 50px;
  }

  /* Summary */
  .summary-item-name {
    font-size: 12px;
  }

  .summary-item-price {
    font-size: 11px;
  }

  .voucher-section {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .voucher-input {
    width: 100%;
  }

  .btn-apply-voucher {
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    justify-content: center;
  }

  .totals-row {
    font-size: 12px;
  }

  .totals-row.grand-total {
    font-size: 16px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .btn-checkout {
    padding: 12px;
    font-size: 13px;
    margin-top: 16px;
  }

  /* Auth Inline */
  .auth-panel-inline .auth-header-illust h3 {
    font-size: 15px;
  }

  .auth-panel-inline .auth-header-illust p {
    font-size: 12px;
  }

  /* Upsell */
  .upsell-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .upsell-loading-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .upsell-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .upsell-title {
    font-size: 14px;
  }

  .upsell-subtitle {
    font-size: 11px;
    margin-bottom: 12px;
  }

  .upsell-section .card-name {
    font-size: 13px;
  }

  .upsell-section .card-price {
    font-size: 15px;
  }

  .upsell-section .card-body {
    padding: 10px;
  }

  /* Auth Modal */
  .auth-modal {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .auth-title {
    font-size: 18px;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 380px)
══════════════════════════════════════════ */
@media (max-width: 380px) {
  .container {
    padding: 12px 8px;
  }

  .panel {
    padding: 14px 12px;
    border-radius: 8px;
  }

  .checkout-header h1 {
    font-size: 20px;
  }

  .bank-item {
    padding: 10px;
    gap: 8px;
  }

  .bank-name {
    font-size: 12px;
  }

  .totals-row.grand-total {
    font-size: 15px;
  }
}
