@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --brand-50: #F5F3FF;
  --brand-100: #EDE9FE;
  --brand-200: #DDD6FE;
  --brand-400: #A78BFA;
  --brand-500: #8B5CF6;
  --brand-600: #7C3AED;
  --brand-700: #6D28D9;
  --accent: #F43F5E;
  --accent-100: #FFE4E9;

  --color-bg: #FAF9FC;
  --color-surface: #FFFFFF;
  --color-surface-2: #F4F1FA;
  --color-border: #E9E5F2;
  --color-text: #1C1730;
  --color-muted: #756F8A;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(30, 20, 60, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 20, 60, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 20, 60, 0.14);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #131022;
    --color-surface: #1C1830;
    --color-surface-2: #241F3A;
    --color-border: #322C4A;
    --color-text: #F1EEFA;
    --color-muted: #A69FC2;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);

    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; margin: 0; }

a { color: inherit; }

img { max-width: 100%; display: block; }

::selection { background: var(--brand-200); color: var(--brand-700); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--color-text); }

.nav-desktop { display: flex; align-items: center; gap: 0.3rem; }
.nav-link {
  text-decoration: none;
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--color-surface-2); color: var(--color-text); }
.nav-link.active { background: var(--brand-100); color: var(--brand-700); }

.btn-cta {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.avatar-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
}
.avatar-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.avatar-name { font-size: 0.85rem; font-weight: 600; color: var(--color-text); }

.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0.4rem;
  border-radius: var(--radius-full);
  display: flex;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--color-surface-2); color: var(--accent); }

/* Mobile bottom nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0));
  justify-content: space-around;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  cursor: pointer;
}
.mobile-nav-item.active { color: var(--brand-600); background: var(--brand-100); }
.mobile-nav-item svg { width: 22px; height: 22px; }

/* Main / hero */
main.container { padding-top: 1.75rem; padding-bottom: 4rem; min-height: 60vh; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400) 120%);
  color: #fff;
  margin-bottom: 1.75rem;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,0.22), transparent 55%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  color: #fff;
  max-width: 26rem;
}
.hero-subtitle {
  color: rgba(255,255,255,0.85);
  margin: 0.5rem 0 1.5rem;
  font-size: 0.98rem;
  max-width: 24rem;
}

.search-bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: var(--color-surface);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.search-bar input, .search-bar select {
  flex: 1 1 150px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
}
.search-bar input:focus, .search-bar select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}

/* Category pills */
.category-scroll {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 1.5rem;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-pill {
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.category-pill:hover { border-color: var(--brand-400); color: var(--brand-600); }
.category-pill.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-color: transparent;
  color: #fff;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.product-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.product-image-wrap { position: relative; }
.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-50), var(--color-surface-2));
}

.product-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.product-body { padding: 0.9rem 1rem 1.05rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.product-category { font-size: 0.7rem; font-weight: 700; color: var(--brand-600); text-transform: uppercase; letter-spacing: 0.04em; }
.product-title { font-weight: 700; font-size: 0.96rem; margin: 0; line-height: 1.3; }
.product-price { color: var(--color-text); font-weight: 800; font-size: 1.05rem; margin-top: auto; padding-top: 0.35rem; }
.product-desc { color: var(--color-muted); font-size: 0.83rem; }

.empty-state {
  text-align: center;
  color: var(--color-muted);
  padding: 4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.empty-state svg { width: 46px; height: 46px; color: var(--brand-300, var(--brand-400)); }

.pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 2.2rem;
  text-align: center;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
}
.pagination .active { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; border-color: transparent; }

/* Cards / generic surfaces */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Auth forms */
.auth-wrap { display: flex; justify-content: center; padding: 1.5rem 0 3rem; }
.form-card { max-width: 460px; width: 100%; padding: 2rem 1.75rem; }
.form-card .brand-mark { width: 46px; height: 46px; border-radius: 13px; margin-bottom: 0.9rem; }
.form-card h1 { font-size: 1.5rem; }

.form-group { margin-bottom: 1.05rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 700; color: var(--color-text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.form-group .hint { color: var(--color-muted); font-size: 0.78rem; margin-top: 0.35rem; }

.form-row { display: flex; gap: 0.7rem; }
.form-row .form-group { flex: 1; }

.phone-row { display: flex; gap: 0.5rem; }
.phone-row input { flex: 1; }

/* Country select */
.country-select { position: relative; flex: 0 0 auto; }
.country-select-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text);
  font-family: inherit;
}
.country-select-flag { width: 20px; height: 15px; object-fit: cover; border-radius: 3px; background: var(--color-surface-2); }
.country-select-caret { font-size: 0.65rem; color: var(--color-muted); }
.country-select-list {
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  width: 270px;
  padding: 0.35rem;
}
.country-select-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-text);
  font-family: inherit;
}
.country-select-row:hover { background: var(--color-surface-2); }
.country-select-row img { width: 20px; height: 15px; object-fit: cover; border-radius: 3px; background: var(--color-surface-2); }
.country-select-row-dial { margin-left: auto; color: var(--color-muted); }

