/* ============================================
   Components — Maiandi Solutions
   Uses tokens from base.css
   ============================================ */

/* ── 1. Buttons ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible {
  outline: 2px solid var(--royal-blue);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-gold:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-dark {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}
.btn-dark:hover {
  background: var(--royal-blue);
  border-color: var(--royal-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--royal-blue);
  color: #fff;
  border-color: var(--royal-blue);
}
.btn-primary:hover {
  background: var(--royal-blue-light);
  border-color: var(--royal-blue-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--navy-deep);
  border-color: var(--navy-deep);
}
.dark .btn-outline {
  color: #e0e0e0;
  border-color: #555;
}
.btn-outline:hover {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}
.dark .btn-outline:hover {
  background: #444;
  border-color: #666;
  color: #fff;
}
.btn-outline:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
}
.btn-lg {
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
}
.btn-icon.btn-lg {
  width: 50px;
  height: 50px;
  font-size: 1.35rem;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover {
  background: #c0392b;
  border-color: #c0392b;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-danger:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}
.dark .btn-ghost {
  color: #ccc;
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.06);
}
.dark .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}
.btn-ghost:active {
  background: rgba(0, 0, 0, 0.12);
}
.dark .btn-ghost:active {
  background: rgba(255, 255, 255, 0.14);
}

.btn-ghost-danger {
  color: var(--red);
}
.btn-ghost-danger:hover {
  background: rgba(224, 71, 62, 0.1);
  color: var(--red);
}
.btn-ghost-danger:active {
  background: rgba(224, 71, 62, 0.16);
}

/* ── 2. Cards ────────────────────────────── */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  transition: box-shadow 0.2s ease;
}
.dark .card {
  background: var(--bg-panel);
  border-color: var(--line);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
}

.card-product {
  border: 1px solid var(--line);
  border-radius: var(--product-radius);
  background: var(--bg-panel);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.dark .card-product {
  background: var(--bg-panel);
  border-color: var(--line);
}
.card-product:hover {
  box-shadow: var(--shadow-md);
}

.card-product .product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg);
}
.card-product .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card-product:hover .product-image img {
  transform: scale(1.05);
}

.card-product .discount-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  z-index: 2;
  letter-spacing: .02em;
}

.card-product .badge-novo,
.card-product .badge-top {
  position: absolute;
  top: 6px;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 2px;
  z-index: 2;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.card-product .badge-novo {
  left: 6px;
  background: var(--navy-deep);
  color: #fff;
}
.card-product .product-image .badge-novo {
  right: 6px;
  left: auto;
  background: var(--royal-blue);
}
.card-product .badge-top {
  background: var(--gold);
  color: var(--navy-deep);
}

.card-product .wishlist-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--ink-soft);
  z-index: 3;
  transition: color 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.card-product .wishlist-btn:hover {
  color: var(--red);
  transform: scale(1.1);
}
.card-product .wishlist-btn.active {
  color: var(--red);
}
.dark .card-product .wishlist-btn {
  background: rgba(30,30,30,.85);
  color: #999;
}
.dark .card-product .wishlist-btn:hover,
.dark .card-product .wishlist-btn.active {
  color: var(--red);
}

.card-product .product-body {
  padding: 6px 8px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-product .product-category {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dark .card-product .product-category {
  color: #999;
}

.card-product .product-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dark .card-product .product-title {
  color: #e8e8e8;
}

.card-product .product-price {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--royal-blue);
  line-height: 1.2;
}
.card-product .product-price del {
  font-weight: 400;
  font-size: 0.65rem;
  color: var(--ink-soft);
  margin-left: 4px;
  text-decoration: line-through;
}
.dark .card-product .product-price del {
  color: #888;
}
.card-product .product-stars {
  font-size: 0.62rem;
  color: var(--gold-dark);
  line-height: 1;
}

.card-product .btn-add-cart {
  margin-top: 4px;
  align-self: stretch;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  font-weight: 600;
}

.card-promo {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  overflow: hidden;
}
.dark .card-promo {
  background: var(--bg-panel);
  border-color: var(--line);
}
.card-promo .promo-text {
  flex: 1;
}
.card-promo .promo-image {
  flex-shrink: 0;
  width: 200px;
}
.card-promo .promo-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4/3;
  object-fit: contain;
}
@media (max-width: 640px) {
  .card-promo {
    flex-direction: column-reverse;
    text-align: center;
  }
  .card-promo .promo-image {
    width: 140px;
  }
}

