/* Index page specific styles */

:root {
  --bg0: #0b1020;
  --bg1: #0a1226;
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.66);
  --primary: #7c3aed;
  --primary2: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
  --shadow2: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --ring: 0 0 0 4px rgba(124, 58, 237, 0.22);
  --ring2: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

body {
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(124, 58, 237, 0.35), transparent 55%),
    radial-gradient(1000px 600px at 90% 15%, rgba(79, 70, 229, 0.30), transparent 55%),
    radial-gradient(900px 600px at 60% 90%, rgba(16, 185, 129, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  min-height: 100vh;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

html {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Top bar user info - small bar at top */
.topbar-user {
  padding: 6px 0;
  margin-bottom: 12px;
}

.topbar-user-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-user-left {
  flex: 1;
}

.topbar-user-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user .user-pill {
  font-size: 11px;
  padding: 4px 8px;
}

.topbar-user .btn-small {
  font-size: 11px;
  padding: 4px 10px;
}

/* Sentinel for sticky detection (inserted by JS before .topbar) */
.topbar-sentinel {
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Main topbar - Brand + Search + Actions */
.topbar {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
  border-radius: 0;
  background: linear-gradient(180deg, #0e1630, #0b1224);
  border-bottom: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 20px;
  transition: box-shadow 0.25s ease;
}

.topbar.topbar-stuck {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  flex-shrink: 0;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25);
  font-size: 20px;
}

.brand h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

/* Search container */
.search-container {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 700px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  transition: all 0.2s;
}

.search-container:focus-within {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 20px;
  font-size: 16px;
  color: var(--text);
}

.search-input:focus {
  outline: none;
  box-shadow: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-icon-btn {
  background: var(--primary);
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 20px;
  color: white;
  min-width: 56px;
}

.search-icon-btn:hover {
  background: var(--primary2);
}

.search-icon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Topbar actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 20px;
  padding: 0;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.card {
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  padding: 24px;
  overflow: hidden;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.card-title h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.input {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10, 18, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  outline: none;
  transition: 0.18s;
  box-sizing: border-box;
  font-size: 15px;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.input:focus {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: var(--ring);
  outline: none;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row > * {
  flex: 1;
}

.btn {
  border: 0;
  outline: none;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.18s;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 18px 40px rgba(16, 185, 129, 0.18);
}

.btn-success:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:disabled:hover {
  filter: none;
  transform: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Large spinner for loading states */
.loading-spinner .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.alert {
  display: none;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.alert.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.alert.success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  left: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

@media (max-width: 680px) {
  .toast-container {
    top: 70px;
    right: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
  }

  .toast {
    min-width: auto;
    max-width: 100%;
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
  }
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.15));
  color: rgba(255, 255, 255, 0.95);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.15));
  color: rgba(255, 255, 255, 0.95);
}

.toast.fade-out {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  width: fit-content;
  margin: 14px 0 0;
}

.tab {
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: 0.18s;
}

.tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.main-content {
  display: none;
}

.main-content.active {
  display: block;
}

.auction-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.kpi {
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.kpi .k {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.kpi .v {
  font-size: 20px;
  font-weight: 800;
}

.kpi .v.price {
  font-size: 24px;
  color: #ff4d6d;
}

.images {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.images img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: 0.18s;
}

.images img:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.detail {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.detail .k {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.detail .v {
  margin-top: 6px;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.90);
  word-break: break-word;
}

.status-box {
  margin-top: 20px;
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.status-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 800;
}

.hint {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  display: none;
}

.hint.warning {
  color: rgba(245, 158, 11, 0.95);
}

.hint.info {
  color: rgba(56, 189, 248, 0.95);
}

.desc {
  margin-top: 16px;
  border-radius: 14px;
  padding: 16px;
  background: rgba(10, 18, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.84);
  font-size: 15px;
  line-height: 1.65;
}

.bid-sticky {
  position: sticky;
  top: 92px;
  z-index: 20;
}

#bidWrap {
  position: relative;
}

.bid-sticky.is-fixed {
  position: fixed !important;
  top: 92px;
  z-index: 999;
}

.bid {
  border-radius: 16px;
  padding: 14px;
  background:
    radial-gradient(600px 200px at 15% 20%, rgba(16, 185, 129, 0.22), transparent 55%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.bid-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bid-top h4 {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.bid-top .min {
  font-size: 12px;
  color: var(--muted);
}

.bid-top .min strong {
  color: #ff4d6d;
  font-size: 14px;
}

.bid-form {
  display: flex;
  gap: 10px;
}

.bid .input:focus {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: var(--ring2);
}

.requests {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.requests.scroll {
  max-height: 520px;
  overflow: auto;
  padding-right: 6px;
}

.requests.scroll::-webkit-scrollbar {
  width: 8px;
}

.requests.scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.requests.scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.requests.scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.req {
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  transition: 0.18s;
}

.req:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.req h4 {
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.4;
}

.req p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

.req .url {
  color: rgba(124, 58, 237, 0.95);
  word-break: break-all;
}

.status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
}

.status.pending {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.status.in_progress {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
}

.status.completed {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.status.failed {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.auth-wrap {
  max-width: 460px;
  margin: 46px auto 0;
}

.auth-head {
  text-align: center;
  margin-bottom: 20px;
}

.auth-head h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.auth-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Mobile Responsive Styles */
@media (max-width: 980px) {

  .grid {
    grid-template-columns: 1fr;
  }

  .auction-detail-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    display: grid;
  }

  .auction-images-section {
    order: 1;
    width: 100%;
  }

  .auction-info-section {
    order: 2;
    position: relative;
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto;
  }

  .auction-info-sticky {
    position: static;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .brand {
    min-width: 0;
  }

  .brand h1 {
    font-size: 20px;
  }

  .topbar {
    position: sticky;
    top: 0;
    margin-bottom: 16px;
    z-index: 100;
  }

  .topbar.topbar-stuck {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }

  .topbar-content {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px;
    align-items: center;
  }

  .brand {
    flex: 1;
    min-width: 0;
  }

  .topbar-actions {
    order: 2;
    flex-shrink: 0;
  }

  .search-container {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
    flex: 1 1 100%;
  }

  .bid-sticky {
    position: static;
  }

  .countdown-timer {
    font-size: 18px;
  }

  .current-price-display {
    font-size: 24px;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .auction-main-section {
    padding: 16px;
    margin-top: 16px;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .auction-detail-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px;
    width: 100%;
  }

  .quick-details-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .main-tabs-wrapper {
    margin: 16px -12px 16px -12px;
  }

  .main-tabs {
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding: 0 12px;
  }

  .main-tabs::-webkit-scrollbar {
    display: none;
  }

  .main-tabs-scroll-indicator.left {
    left: 12px;
    width: 28px;
  }

  .main-tabs-scroll-indicator.right {
    right: 12px;
    width: 28px;
  }

  .main-tabs-scroll-indicator.left::after {
    left: 8px;
  }

  .main-tabs-scroll-indicator.right::after {
    right: 8px;
  }

  .main-tab {
    padding: 12px 20px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
  }

  .main-tab:first-child {
    margin-left: 0;
  }

  .main-tab:last-child {
    margin-right: 0;
  }
}

@media (max-width: 680px) {

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 0;
  }

  .topbar-content {
    padding: 0 12px;
    gap: 8px;
  }

  .topbar-user-content {
    padding: 0 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand h1 {
    font-size: 18px;
    line-height: 1.2;
  }

  .logo {
    width: 36px;
    height: 36px;
    font-size: 18px;
    flex-shrink: 0;
  }

  .action-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 20px;
    flex-shrink: 0;
  }

  .search-container {
    margin-top: 8px;
    border-radius: 20px;
  }

  .search-input {
    padding: 12px 18px;
    font-size: 15px;
    min-height: 44px;
  }

  .search-icon-btn {
    padding: 12px 24px;
    min-width: 56px;
    border-radius: 0 20px 20px 0;
  }

  .auction-product-title {
    font-size: 16px;
  }

  .countdown-timer {
    font-size: 16px;
    letter-spacing: 0.5px;
  }

  .current-price-display {
    font-size: 20px;
  }

  .price-yen {
    font-size: 12px;
  }

  .quick-details-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-detail-item {
    flex-direction: row;
    justify-content: space-between;
    padding: 8px;
  }

  .details-grid {
    gap: 16px;
  }

  .auction-details-section {
    padding: 16px;
  }

  .section-title {
    font-size: 16px;
  }

  .product-description {
    padding: 16px;
    font-size: 14px;
  }

  .card {
    padding: 16px;
  }

  .card-title h2 {
    font-size: 18px;
  }

  /* Convert tables to card layout on mobile */
  .items-table-wrapper {
    overflow-x: visible;
  }

  .items-table {
    display: block;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }

  .items-table thead {
    display: none;
  }

  .items-table tbody {
    display: block;
  }

  .items-table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .items-table tbody tr:active {
    transform: scale(0.98);
  }

  .items-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .items-table td {
    display: block;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    position: relative;
    padding-left: 0;
    padding-right: 0;
  }

  .items-table td:last-child {
    border-bottom: none;
    padding-top: 12px;
    margin-top: 8px;
  }

  .items-table td:before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    line-height: 1.4;
  }

  .items-table td:last-child:before {
    display: none;
  }

  /* Image column special handling */
  .items-table td[data-label="Ảnh"] {
    text-align: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .items-table td[data-label="Ảnh"]:before {
    text-align: center;
  }

  .items-table td img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    display: inline-block;
    margin: 0 auto;
    border: 2px solid var(--stroke);
  }

  /* Product name column */
  .items-table td[data-label="Tên sản phẩm"] {
    font-weight: 600;
    line-height: 1.5;
  }

  .items-table td[data-label="Tên sản phẩm"]:before {
    margin-bottom: 8px;
  }

  /* Price column */
  .items-table td[data-label="Giá đấu"] {
    font-size: 15px;
    font-weight: 700;
    color: #ff4d6d;
  }

  /* Action buttons */
  .items-table td:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    margin-top: 8px;
  }

  .items-table td:last-child > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .items-table .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    min-height: 44px;
    font-weight: 600;
    border-radius: 8px;
  }

  /* Hide empty cells */
  .items-table td:empty {
    display: none;
  }

  /* Status badge */
  .items-table td[data-label="Trạng thái"] .pill,
  .items-table td[data-label="Trạng thái"] .status {
    display: inline-block;
    margin-top: 4px;
  }

}

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

  .bid-form {
    flex-direction: column;
  }

  .items-table {
    font-size: 12px;
  }

  .items-table td {
    padding: 6px 0;
    font-size: 12px;
  }

  .items-table td:before {
    font-size: 10px;
    min-width: 80px;
  }

  .main-tab {
    padding: 10px 16px;
    font-size: 13px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .btn-sm {
    padding: 8px 12px;
    font-size: 12px;
  }

  .input {
    padding: 12px 14px;
    font-size: 14px;
  }

  .modal {
    padding: 20px 12px;
    align-items: center;
    justify-content: center;
  }

  .modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    margin: 0 auto;
    border-radius: 20px;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
  }

  .modal-bid {
    max-width: 420px;
  }

  @keyframes modalFadeIn {
    from {
      opacity: 0;
      transform: scale(0.95) translateY(-10px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .modal-header {
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
    border-bottom: 1px solid var(--stroke);
  }

  .modal-header h3 {
    font-size: 18px;
    font-weight: 700;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
    min-height: 44px;
  }

  .modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
  }

  .modal-countdown-section {
    padding: 16px;
    margin-bottom: 20px;
  }

  .modal-countdown-timer {
    font-size: 16px;
  }

  .modal-price-section {
    padding-bottom: 16px;
    margin-bottom: 20px;
  }

  .modal-price-value {
    font-size: 22px;
  }

  .modal-bid-input-section {
    margin-bottom: 20px;
  }

  .modal-bid-label {
    font-size: 14px;
    margin-bottom: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .modal-bid-hint {
    font-size: 12px;
    width: 100%;
  }

  .modal-bid-input {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
    width: 100%;
  }

  .btn-modal-bid {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    min-height: 48px;
    font-weight: 700;
  }

  /* Improve touch targets */
  .btn, .action-btn, .main-tab {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(124, 58, 237, 0.2);
  }

  .action-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 20px;
  }

  .input, .search-input {
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
  }

  /* Prevent zoom on input focus on iOS */
  @supports (-webkit-touch-callout: none) {
    .input, .search-input, .bid-input-large, .modal-bid-input {
      font-size: 16px;
    }
  }

  /* History page improvements */
  .requests {
    gap: 12px;
  }

  .req {
    padding: 16px;
    border-radius: 12px;
  }

  .req h4 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .req p {
    font-size: 13px;
    margin-top: 8px;
  }

  .auth-wrap {
    padding: 0 12px;
    margin-top: 30px;
  }

  .card {
    padding: 16px;
  }

  .auction-main-section {
    padding: 12px;
  }

  .main-image-container {
    border-radius: 12px;
  }

  .image-thumbnails {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }

  .image-thumbnails::-webkit-scrollbar {
    height: 4px;
  }

  .thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }

  .auction-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .follow-btn-large {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 12px;
  }

  .bidding-box {
    padding: 16px;
    border-radius: 12px;
  }

  .bidding-box-content {
    gap: 14px;
  }

  .next-bid-info {
    padding: 10px;
    font-size: 12px;
  }

  .bid-input-large {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
    border-radius: 10px;
  }

  .btn-bid-large {
    padding: 16px;
    font-size: 16px;
    min-height: 48px;
    border-radius: 10px;
    font-weight: 700;
  }

  .countdown-section {
    padding: 14px;
    border-radius: 12px;
  }

  .current-price-section {
    padding: 14px;
    border-radius: 12px;
  }

  .outbid-alert {
    padding: 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  .topbar-user {
    padding: 10px 0;
    margin-bottom: 10px;
  }

  .topbar-user-content {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .topbar-user-left {
    display: none;
  }

  .topbar-user-right {
    width: 100%;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .topbar-user .user-pill {
    font-size: 12px;
    padding: 10px 14px;
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .topbar-user .btn-small {
    font-size: 14px;
    padding: 12px;
    width: 100%;
    min-height: 44px;
  }

  /* Pagination improvements for mobile */
  #followedPagination,
  #biddingPagination {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin-top: 16px;
  }

  #followedPagination > div,
  #biddingPagination > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  /* Info row */
  #followedPagination > div > div:first-child,
  #biddingPagination > div > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    width: 100%;
  }

  /* Center pagination buttons */
  #followedPagination > div > div:nth-child(2),
  #biddingPagination > div > div:nth-child(2) {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    position: static !important;
    transform: none !important;
    width: 100%;
  }

  /* Right controls */
  #followedPagination > div > div:last-child,
  #biddingPagination > div > div:last-child {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: 0 !important;
    width: 100%;
    font-size: 13px;
  }

  #followedPagination button,
  #biddingPagination button {
    min-height: 40px;
    min-width: 40px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    flex-shrink: 0;
  }

  #followedPagination select,
  #biddingPagination select {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px;
    border-radius: 8px;
  }

  /* Hide long text on very small screens */
  @media (max-width: 400px) {
    #followedPagination > div > div:first-child,
    #biddingPagination > div > div:first-child {
      font-size: 12px;
    }

    #followedPagination > div > div:first-child > div:first-child,
    #biddingPagination > div > div:first-child > div:first-child {
      display: none;
    }
  }

  /* Search input improvements */
  #followedSearchInput,
  #biddingSearchInput {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    font-size: 15px;
    padding: 12px 16px;
  }

  /* Card improvements */
  .card-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .card-title .subtle {
    font-size: 13px;
    margin-top: 4px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .topbar {
    padding: 10px 0;
  }

  .topbar-content {
    padding: 0 8px;
    gap: 6px;
  }

  .topbar-user-content {
    padding: 0 8px;
  }

  .brand {
    gap: 6px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .logo {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .action-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 20px;
  }

  .main-tabs {
    margin: 12px -8px 12px -8px;
    padding: 0 8px;
  }

  .main-tab {
    padding: 10px 16px;
    font-size: 13px;
  }

  .search-input {
    padding: 11px 16px;
    font-size: 15px;
  }

  .countdown-timer {
    font-size: 14px;
    letter-spacing: 0.3px;
  }

  .current-price-display {
    font-size: 18px;
  }

  .price-yen {
    font-size: 11px;
  }

  .auction-product-title {
    font-size: 15px;
  }

  .items-table tbody tr {
    padding: 16px;
    margin-bottom: 14px;
  }

  .items-table td {
    font-size: 14px;
    padding: 10px 0;
    line-height: 1.5;
  }

  .items-table td:before {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .items-table img {
    width: 100px;
    height: 100px;
  }

  .items-table .btn {
    font-size: 14px;
    padding: 12px;
    min-height: 44px;
  }

  /* Better text wrapping */
  .items-table td[data-label="Tên sản phẩm"],
  .items-table td[data-label="Mã sản phẩm"] {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Price display */
  .items-table td[data-label="Giá đấu"] {
    font-weight: 700;
    color: #ff4d6d;
    font-size: 15px;
  }

  /* Time display */
  .items-table td[data-label="Kết thúc"],
  .items-table td[data-label="Số lần đấu/Lần đấu cuối"] {
    font-size: 13px;
  }

  .items-table td small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
  }

  .card {
    padding: 12px;
  }

  .card-title h2 {
    font-size: 16px;
  }

  .card-title .subtle {
    font-size: 12px;
  }

  .modal-header h3 {
    font-size: 17px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-countdown-section {
    padding: 14px;
  }

  .modal-countdown-timer {
    font-size: 15px;
  }

  .modal-price-value {
    font-size: 20px;
  }

  .modal-bid-input {
    padding: 13px 15px;
    font-size: 16px;
  }

  .btn-modal-bid {
    padding: 15px;
    font-size: 15px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 680px) and (orientation: landscape) {
  .modal {
    padding: 10px;
  }

  .modal-content {
    max-height: 95vh;
    border-radius: 16px;
    position: relative;
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
  }

  .modal-bid {
    max-width: 500px;
  }

  .modal-body {
    max-height: calc(95vh - 70px);
  }

  .topbar {
    padding: 12px 0;
  }

  .topbar-content {
    gap: 10px;
  }

  .search-container {
    margin-top: 6px;
  }
}

/* Improve scrolling on mobile */
@media (max-width: 680px) {
  * {
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  html, body {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
    position: relative;
  }

  .app {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .main-content {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
  }

  /* Ensure all containers don't overflow */
  .card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .topbar-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .topbar-user-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Better spacing for cards */
  .card {
    margin-bottom: 16px;
  }

  /* Improve empty states */
  .subtle {
    font-size: 13px;
    line-height: 1.6;
    padding: 20px 16px;
  }

  /* Better image thumbnails */
  .image-thumbnails {
    padding-bottom: 8px;
  }

  .thumbnail {
    width: 70px;
    height: 70px;
  }

  /* Improve auth section */
  .auth-wrap {
    padding: 0 16px;
    margin-top: 40px;
  }

  .auth-head h2 {
    font-size: 20px;
  }

  .auth-head p {
    font-size: 14px;
  }

  /* Better form spacing */
  .field {
    margin-bottom: 16px;
  }

  .label {
    font-size: 13px;
    margin-bottom: 6px;
  }
}

/* Error reason display */
.error-reason {
  margin-top: 8px !important;
  color: rgba(239, 68, 68, 0.9) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  word-break: break-word;
}

/* Auction Detail Page - E-commerce Layout */
.auction-main-section {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
  border: 1px solid var(--stroke);
}

.auction-detail-grid {
  display: grid;
  grid-template-columns: 500px 1fr;
  gap: 32px;
  align-items: start;
}

.auction-details-full {
  margin-top: 32px;
}

.auction-images-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-image-container {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s;
}

.main-image:hover {
  transform: scale(1.02);
}

.image-thumbnails {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.04);
}

.thumbnail:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.thumbnail.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

.auction-info-section {
  position: relative;
  width: 100%;
  display: block;
  visibility: visible;
  opacity: 1;
}

.auction-info-sticky {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.auction-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auction-product-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  flex: 1;
}

.follow-btn-large {
  padding: 10px 20px;
  font-size: 16px;
  flex-shrink: 0;
}

.countdown-section {
  padding: 10px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 10px;
  text-align: center;
}

.countdown-timer {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 6px;
}

.bidding-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.outbid-alert {
  padding: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
}

.current-price-section {
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 10px;
}

.shipping-fee-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.shipping-fee-label {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.shipping-fee-label span {
  font-style: italic;
}

.shipping-payment-method {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
}

.price-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.current-price-display {
  font-size: 20px;
  font-weight: 700;
  color: #ff4d6d;
  line-height: 1.2;
}

.price-yen {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
}

.bidding-box {
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.bidding-box-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.next-bid-info {
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
}

.next-bid-info strong {
  color: #ff4d6d;
  font-size: 13px;
  margin-left: 4px;
}

.bid-form-large {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.bid-input-large {
  padding: 10px;
  font-size: 14px;
  border-radius: 8px;
}

.btn-bid-large {
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auction-details-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.quick-details-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 10px;
}

.quick-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.quick-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

.quick-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.description-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  margin-top: 8px;
  padding: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--stroke);
}

.product-description {
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  white-space: pre-wrap;
  max-height: 500px;
  overflow-y: auto;
}

.auction-placeholder {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 400px;
  padding: 40px 20px;
}

.placeholder-content {
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
}

.featured-categories-container {
  text-align: left;
  width: 100%;
  margin-top: 8px;
}

.featured-categories-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
}

.featured-category-section {
  margin-bottom: 36px;
}

.featured-category-section:last-child {
  margin-bottom: 0;
}

.featured-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.featured-category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.featured-category-more {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.featured-category-more:hover {
  color: var(--primary);
  text-decoration: underline;
}

.featured-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 680px) {
  .auction-placeholder {
    min-height: 300px;
    padding: 30px 16px;
  }

  .placeholder-content {
    font-size: 16px;
  }

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

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-bid {
  max-width: 480px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px;
}

/* Modal Bid Styles */
.modal-countdown-section {
  text-align: center;
  padding: 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 12px;
  margin-bottom: 20px;
}

.modal-countdown-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.modal-countdown-timer {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 1.5px;
  color: var(--primary);
}

.modal-price-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stroke);
}

.modal-price-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-price-value {
  font-size: 22px;
  font-weight: 700;
  color: #ff4d6d;
}

.modal-bid-input-section {
  margin-bottom: 20px;
}

.modal-bid-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-bid-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.modal-bid-hint strong {
  color: #ff4d6d;
  font-weight: 700;
}

.modal-bid-input {
  padding: 12px;
  font-size: 15px;
  width: 100%;
}

.btn-modal-bid {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

/* Table styles */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  overflow: hidden;
}

.items-table thead {
  background: rgba(255, 255, 255, 0.08);
}

.items-table th {
  padding: 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 2px solid var(--stroke);
}

.items-table td {
  padding: 16px;
  font-size: 15px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: middle;
  line-height: 1.6;
}

/* Limit product name column width */
.items-table th:nth-child(4),
.items-table td:nth-child(4) {
  max-width: 300px;
  width: 300px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Action column - consistent button sizing */
.items-table th:last-child,
.items-table td:last-child {
  width: 140px;
  min-width: 140px;
  text-align: center;
}

.items-table td:last-child .btn {
  width: 100%;
  font-size: 12px;
  padding: 6px 12px;
  margin-bottom: 4px;
}

.items-table td:last-child .btn:last-child {
  margin-bottom: 0;
}

.items-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

.items-table tbody tr:last-child td {
  border-bottom: none;
}

.items-table img {
  display: block;
}

.items-table small {
  color: var(--muted);
  font-size: 13px;
}

/* Follow button active state */
#followBtn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

#followBtn.active:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Main tabs wrapper - contains tabs and scroll indicators */
.main-tabs-wrapper {
  position: relative;
  margin: 24px 0;
}

/* Main tabs navigation */
.main-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--stroke);
  padding-bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.main-tabs::-webkit-scrollbar {
  display: none;
}

.main-tab {
  padding: 16px 28px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  bottom: -2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.main-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.main-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
  font-weight: 700;
}

/* Scroll arrow indicators - pinned to wrapper edges */
.main-tabs-scroll-indicator {
  position: absolute;
  top: 0;
  bottom: 2px; /* Account for border-bottom */
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.main-tabs-scroll-indicator.left {
  left: 0;
  background: linear-gradient(to right, var(--bg0) 0%, var(--bg0) 30%, transparent 100%);
}

.main-tabs-scroll-indicator.right {
  right: 0;
  background: linear-gradient(to left, var(--bg0) 0%, var(--bg0) 30%, transparent 100%);
}

.main-tabs-scroll-indicator::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
}

.main-tabs-scroll-indicator.left::after {
  transform: rotate(-135deg);
  left: 10px;
}

.main-tabs-scroll-indicator.right::after {
  transform: rotate(45deg);
  right: 10px;
}

/* Show indicators based on wrapper class */
.main-tabs-wrapper.can-scroll-left .main-tabs-scroll-indicator.left,
.main-tabs-wrapper.can-scroll-right .main-tabs-scroll-indicator.right {
  opacity: 1;
}

/* Main pages */
.main-page {
  display: none;
}

.main-page.active {
  display: block;
}

/* Search page: layout sidebar + main */
.search-page-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
  width: 100%;
}

.category-sidebar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 260px;
  padding: 4px 0;
}

.category-sidebar {
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--stroke);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 100px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.category-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
}

.category-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.category-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 10px;
  transition: transform 0.2s;
}

.category-sidebar.collapsed .category-sidebar-toggle {
  transform: rotate(-90deg);
}

.category-sidebar-list {
  padding: 8px 10px 12px;
}

/* Accordion: L1 → L2/L3 expand/collapse, layout shift */
.category-accordion-item {
  border-bottom: 1px solid var(--stroke);
  padding: 0 4px;
}

.category-accordion-item:last-child {
  border-bottom: none;
}

.category-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
  padding: 12px 12px 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 6px;
  margin: 0;
  gap: 8px;
  box-sizing: border-box;
}

.category-accordion-title {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}

.category-accordion-title:hover {
  color: var(--primary);
}

.category-accordion-item--leaf .category-accordion-title {
  cursor: default;
}

.category-accordion-arrow {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}

.category-accordion-arrow:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.category-accordion-item.is-expanded .category-accordion-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}

.category-accordion-item--leaf .category-accordion-arrow {
  display: none;
}

.category-accordion-body {
  max-height: 0;
  overflow: hidden;
  margin: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-accordion-item.is-expanded .category-accordion-body {
  max-height: 2000px;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-accordion-body-inner {
  padding: 0 8px 12px 24px;
}

.category-accordion-group {
  margin-bottom: 12px;
}

.category-accordion-group:last-child {
  margin-bottom: 0;
}

.category-accordion-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px 4px;
  letter-spacing: 0.02em;
}

.category-accordion-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-accordion-link {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.category-accordion-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary);
}

.category-accordion-link.active {
  background: rgba(124, 58, 237, 0.18);
  color: var(--primary);
}

.category-right {
  flex: 1;
  min-width: 0;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  margin-left: 24px;
}

/* Khung danh sách sản phẩm theo danh mục (sau khi bấm L3) */
.category-product-list {
  min-height: 120px;
  margin-top: 12px;
}

.category-product-list-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-product-list-ul li {
  padding: 6px 0;
  border-bottom: 1px solid var(--stroke);
}

.category-product-list-ul li:last-child {
  border-bottom: none;
}

.category-product-list-ul a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.category-product-list-ul a:hover {
  color: var(--primary);
}

.search-page-main {
  flex: 1;
  min-width: 0;
}

.category-content {
  min-height: 400px;
  padding: 40px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.category-content-inner {
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.category-content-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.category-content-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.category-content-link-wrap {
  margin-top: 16px;
}

.category-yahoo-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.category-yahoo-link:hover {
  text-decoration: underline;
}

/* Category list: breadcrumb */
.category-breadcrumb {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.category-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.category-breadcrumb-item a,
.category-breadcrumb-item span {
  color: inherit;
}

.category-breadcrumb-item a:hover {
  color: var(--primary);
}

.category-breadcrumb-sep {
  color: var(--muted);
  opacity: 0.8;
}

/* Category list: tabs (Tất cả / Bán đấu giá / Số tiền cố định) + sort/filter - compact như ảnh tham khảo */
.category-result-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.category-tabs {
  min-width: 0;
  flex: 0 1 auto;
}

.category-tabs-inner {
  display: inline-block;
}

/* Segmented control: tabs dính nhau, bo góc ngoài */
.category-tabs-list {
  display: inline-flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

.category-tab-item {
  margin: 0;
}

.category-tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid var(--stroke);
  white-space: nowrap;
}

.category-tab-item:last-child .category-tab-link {
  border-right: none;
}

.category-tab-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.category-tab-item.active .category-tab-link {
  background: rgba(124, 58, 237, 0.35);
  color: var(--primary);
}

.category-tab-sub {
  display: none;
}

.category-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.category-sort-count {
  flex-shrink: 0;
}

.category-sort-count-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.category-sort-count-label {
  display: none;
}

.category-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-sort-icon {
  font-size: 14px;
  color: var(--muted);
  line-height: 1;
}

.category-sort-select,
.category-count-select {
  padding: 8px 12px 8px 10px;
  padding-right: 28px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  min-width: 0;
  width: auto;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.category-sort-select {
  min-width: 110px;
}

.category-count-select {
  min-width: 56px;
  padding-right: 24px;
  background-position: right 6px center;
}

.category-sort-select:hover,
.category-count-select:hover {
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.1);
}

.category-sort-select:focus,
.category-count-select:focus {
  outline: none;
  border-color: var(--primary);
}

.category-sort-select option,
.category-count-select option {
  background-color: #1e293b;
  color: #f1f5f9;
}

.category-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.category-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.category-filter-btn-icon {
  font-size: 12px;
  opacity: 0.8;
}

/* Category list: product grid */
.category-product-list {
  min-height: 120px;
}

.category-list-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 12px;
}

.category-list-loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--stroke);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: category-list-spin 0.8s linear infinite;
}

.category-list-loading-text {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

@keyframes category-list-spin {
  to { transform: rotate(360deg); }
}

.category-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-product-card {
  margin: 0;
}

.category-product-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.category-product-link:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.category-product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.2);
}

.category-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.category-product-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--success);
  color: #fff;
}

.category-product-follow-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.category-product-follow-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.category-product-follow-btn.is-followed {
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
}

.category-product-follow-btn.is-followed:hover {
  background: rgba(185, 28, 28, 0.9);
}

.category-product-info {
  padding: 12px;
}

.category-product-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-product-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.category-product-price.current {
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}

.category-product-price.buynow {
  font-size: 12px;
  color: var(--muted);
}

.category-product-postage {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px 0;
}

.category-product-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}

/* Category list: pagination */
.category-pagination {
  margin-top: 24px;
}

.category-pagination-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.category-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.category-pagination-page:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--stroke);
}