/* Captcha */
.captcha-row { display: flex; align-items: center; gap: 0.6rem; }
.captcha-question {
  background: var(--brand-50);
  border: 1px dashed var(--brand-200);
  color: var(--brand-700);
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.9rem;
}
.captcha-refresh {
  background: var(--color-surface-2);
  border: none;
  width: 2.4rem; height: 2.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border: none;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  font-weight: 700;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-danger { background: linear-gradient(135deg, #FB7185, var(--accent)); }
.btn-secondary { background: var(--color-surface-2); color: var(--color-text); box-shadow: none; }
.btn-secondary:hover { box-shadow: none; background: var(--color-border); }

.alert { padding: 0.75rem 0.95rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 1.1rem; font-weight: 600; }
.alert-error { background: var(--accent-100); color: #B91C3C; }
.alert-success { background: #DCFCE7; color: #15803D; }

.form-footer { text-align: center; margin-top: 1.2rem; font-size: 0.88rem; color: var(--color-muted); }
.form-footer a { color: var(--brand-600); font-weight: 700; text-decoration: none; }

/* Dashboard */
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.dashboard-header .btn { width: auto; }

.stat-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-chip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.7rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 100px;
}
.stat-chip strong { font-size: 1.3rem; font-weight: 800; }
.stat-chip span { font-size: 0.75rem; color: var(--color-muted); font-weight: 600; }

.product-list-item {
  display: flex;
  gap: 1rem;
  padding: 0.9rem;
  align-items: center;
  margin-bottom: 0.7rem;
}
.product-list-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  flex-shrink: 0;
}
.product-list-item .info { flex: 1; min-width: 0; }
.product-list-item .actions { display: flex; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.product-list-item .actions .btn { width: auto; padding: 0.5rem 0.9rem; font-size: 0.82rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-available { background: #DCFCE7; color: #15803D; }
.status-sold { background: var(--accent-100); color: #B91C3C; }
.status-inactive { background: var(--color-surface-2); color: var(--color-muted); }

/* FAB (mobile) */
.fab {
  display: none;
  position: fixed;
  right: 1.1rem;
  bottom: calc(1.1rem + 64px + env(safe-area-inset-bottom, 0));
  z-index: 35;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  font-size: 1.6rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 30, 0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 50;
}
.modal-backdrop.open { display: flex; animation: fade-in 0.15s ease; }
.modal {
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  animation: slide-up 0.2s ease;
}

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 1rem; }
  .modal { border-radius: var(--radius-lg); animation: pop-in 0.15s ease; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.82rem;
  padding: 1.75rem 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 760px) {
  .nav-desktop { display: none; }
  .mobile-nav { display: flex; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
  .fab { display: flex; }
  .hero { padding: 1.9rem 1.4rem; }
  .form-card { padding: 1.6rem 1.25rem; }
  .form-row { flex-direction: column; gap: 0; }
  .product-list-item { flex-wrap: wrap; }
  .product-list-item .actions { width: 100%; justify-content: flex-start; }
}

@media (min-width: 761px) {
  .avatar-name { display: inline; }
}

@media (max-width: 760px) {
  .btn-new-desktop { display: none; }
}

.subtitle { color: var(--color-muted); margin: 0.3rem 0 0; font-size: 0.95rem; }

/* Combo (categoria) */
.combo { position: relative; }
.combo-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 0.3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  padding: 0.35rem;
}
.combo-row {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.88rem;
  color: var(--color-text);
  font-family: inherit;
}
.combo-row:hover { background: var(--color-surface-2); }

/* Image picker */
.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.image-preview-item { position: relative; aspect-ratio: 1/1; border-radius: var(--radius-sm); overflow: hidden; }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-remove {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

/* Modal: hide scrollbar visually */
.modal { scrollbar-width: none; }
.modal::-webkit-scrollbar { display: none; }

/* Profile dropdown menu */
.profile-menu-wrap { position: relative; }
.profile-menu {
  position: absolute;
  top: 120%;
  right: 0;
  z-index: 45;
  width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
}
.profile-menu-header { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--color-border); margin-bottom: 0.3rem; }
.profile-menu-header strong { display: block; font-size: 0.9rem; }
.profile-menu-header span { font-size: 0.76rem; color: var(--color-muted); }
.profile-menu a, .profile-menu button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.profile-menu a:hover, .profile-menu button:hover { background: var(--color-surface-2); }
.profile-menu svg { width: 17px; height: 17px; color: var(--color-muted); flex-shrink: 0; }
.profile-menu-divider { height: 1px; background: var(--color-border); margin: 0.3rem 0.2rem; }
.profile-menu .danger { color: var(--accent); }
.profile-menu .danger svg { color: var(--accent); }

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
}
@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; }
}

.gallery { position: relative; overflow: hidden; aspect-ratio: 1/1; }
.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-50), var(--color-surface-2));
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  color: var(--color-text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.gallery-prev { left: 0.7rem; }
.gallery-next { right: 0.7rem; }
.gallery-dots {
  position: absolute;
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
}
.gallery-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0;
}
.gallery-dot.active { background: #fff; width: 18px; border-radius: 4px; }

.product-detail-info .product-category { display: inline-block; margin-top: 0.4rem; }

/* API docs */
.docs-section { margin-bottom: 2.25rem; }
.docs-section h2 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.docs-section h3 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }
.docs-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.docs-method {
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.72rem;
  background: var(--brand-100);
  color: var(--brand-700);
}
.docs-method.post { background: #DCFCE7; color: #15803D; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--color-surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-size: 0.88em;
}
pre.code-block {
  background: #1C1830;
  color: #EDE9FE;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
}
pre.code-block code { background: none; padding: 0; color: inherit; }
.docs-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }

/* Price range slider */
.price-slider { flex: 1 1 220px; min-width: 200px; padding: 0.4rem 0.2rem 0; }
.price-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}
.price-slider-track { position: relative; height: 4px; background: var(--color-border); border-radius: var(--radius-full); }
.price-slider-range {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
  border-radius: var(--radius-full);
}
.price-slider-track input[type="range"] {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  margin: 0;
  transform: translateY(-50%);
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none;
}
.price-slider-track input[type="range"]::-webkit-slider-runnable-track { -webkit-appearance: none; background: none; }
.price-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand-600);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  margin-top: 0;
}
.price-slider-track input[type="range"]::-moz-range-track { background: none; border: none; }
.price-slider-track input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand-600);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* Type toggle + city select */
.type-toggle { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.type-toggle-btn {
  flex: 1;
  text-align: center;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
}
.type-toggle-btn.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border-color: transparent;
}

/* Fix: remove native focus-ring rectangle around the whole range input */
.price-slider-track input[type="range"] {
  outline: none;
  border: none;
}
.price-slider-track input[type="range"]::-moz-focus-outer {
  border: 0;
}
.price-slider-track input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--brand-100);
}
.price-slider-track input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--brand-100);
}

/* Dashboard v2: filter tabs + manage cards */
.filter-tabs { display: flex; gap: 0.4rem; overflow-x: auto; margin-bottom: 1.25rem; padding-bottom: 0.2rem; }
.filter-tab {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.filter-tab.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border-color: transparent;
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}
.manage-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.manage-card:hover { box-shadow: var(--shadow-md); }
.manage-card-image-wrap { position: relative; }
.manage-card-image { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: linear-gradient(135deg, var(--brand-50), var(--color-surface-2)); }
.manage-card-badges { position: absolute; top: 0.55rem; left: 0.55rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.manage-card-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.manage-card-meta { font-size: 0.72rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.manage-card-title { font-weight: 700; font-size: 0.96rem; margin: 0; }
.manage-card-price { font-weight: 800; color: var(--color-text); margin: 0; }
.manage-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.manage-card-actions .btn { font-size: 0.8rem; padding: 0.5rem 0.6rem; width: auto; }
.manage-card-actions .btn-full { grid-column: 1 / -1; }

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255,255,255,0.92);
  color: var(--brand-700);
}