/* ── 3. Badges ───────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--ink-soft);
  color: #fff;
}
.dark .badge {
  background: #555;
  color: #eee;
}

.badge-gold {
  background: var(--gold);
  color: var(--navy-deep);
}
.badge-red {
  background: var(--red);
  color: #fff;
}
.badge-green {
  background: var(--green);
  color: #fff;
}
.badge-soft {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}
.dark .badge-soft {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.badge-counter {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-panel);
}
.dark .badge-counter {
  box-shadow: 0 0 0 2px var(--bg-panel);
}

/* ── 4. Forms ────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.dark .form-label {
  color: #ccc;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}
.dark .form-input,
.dark .form-select,
.dark .form-textarea {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #555;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--royal-blue);
  box-shadow: 0 0 0 3px rgba(26, 55, 118, 0.12);
}
.dark .form-input:focus,
.dark .form-select:focus,
.dark .form-textarea:focus {
  border-color: #7799d4;
  box-shadow: 0 0 0 3px rgba(119, 153, 212, 0.2);
}
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  padding-right: 0.85rem;
}

.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink);
}
.dark .form-checkbox {
  color: #ccc;
}
.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--royal-blue);
  cursor: pointer;
}

.form-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 0.15rem;
}

/* ── 5. Modals ───────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.3s ease;
  position: relative;
}
.dark .modal {
  background: #2a2a2a;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-sm {
  max-width: 380px;
}
.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.dark .modal-header {
  border-color: #444;
}
.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink);
}
.dark .modal-header h2,
.dark .modal-header h3 {
  color: #e8e8e8;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--ink);
}
.dark .modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-mensagem {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}
.dark .modal-mensagem {
  color: #aaa;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}
.dark .modal-footer {
  border-color: #444;
}

/* ── 6. Toasts ───────────────────────────── */
.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
  width: auto;
  max-width: 100%;
}
.toast-container .toast {
  width: 100%;
  max-width: 380px;
  pointer-events: auto;
  word-break: break-word;
  white-space: normal;
}
@media (max-width: 480px) {
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    align-items: stretch;
  }
  .toast-container .toast {
    max-width: 100%;
  }
}