.category-pagination-page-current {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.5);
  color: var(--primary);
  font-weight: 600;
  cursor: default;
}

.category-pagination-ellipsis {
  padding: 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.category-pagination-btn {
  font-size: 13px;
  min-height: 32px;
}

.category-sidebar-filters {
  font-size: 13px;
  color: var(--text);
  padding: 0 10px 8px;
}

.category-sidebar-filters .Filter__items,
.category-sidebar-filters .Filter__item,
.category-sidebar-filters .InputText__items,
.category-sidebar-filters .InputText__item {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.category-sidebar-filters .Filter__header {
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
}

.category-sidebar-filters .Filter__body {
  margin-left: 0;
}

/* Mục con: thụt lề (Tình trạng: 99%, 88%... dưới Sản phẩm đã dùng; Người bán: Đấu giá/Chợ trời Yahoo dưới Cá nhân) */
.category-sidebar-filters .Filter__item .Filter__items,
.category-sidebar-filters .Filter__item ul.Filter__items {
  margin-left: 14px;
  margin-top: 4px;
}

.category-sidebar-filters .Filter__link,
.category-sidebar-filters a {
  color: var(--muted);
  text-decoration: none;
}

.category-sidebar-filters .Filter__link:hover,
.category-sidebar-filters a:hover {
  color: var(--primary);
}

.category-sidebar-filters .CheckBox__view {
  cursor: pointer;
}

/* Lọc giá: nhãn Từ/Đến, ô nhập, bỏ marker */
.category-sidebar-filters [data-name="price"] .Filter__subTitle.Filter__subTitle--priceRange {
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
}

.category-sidebar-filters [data-name="price"] .InputText__items {
  display: flex;
  align-items: center;
  gap: 6px 8px;
}

.category-sidebar-filters [data-name="price"] .InputText__item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-sidebar-filters [data-name="price"] .Filter__priceLabel {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.category-sidebar-filters [data-name="price"] .InputText__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-sidebar-filters [data-name="price"] .InputText__input {
  width: 90px;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.category-sidebar-filters [data-name="price"] .InputText__unit {
  font-size: 12px;
  color: var(--muted);
}

.category-sidebar-filters [data-name="price"] .InputText__item--range .InputText__range {
  font-size: 13px;
  color: var(--muted);
  padding: 0 2px;
}

/* Mobile drawers: category menu (left) + filter (right) */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.3s;
}

.mobile-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-drawer.is-open .mobile-drawer-overlay {
  opacity: 1;
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--bg1);
  border: 1px solid var(--stroke);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-out;
}

.mobile-drawer--left .mobile-drawer-panel {
  left: 0;
  transform: translateX(-100%);
  border-radius: 0 12px 12px 0;
}

.mobile-drawer--right .mobile-drawer-panel {
  right: 0;
  transform: translateX(100%);
  border-radius: 12px 0 0 12px;
}

.mobile-drawer.is-open .mobile-drawer-panel {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.mobile-drawer-panel--filter .mobile-drawer-header {
  padding: 20px 24px;
}

.mobile-drawer-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.mobile-drawer-panel--filter .mobile-drawer-title {
  font-size: 17px;
  font-weight: 600;
}

.mobile-drawer-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.mobile-drawer-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.mobile-drawer-panel--filter .mobile-drawer-body {
  padding: 20px 24px 24px;
}

.mobile-drawer-body .category-sidebar-list,
.mobile-drawer-body .category-sidebar-filters {
  padding: 0;
}

/* Filter drawer: bố cục tham khảo Yahoo mobile (FormStyle), PC và mobile */
.filter-drawer-content .category-sidebar-filters {
  padding: 0;
}

.filter-drawer-content .Filter {
  margin-bottom: 0;
  border-bottom: 1px solid var(--stroke);
}

.filter-drawer-content .Filter:last-child {
  border-bottom: none;
}

/* Danh mục: accordion trên cả PC và mobile */
.filter-drawer-content .filter-accordion-item .Filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 14px 0;
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  border-bottom: none;
  min-height: 44px;
}

.filter-drawer-content .filter-accordion-item .Filter__header:hover {
  color: var(--primary);
}

.filter-drawer-content .filter-accordion-item .filter-accordion-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.filter-drawer-content .filter-accordion-item.is-expanded .filter-accordion-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}

.filter-drawer-content .filter-accordion-item .Filter__body {
  display: none;
  padding: 0 0 16px;
}

.filter-drawer-content .filter-accordion-item.is-expanded .Filter__body {
  display: block;
}

/* Các mục khác (Giá, Trạng thái...): luôn hiển thị */
.filter-drawer-content .Filter:not(.filter-accordion-item) .Filter__header {
  padding: 14px 0 8px;
  margin-top: 4px;
  font-weight: 600;
  font-size: 14px;
}

.filter-drawer-content .Filter:not(.filter-accordion-item) .Filter__body {
  padding-bottom: 16px;
}

.filter-drawer-content .Filter:first-child .Filter__header {
  padding-top: 0;
}

.filter-drawer-content .Filter:not(.filter-accordion-item):first-child .Filter__header {
  margin-top: 0;
}

@media (max-width: 900px) {
  .search-page-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .category-sidebar-wrap {
    display: none;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 20px;
  }

  .category-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: 60vh;
    overflow: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
  }

  .category-sidebar.collapsed {
    max-height: 52px;
  }

  .category-sidebar.collapsed .category-sidebar-list {
    display: none;
  }

  .category-sidebar-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px 16px;
  }

  .category-sidebar-toggle {
    display: block;
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    font-size: 12px;
    touch-action: manipulation;
  }

  .category-sidebar-header {
    padding: 14px 16px;
    min-height: 44px;
  }

  .category-right {
    margin-left: 0;
    margin-top: 16px;
    order: 2;
  }

  .category-filter-btn {
    display: inline-flex !important;
  }

  .category-content {
    padding: 20px 12px 32px;
    min-height: 300px;
  }

  .category-content-inner {
    max-width: 100%;
    text-align: left;
  }

  /* Sidebar filter (Bộ lọc) - mobile */
  .category-sidebar-filters {
    overflow-y: visible;
    padding: 12px 14px 20px;
  }

  .category-sidebar-filters .Filter__header {
    margin-top: 16px;
    font-size: 14px;
  }

  /* Mobile: filter drawer content padding */
  .filter-drawer-mobile.filter-drawer-content .category-sidebar-filters {
    padding: 16px 0;
  }

  /* Mobile: price filter stacked vertically */
  .category-sidebar-filters [data-name="price"] .InputText__items {
    flex-direction: column;
    align-items: stretch;
  }

  .category-sidebar-filters [data-name="price"] .InputText__item {
    width: 100%;
  }

  .category-sidebar-filters [data-name="price"] .InputText__item--range {
    text-align: center;
  }

  .category-sidebar-filters [data-name="price"] .InputText__input {
    flex: 1;
    width: auto;
  }

  .category-sidebar.collapsed .category-sidebar-filters {
    display: none;
  }

  .category-accordion-header {
    padding: 14px 18px;
    min-height: 44px;
  }

  .category-accordion-body {
    display: none;
  }

  .category-accordion-item.is-expanded .category-accordion-body {
    display: block;
    max-height: none;
  }

  .category-accordion-body-inner {
    padding: 0 12px 16px 20px;
  }

  .category-accordion-link {
    padding: 10px 12px;
    min-height: 40px;
  }

  .category-sidebar-filters .Filter__link,
  .category-sidebar-filters a {
    display: block;
    padding: 10px 8px 10px 0;
    min-height: 36px;
    line-height: 1.5;
  }

  /* category-result-header: compact single row trên mobile */
  .category-result-header {
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .category-tabs {
    width: auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-tabs-list {
    flex-shrink: 0;
  }

  .category-tab-link {
    padding: 8px 12px;
    font-size: 12px;
  }

  .category-result-actions {
    flex-shrink: 0;
  }

  .category-sort-count-inner {
    gap: 6px;
  }

  .category-sort-select {
    min-width: 100px;
    padding: 8px 24px 8px 10px;
    font-size: 12px;
  }

  .category-count-select {
    min-width: 48px;
    padding: 8px 20px 8px 8px;
    font-size: 12px;
  }

  .category-filter-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

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

  .category-product-info {
    padding: 10px;
  }

  .category-product-title {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .category-breadcrumb {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .category-pagination-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .category-pagination-page {
    min-width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .category-pagination-btn {
    min-height: 40px;
    padding: 10px 16px;
  }
}

/* Mobile: 680px - smaller category grid, tighter layout */
@media (max-width: 680px) {
  .category-sidebar-list {
    max-height: 200px;
  }

  .category-content {
    padding: 16px 8px 24px;
  }

  .category-result-header {
    gap: 8px;
    padding-bottom: 10px;
  }

  .category-tab-link {
    padding: 6px 10px;
    font-size: 11px;
  }

  .category-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-product-info {
    padding: 8px;
  }

  .category-product-title {
    font-size: 11px;
  }

  .category-product-follow-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .category-sort-select,
  .category-count-select {
    font-size: 11px;
    padding: 6px 20px 6px 8px;
  }
}

/* Very small: 400px */
@media (max-width: 400px) {
  .category-product-grid {
    gap: 8px;
  }
}