/* Footer PIX donation (discreet) */
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.pix-donate { position: relative; }
.pix-donate-trigger {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  margin: -0.5rem -0.6rem;
  font-family: inherit;
  opacity: 0.75;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.pix-donate-trigger:hover { opacity: 1; color: var(--brand-600); }
.pix-donate-box {
  position: absolute;
  bottom: 130%;
  right: 0;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.7rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.82rem;
  max-width: min(300px, calc(100vw - 2rem));
}
.pix-donate-box #pix-donate-key { word-break: break-all; white-space: normal; }
.pix-donate-copy {
  background: var(--brand-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  min-height: 32px;
}

/* Fix: [hidden] must win over .pix-donate-box's display:flex */
.pix-donate-box[hidden] { display: none; }

/* Mobile: anchor the popover to the viewport instead of the trigger, so it
   never overflows off-screen regardless of where the discreet footer link
   ends up (footer wraps to the left edge on narrow screens). */
@media (max-width: 760px) {
  .pix-donate-box {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0));
    transform: translateX(-50%);
    width: calc(100vw - 2rem);
    max-width: 320px;
    white-space: normal;
    text-align: center;
  }
}

/* Fix: neutralize generic .search-bar input border/padding/shadow leaking into range thumbs */
.search-bar .price-slider-track input[type="range"],
.search-bar .price-slider-track input[type="range"]:focus {
  border: none;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  flex: none;
}

/* Fix: don't let the site's global inline-code style leak into Swagger UI's own dark code blocks */
#swagger-ui code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Profile page */
.profile-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 2rem;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400) 120%);
  color: #fff;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.profile-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 15%, rgba(255,255,255,0.22), transparent 55%);
  pointer-events: none;
}
.profile-hero-avatar {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
}
.profile-hero-info { position: relative; z-index: 1; flex: 1; min-width: 200px; }
.profile-hero-info h1 { color: #fff; font-size: 1.4rem; margin: 0; }
.profile-hero-meta { color: rgba(255,255,255,0.85); font-size: 0.88rem; margin: 0.3rem 0 0; }
.profile-hero-stats { position: relative; z-index: 1; display: flex; gap: 1.5rem; }
.profile-hero-stats div { text-align: center; }
.profile-hero-stats strong { display: block; font-size: 1.3rem; font-weight: 800; }
.profile-hero-stats span { font-size: 0.72rem; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.03em; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.profile-grid .form-card { max-width: none; margin: 0; }
.profile-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.section-title { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 1rem; }
.section-title svg { width: 20px; height: 20px; color: var(--brand-600); flex-shrink: 0; }
.section-title h2 { font-size: 1.05rem; margin: 0; }
.section-title.danger svg { color: var(--accent); }
.section-title.danger h2 { color: var(--accent); }

/* Legal pages */
.legal-content { max-width: 760px; margin: 0 auto; line-height: 1.7; }
.legal-content h2 { font-size: 1.15rem; margin: 2rem 0 0.6rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--color-text); font-size: 0.95rem; }
.legal-content ul { padding-left: 1.3rem; }
.legal-content .updated-at { color: var(--color-muted); font-size: 0.85rem; margin-bottom: 2rem; }

/* Consent checkbox */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.1rem;
}
.checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 0.15rem;
  accent-color: var(--brand-600);
  flex-shrink: 0;
}
.checkbox-row a { color: var(--brand-600); font-weight: 600; }