.toast {
  background: var(--bg-panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--ink-soft);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink);
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.dark .toast {
  background: #2a2a2a;
  color: #ddd;
  border-left-color: #777;
}
.toast.show {
  animation: slideInRight 0.35s ease forwards;
}
.toast.hide {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-success {
  border-left-color: var(--green);
}
.toast-error {
  border-left-color: var(--red);
}
.toast-info {
  border-left-color: var(--royal-blue);
}

/* ── 7. Table ────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: var(--ink);
}
.dark .table {
  color: #ddd;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.dark .table th,
.dark .table td {
  border-color: #444;
}

.table th {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--bg);
}
.dark .table th {
  background: #2a2a2a;
  color: #999;
}

.table-striped tbody tr:nth-child(even) {
  background: var(--bg);
}
.dark .table-striped tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.table-hover tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}
.dark .table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.table-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.table-actions .btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

/* ── 8. Pagination ───────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.page-item {
  margin: 0;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.dark .page-link {
  color: #ccc;
}
.page-link:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--line);
}
.dark .page-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #555;
}

.page-item.active .page-link {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}
.page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── 9. Tabs ─────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dark .tabs {
  border-color: #444;
}

.tab-item {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.25s ease, border-color 0.25s ease;
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
}
.dark .tab-item {
  color: #999;
}
.tab-item:hover {
  color: var(--ink);
}
.dark .tab-item:hover {
  color: #e0e0e0;
}
.tab-item.active {
  color: var(--navy-deep);
  border-bottom-color: var(--gold);
}
.dark .tab-item.active {
  color: #e8e8e8;
  border-bottom-color: var(--gold);
}

.tab-content {
  padding-top: 1rem;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* ── 10. Breadcrumbs ─────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.breadcrumbs a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumbs a:hover {
  color: var(--royal-blue);
}
.breadcrumbs li + li::before {
  content: "\00b7";
  color: var(--ink-soft);
  margin-right: 0.35rem;
}
.breadcrumbs .current {
  color: var(--ink);
  font-weight: 600;
}
.dark .breadcrumbs .current {
  color: #e0e0e0;
}

/* ── 11. Empty States ────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  gap: 0.6rem;
}
.empty-state .empty-icon {
  font-size: 48px;
  line-height: 1;
  color: var(--ink-soft);
  opacity: 0.6;
}
.dark .empty-state .empty-icon {
  opacity: 0.4;
}
.empty-state .empty-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.dark .empty-state .empty-title {
  color: #e0e0e0;
}
.empty-state .empty-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 320px;
  margin: 0;
}

/* ── 12. Skeleton ────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.12) 50%,
    rgba(0, 0, 0, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.dark .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
}

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

.skeleton-text {
  height: 14px;
  width: 80%;
  margin-bottom: 0.5rem;
}
.skeleton-title {
  height: 20px;
  width: 50%;
  margin-bottom: 0.75rem;
}
.skeleton-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius);
}
.skeleton-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dark .skeleton-card {
  border-color: #444;
  background: var(--bg-panel);
}

/* ── 13. Header (SHEIN-style) ────────────── */
.maiandi-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  transition: background 0.3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.dark .maiandi-header {
  background: #1a1a1a;
  border-color: #333;
}

.maiandi-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 10px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-center .logo-img {
  height: 22px;
  width: auto;
  display: block;
}

/* Header icon (round buttons) */
.header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.dark .header-icon {
  color: #ccc;
}
.header-icon:hover {
  background: rgba(0,0,0,0.05);
  color: var(--royal-blue);
}
.dark .header-icon:hover {
  background: rgba(255,255,255,0.08);
  color: #7799d4;
}
.header-icon .badge-counter {
  position: absolute;
  top: 0;
  right: 0;
}

/* Hamburger (always visible, part of header-left) */
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.1rem;
  transition: background 0.2s;
}
.dark .hamburger {
  color: #ccc;
}
.hamburger:hover {
  background: rgba(0,0,0,0.05);
}
.dark .hamburger:hover {
  background: rgba(255,255,255,0.08);
}

/* Header search dropdown */
.header-search-dropdown {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}
.dark .header-search-dropdown {
  background: #1a1a1a;
  border-color: #333;
}
.header-search-dropdown .search-bar {
  max-width: 600px;
  margin: 0 auto;
}

/* ── Category Bar (horizontal scroll) ────── */
.category-bar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.dark .category-bar {
  background: #1a1a1a;
  border-color: #333;
}

.category-bar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 10px;
  max-width: 1280px;
  margin: 0 auto;
}
.category-bar-inner::-webkit-scrollbar {
  display: none;
}

.cat-link {
  flex-shrink: 0;
  padding: 7px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dark .cat-link {
  color: #999;
}
.cat-link:hover {
  color: var(--ink);
}
.dark .cat-link:hover {
  color: #e0e0e0;
}
.cat-link.active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--gold);
}
.dark .cat-link.active {
  color: #e8e8e8;
}

