body.nav-lock { overflow: hidden; }

.flash-wrap {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  animation: toastIn 0.25s ease;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-has-thumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
}

.toast-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
  background: var(--input-bg);
}

.toast-text {
  line-height: 1.4;
}

.toast.success { border-color: rgba(22, 163, 74, 0.25); background: #ecfdf5; color: #047857; }
.toast.error { border-color: rgba(220, 38, 38, 0.25); background: #fef2f2; color: #b91c1c; }
.toast.warning { border-color: rgba(217, 119, 6, 0.25); background: #fffbeb; color: #b45309; }
.toast.info { border-color: rgba(37, 99, 235, 0.25); background: var(--accent-050); color: var(--accent-600); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.toast-center-wrap {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}

.toast-center {
  pointer-events: auto;
  animation: toastCenterIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg);
}

@keyframes toastCenterIn {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-scrim.show { opacity: 1; pointer-events: auto; }

/* ============ Cart drawer (slide-out) ============ */
.cart-drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cart-drawer-scrim.show { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px -30px rgba(15, 23, 42, 0.55);
  z-index: 601;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--ink);
}

.cart-drawer.show { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.cart-drawer-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-drawer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.cart-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface-2, var(--surface));
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.15s;
}

.cart-drawer-close:hover { color: var(--ink); border-color: var(--line); }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-drawer-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2, var(--surface));
}

.cart-drawer-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line-2);
  flex-shrink: 0;
  background: var(--page-bg);
}

.cart-drawer-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.cart-drawer-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-drawer-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-drawer-item-tags {
  font-size: 11.5px;
  color: var(--ink-3);
}

.cart-drawer-qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
  background: var(--surface);
}

.cart-drawer-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.12s;
}

.cart-drawer-qty-btn:hover { background: var(--accent-050); color: var(--accent); }

.cart-drawer-qty-val {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.cart-drawer-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
}

.cart-drawer-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.cart-drawer-item-old {
  font-size: 11px;
  color: var(--price-old);
  text-decoration: line-through;
}

.cart-drawer-item-del {
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: 0.15s;
}

.cart-drawer-item-del:hover { color: var(--fail, #ef4444); background: color-mix(in srgb, var(--fail, #ef4444) 12%, transparent); }

/* Empty state */
.cart-drawer-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--ink-3);
}

.cart-drawer-empty-ic { color: var(--line); }

.cart-drawer-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-2);
}

.cart-drawer-empty-desc { font-size: 13px; }

.cart-drawer-empty-btn {
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.cart-drawer-empty-btn:hover { border-color: var(--accent); color: var(--accent); }

.cart-drawer-foot[hidden] {
  display: none !important;
}

.cart-drawer-sum-row.is-save[hidden] {
  display: none !important;
}

/* Footer */
.cart-drawer-foot {
  flex-shrink: 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-drawer-coupon {
  display: flex;
  gap: 8px;
}

.cart-drawer-coupon-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--input-bg, #101622);
  color: var(--ink);
  font-size: 13px;
}

.cart-drawer-coupon-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-050);
}

.cart-drawer-coupon-btn {
  padding: 0 16px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface-2, var(--surface));
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}

.cart-drawer-coupon-btn:hover { border-color: var(--accent); color: var(--accent); }

.cart-drawer-sum {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-drawer-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
}

.cart-drawer-sum-row.is-save { color: #16a34a; font-weight: 700; }

.cart-drawer-sum-row.is-total {
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-2);
}

.cart-drawer-sum-row.is-total strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.cart-drawer-badges {
  display: flex;
  gap: 8px;
}

.cart-drawer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2, var(--surface));
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.cart-drawer-badge svg { color: var(--accent); }

.cart-drawer-min {
  margin: 0;
  font-size: 12px;
  color: #ef4444;
  text-align: center;
}

.cart-drawer-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-600, var(--accent)));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 85%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-drawer-checkout:hover { transform: translateY(-1px); }

.cart-drawer-checkout.is-disabled {
  opacity: 0.5;
  pointer-events: auto;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.cart-drawer-note {
  margin: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
}

@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 20px;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #FF2BD6 0%, #A855F7 28%, #3B9CFF 55%, #38D878 80%, #FFD23F 100%) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: modal-border-flow 5s ease infinite;
  box-shadow:
    var(--shadow-lg),
    0 0 22px -2px rgba(255, 43, 214, 0.35),
    0 22px 70px -18px rgba(59, 156, 255, 0.5);
  z-index: 501;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--ink);
}

@keyframes modal-border-flow {
  0% { background-position: 0% 0%, 0% 50%; }
  50% { background-position: 0% 0%, 100% 50%; }
  100% { background-position: 0% 0%, 0% 50%; }
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .modal { animation: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface-2, var(--surface));
  color: var(--ink-2);
  display: grid;
  place-items: center;
}

.modal-body { padding: 20px 22px; }
.modal-foot {
  padding: 12px 22px 22px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Quantity selection modal */
.qty-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qty-modal-product {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2, var(--surface));
}

.qty-modal-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line-2);
  flex-shrink: 0;
}

.qty-modal-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  background: var(--surface);
}

.qty-modal-info { min-width: 0; }

.qty-modal-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.qty-modal-unit {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qty-modal-bundle {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}

.qty-modal-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.qty-modal-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.qty-modal-step {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface-2, var(--surface));
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.15s;
  user-select: none;
}

.qty-modal-step:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.qty-modal-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-modal-input {
  width: 96px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--input-bg, #101622);
  color: var(--ink);
  -moz-appearance: textfield;
}

.qty-modal-input::-webkit-outer-spin-button,
.qty-modal-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-050);
}

.qty-modal-max {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

.qty-modal-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent-050);
  border: 1px solid var(--accent-050);
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 700;
}

.qty-modal-total strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.qty-modal-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

@media (max-width: 520px) {
  .modal-foot [data-qm-cancel],
  .modal-foot [data-qm-confirm] {
    flex: 1;
  }
  .qty-modal-step { width: 48px; height: 48px; }
  .qty-modal-input { width: 84px; height: 48px; }
}

.skeleton {
  background: linear-gradient(90deg, #1a2232 25%, #232d40 50%, #1a2232 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 12px;
}

.skeleton-card { height: 280px; }
.skeleton-line { height: 14px; margin-bottom: 10px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.form-card {
  max-width: 440px;
  margin: 48px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.form-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-card p.lead {
  color: var(--ink-3);
  margin-bottom: 24px;
  font-size: 15px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink-2);
}

.form-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  background: var(--input-bg, #101622);
  color: var(--ink);
  transition: 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-050);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border: none;
  transition: 0.15s;
}

.btn-primary:hover { background: var(--accent-600); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 700;
  border: 1px solid var(--line-2);
}

.btn-danger {
  background: var(--fail);
  color: #fff;
  border-color: transparent;
}

.form-link {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

.form-link a { color: var(--accent); font-weight: 700; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 700;
  color: var(--ink-2);
}

.page-btn.active,
.page-btn:hover {
  background: var(--accent-050);
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 900px) {
  .hdr-nav-desktop { display: none; }
  .hdr-menu-btn { display: grid; }
}

@media (min-width: 901px) {
  .hdr-menu-btn { display: none; }
  .hdr-nav-drawer,
  .hdr-nav-scrim { display: none; }
}