/* Price promotion (previous price strikethrough) */
.price-old {
  text-decoration: line-through;
  color: var(--color-muted);
  font-weight: 600;
}
.price-old-sm { font-size: 0.82rem; margin-right: 0.45rem; }
.price-promo { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0; }
.price-discount-badge {
  background: linear-gradient(135deg, #FB7185, var(--accent));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}
.product-badge-discount { background: linear-gradient(135deg, #FB7185, var(--accent)); }

/* Money input */
.money-input { font-variant-numeric: tabular-nums; }

/* Bigger, resizable description textarea */
.form-group textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

/* Dropzone (image upload) */
.dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--color-surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand-500);
  background: var(--brand-50);
}
.dropzone svg { width: 34px; height: 34px; color: var(--brand-500); margin-bottom: 0.5rem; }
.dropzone-title { font-weight: 700; font-size: 0.92rem; margin: 0; color: var(--color-text); }
.dropzone-title strong { color: var(--brand-600); }
.dropzone-hint { color: var(--color-muted); font-size: 0.78rem; margin: 0.25rem 0 0; }

/* Lightbox (fullscreen image viewer) */
.gallery-image { cursor: zoom-in; }
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 20, 0.92);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox-backdrop.open { display: flex; animation: fade-in 0.15s ease; }
.lightbox-img { max-width: 100%; max-height: 88vh; border-radius: var(--radius-md); object-fit: contain; box-shadow: var(--shadow-lg); }
.lightbox-close, .lightbox-arrow {
  position: absolute;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover, .lightbox-arrow:hover { background: rgba(255,255,255,0.28); }
.lightbox-close { top: 1rem; right: 1rem; width: 42px; height: 42px; border-radius: 50%; font-size: 1.4rem; line-height: 1; }
.lightbox-arrow { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}
@media (max-width: 640px) {
  .lightbox-arrow { width: 40px; height: 40px; font-size: 1.3rem; }
}

/* Toast notifications (replaces native alert()) */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--brand-500);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  animation: toast-in 0.2s ease;
}
.toast.hide { animation: toast-out 0.18s ease forwards; }
.toast-success { border-left-color: #22C55E; }
.toast-error { border-left-color: var(--accent); }
.toast-info { border-left-color: var(--brand-500); }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 0.05rem; }
.toast-success .toast-icon { color: #16A34A; }
.toast-error .toast-icon { color: var(--accent); }
.toast-info .toast-icon { color: var(--brand-600); }
.toast-message { flex: 1; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(24px); } }
@media (max-width: 640px) {
  .toast-container { top: auto; bottom: calc(1rem + 64px + env(safe-area-inset-bottom, 0)); left: 1rem; right: 1rem; max-width: none; }
}

/* Confirm dialog (replaces native confirm()) */
.confirm-modal { max-width: 380px; text-align: center; padding: 1.75rem; }
.confirm-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-100);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.confirm-modal-icon svg { width: 26px; height: 26px; }
.confirm-modal p { margin: 0 0 1.4rem; color: var(--color-text); font-size: 0.95rem; }
.confirm-modal-actions { display: flex; gap: 0.6rem; }
.confirm-modal-actions .btn { width: auto; flex: 1; }

/* Admin: usuários */
.status-suspended { background: #FEF3C7; color: #B45309; }
.status-blocked { background: var(--accent-100); color: #B91C3C; }

.admin-search { margin-bottom: 1.25rem; max-width: 420px; }

.admin-user-card { padding: 1.25rem 1.4rem; margin-bottom: 1rem; }
.admin-user-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.admin-user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 200px; }
.admin-user-info .name-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.admin-user-info h3 { margin: 0; font-size: 1.02rem; }
.admin-user-meta { color: var(--color-muted); font-size: 0.82rem; margin: 0.2rem 0 0; }
.admin-user-stats { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--color-muted); margin-top: 0.4rem; }
.admin-user-stats strong { color: var(--color-text); font-weight: 700; }
.admin-badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-user-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; flex-shrink: 0; }
.admin-user-actions .btn { width: auto; padding: 0.45rem 0.85rem; font-size: 0.8rem; }

.admin-products-toggle {
  background: none;
  border: none;
  color: var(--brand-600);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.admin-products-toggle svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.admin-products-toggle.open svg { transform: rotate(90deg); }

.admin-products-list { display: none; border-top: 1px solid var(--color-border); padding-top: 0.75rem; margin-top: 0.25rem; }
.admin-products-list.open { display: flex; flex-direction: column; gap: 0.6rem; }

.admin-product-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}
.admin-product-row img, .admin-product-row .admin-product-noimg {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-50), var(--color-surface-2));
  flex-shrink: 0;
}
.admin-product-info { flex: 1; min-width: 0; }
.admin-product-info .title { font-weight: 700; font-size: 0.85rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-product-info .meta { font-size: 0.75rem; color: var(--color-muted); margin: 0.1rem 0 0; }
.admin-product-row .btn-danger { width: auto; padding: 0.4rem 0.7rem; font-size: 0.75rem; flex-shrink: 0; }
.admin-empty-products { color: var(--color-muted); font-size: 0.82rem; padding: 0.5rem 0 0; }

/* ── Loading overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 10, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.loading-overlay.visible {
  display: flex;
  opacity: 1;
}
.loading-overlay img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.loading-text {
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