/* ── Mobile Drawer ───────────────────────── */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(86vw, 320px);
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-panel);
  background-image: none;
  color: var(--ink);
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.dark .mobile-drawer {
  background-color: #1a1a1a;
  color: #e8e8e8;
}
.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.dark .mobile-drawer-header {
  border-color: #333;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.drawer-close-btn:hover {
  background: rgba(0,0,0,0.06);
}
.dark .drawer-close-btn:hover {
  background: rgba(255,255,255,0.08);
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.drawer-user {
  padding: 0 16px 12px;
}

.drawer-auth {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--royal-blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.drawer-btn:hover {
  background: var(--royal-blue-light);
}
.dark .drawer-btn {
  background: #2a4a9e;
}
.dark .drawer-btn:hover {
  background: #3a5fcf;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.drawer-cats {
  display: none;
  flex-direction: column;
  gap: 0;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s;
}
.dark .drawer-link {
  color: #ccc;
}
.drawer-link:hover {
  background: rgba(0,0,0,0.04);
}
.dark .drawer-link:hover {
  background: rgba(255,255,255,0.04);
}
.drawer-link i {
  width: 20px;
  text-align: center;
  color: var(--ink-soft);
}

.drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.dark .drawer-footer {
  border-color: #333;
}

.drawer-theme-btn {
  width: 100% !important;
  height: auto !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 6px !important;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--line);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  justify-content: flex-start;
  text-align: left;
}
.dark .drawer-theme-btn {
  background: #2a2a2a;
  color: #ccc;
  border-color: #444;
}

/* Menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  cursor: pointer;
}
.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

body.nav-open .mobile-drawer {
  z-index: 10001;
}
body.nav-open .menu-overlay {
  z-index: 10000;
}

/* ── Theme Toggle Button (also used in drawer) ── */
.theme-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.dark .theme-toggle-btn {
  border-color: #555;
  background: #2a2a2a;
  color: #e8c95a;
}
.theme-toggle-btn:hover {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}
.dark .theme-toggle-btn:hover {
  background: #444;
  border-color: #666;
}

/* ── 14. Notifications / Drawer ──────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-panel);
  box-shadow: var(--shadow-lg);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
}
.dark .cart-drawer {
  background: #1e1e1e;
}
.cart-drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1499;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.dark .drawer-header {
  border-color: #444;
}
.drawer-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ink);
}
.dark .drawer-header h3 {
  color: #e0e0e0;
}

.drawer-close {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease;
}
.drawer-close:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--ink);
}
.dark .drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}
.dark .drawer-footer {
  border-color: #444;
}

/* ── 15. Footer ──────────────────────────── */
.main-footer {
  background: var(--navy-deep);
  color: #fff;
  padding: 3rem 1.25rem 0;
}

.main-footer .wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
  color: var(--gold);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-col ul a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.25s ease;
}
.footer-col ul a:hover {
  color: var(--gold);
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}
.footer-brand-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin: 0;
}

.social-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.social-links a:hover {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.2rem 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ── 16. Hero ────────────────────────────── */
.hero-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: 3rem 3rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--royal-blue) 100%);
  position: relative;
  overflow: hidden;
}
@media (max-width: 768px) {
  .hero-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 1.5rem;
  }
}

.hero-copy {
  color: #fff;
  z-index: 1;
}
.hero-copy h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}
.hero-copy p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0 0 1.25rem;
  max-width: 440px;
}
@media (max-width: 768px) {
  .hero-copy p {
    max-width: none;
  }
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.hero-visual img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: contain;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  pointer-events: none;
}
.hero-arrows button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-arrows button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
}
.hero-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease;
}
.hero-dots span.active {
  width: 22px;
  border-radius: 4px;
  background: var(--gold);
}

/* ── Header Search (inline) ──────────────── */
.header-search{position:relative;flex:1;max-width:360px;margin:0 0.75rem;}
.header-search .search-bar{border-radius:20px;background:var(--bg);}
.dark .header-search .search-bar{background:#2a2a2a;}
.header-search .search-bar input{font-size:.8rem;padding:.3rem .6rem;}
.header-search .search-bar button{background:transparent;color:var(--ink-soft);padding:.3rem .6rem;border-radius:0 20px 20px 0;}
.header-search .search-bar button:hover{color:var(--royal-blue);background:transparent;}
.dark .header-search .search-bar button{color:#888;}
.dark .header-search .search-bar button:hover{color:#7799d4;}
.header-search .search-suggestions{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--bg-panel);border-radius:var(--radius);box-shadow:var(--shadow-lg);max-height:320px;overflow-y:auto;z-index:2001;display:none;}
.header-search .search-suggestions:not(:empty){display:block;}
.dark .header-search .search-suggestions{background:#2a2a2a;}
@media(max-width:980px){
  .header-search{max-width:200px;}
}
@media(max-width:768px){
  .header-search{display:none;}
}

/* ── 17. Search Bar ──────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.25s ease;
}
.dark .search-bar {
  background: #2a2a2a;
  border-color: #555;
}
.search-bar:focus-within {
  border-color: var(--royal-blue);
}

.search-bar select {
  border: none;
  background: var(--bg);
  padding: 0.35rem 0.35rem 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  min-width: 60px;
  border-right: 1px solid var(--line);
}
.dark .search-bar select {
  background: #2a2a2a;
  color: #e0e0e0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.dark .search-bar input {
  color: #e0e0e0;
}
.search-bar input::placeholder {
  color: var(--ink-soft);
}
.dark .search-bar input::placeholder {
  color: #888;
}

.search-bar button {
  border: none;
  background: var(--navy-deep);
  color: #fff;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.25s ease;
  align-self: stretch;
}
.search-bar button:hover {
  background: var(--royal-blue);
}

/* ── 18. Countdown ───────────────────────── */
.countdown {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.countdown span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 6px;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

/* ── 19. Loading Spinner ─────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.dark .spinner {
  border-color: #555;
  border-top-color: var(--gold);
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

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

/* ── 20. Price Display ───────────────────── */
.price {
  font-weight: 700;
  color: var(--royal-blue);
  font-size: 0.95rem;
}
.dark .price {
  color: #7799d4;
}
.price del {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-left: 0.35rem;
  text-decoration: line-through;
}
.dark .price del {
  color: #888;
}

.price-lg {
  font-size: 1.2rem;
}

.price-hero {
  font-size: 1.9rem;
  color: var(--gold);
  font-family: var(--font-serif);
  font-weight: 700;
}

/* ── 21. Stars / Rating ──────────────────── */
.stars {
  color: var(--gold-dark);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}
.stars span {
  color: var(--ink-soft);
  font-size: 0.7rem;
  margin-left: 0.25rem;
}
.dark .stars span {
  color: #999;
}

/* ── 22. Progress Bar ────────────────────── */
.progress-bar {
  height: 5px;
  background: var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dark .progress-bar {
  background: #555;
}
.progress-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: var(--radius-sm);
  transition: width 0.4s ease;
}

/* ── 23. Mobile Tab Bar ─────────────────── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  z-index: 9999;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.dark .mobile-tab-bar {
  background: #1e1e1e;
  border-color: #333;
}
.mobile-tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.55rem;
  font-weight: 600;
  padding: 4px 2px;
  border-radius: 4px;
  transition: color 0.2s;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.mobile-tab-bar a i {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 2px;
}
.mobile-tab-bar a span:not(.badge-counter) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.6rem;
  letter-spacing: 0.01em;
}
.mobile-tab-bar a:hover,
.mobile-tab-bar a.active {
  color: var(--royal-blue);
}
.mobile-tab-bar a .badge-counter {
  top: 0;
  right: 4px;
}
.dark .mobile-tab-bar a {
  color: #999;
}
.dark .mobile-tab-bar a:hover,
.dark .mobile-tab-bar a.active {
  color: #7799d4;
}

@media (max-width: 768px) {
  .mobile-tab-bar {
    display: flex;
  }
  body {
    padding-bottom: 56px;
  }
}
