/* ===================================================================
   CIA3D — Design System
   =================================================================== */

:root {
  --bg: #090e17;
  --bg-card: #0d1622;
  --bg-card-hover: #111d2d;
  --bg-input: #070c14;
  --border: rgba(255,255,255,0.055);
  --border-strong: rgba(255,255,255,0.10);
  --muted: #5d7a93;
  --text: #e4edf6;
  --text-sub: #8199b0;
  --accent: #13a2ff;
  --accent-light: #4dbdff;
  --accent-dark: #031826;
  --accent-glow: rgba(19,162,255,0.22);
  --accent-glow-strong: rgba(19,162,255,0.38);
  --green-bg: #081e12;
  --green-text: #5ddfa0;
  --red: #f87171;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --max-w: 1280px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 20px rgba(19,162,255,0.28);
  --glass-bg: rgba(9,14,23,0.82);
  --glass-border: rgba(255,255,255,0.07);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell { max-width: var(--max-w); margin: 0 auto; padding-bottom: 84px; }

/* ── TOPBAR ────────────────────────────────────────────────── */
.topbar {
  padding: 14px 18px 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
}

.topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-icon { flex-shrink: 0; }

.brand-text {
  font-size: 18px;
  color: #fff;
  letter-spacing: -.4px;
  font-weight: 500;
}
.brand-text strong {
  color: var(--accent);
  font-weight: 800;
}

.cart-btn {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  color: var(--text);
  cursor: pointer;
  padding: 7px;
  transition: background var(--transition), border-color var(--transition);
}
.cart-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: var(--border-strong);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-shortcut-link,
.admin-shortcut-link:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #0f7fd4 0%, #0a5fa0 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  min-height: 32px;
  transition: opacity var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(19,162,255,0.2);
}
.admin-shortcut-link:hover {
  opacity: .88;
  box-shadow: 0 4px 14px rgba(19,162,255,0.35);
}

.cart-count {
  position: absolute; top: -5px; right: -7px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

@media (max-width: 700px) {
  .topbar-row { align-items: center; gap: 8px; }
  .topbar-actions { gap: 6px; max-width: 72%; }
  .admin-shortcuts { gap: 5px; }
  .admin-shortcut-link { padding: 5px 9px; font-size: 11px; }
}

.search-bar {
  position: relative; display: flex; align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  margin-bottom: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-icon { flex-shrink: 0; margin-right: 10px; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); padding: 12px 0; font-size: 14px;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--muted); }

/* ── CONTAINER ─────────────────────────────────────────────── */
.container { padding: 16px 18px 24px; }

/* ── HERO CARD ─────────────────────────────────────────────── */
.hero-card {
  position: relative;
  background: linear-gradient(145deg, #0e1e30 0%, #080f1a 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  padding: 26px 22px 28px;
  margin-bottom: 28px;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -60px; left: -40px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(19,162,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 60%; }
.hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid rgba(94,223,160,0.15);
  padding: 5px 11px; border-radius: 8px; font-size: 11px; font-weight: 600;
  letter-spacing: .4px; margin-bottom: 14px;
}
.hero-label .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green-text);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-card h1 {
  font-size: 26px; line-height: 1.15; font-weight: 800; margin-bottom: 10px;
  letter-spacing: -.4px;
}
.accent { color: var(--accent); }

.hero-desc {
  font-size: 13px; color: var(--text-sub); line-height: 1.6; margin-bottom: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: linear-gradient(135deg, #13a2ff 0%, #0a7fd4 100%);
  color: #fff;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-accent);
  transition: box-shadow var(--transition), transform var(--transition), opacity var(--transition);
  font-family: inherit;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(19,162,255,0.45);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-accent);
}

.hero-img {
  position: absolute; top: 10px; right: 10px; width: 38%; z-index: 1;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.hero-img img {
  width: 100%; max-width: 280px; height: auto; object-fit: contain;
  border-radius: 10px;
}

/* ── SECTION HEADER ────────────────────────────────────────── */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.section-header h3 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.link-accent {
  color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 600;
  transition: color var(--transition);
}
.link-accent:hover { color: var(--accent-light); }
.badge {
  background: rgba(19,162,255,0.15);
  color: var(--accent-light);
  border: 1px solid rgba(19,162,255,0.25);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

/* ── CATEGORIES ────────────────────────────────────────────── */
.categories { margin-bottom: 28px; }
.cats-row { display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.cats-row::-webkit-scrollbar { display: none; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); flex-shrink: 0;
}
.cat-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sub);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.cat:hover .cat-icon {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cat span { font-size: 12px; color: var(--text-sub); white-space: nowrap; }

/* ── NOVIDADES (PRODUCTS) ──────────────────────────────────── */
.novidades { margin-bottom: 28px; }

.featured-product {
  display: flex; gap: 0;
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 14px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.featured-product:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.featured-img {
  width: 42%; min-height: 180px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
  transition: transform 0.35s ease;
  overflow: hidden;
}
.featured-product:hover .featured-img { transform: scale(1.04); }
.featured-body {
  flex: 1; padding: 16px; display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.featured-title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.featured-sub { font-size: 12px; color: var(--text-sub); margin-bottom: 10px; }
.featured-price { font-size: 17px; color: var(--accent); font-weight: 700; }
.featured-body .add-btn { position: absolute; bottom: 14px; right: 14px; }

/* Small product cards — responsive grid */
.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card-sm {
  background: var(--bg-card); border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); position: relative; display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.product-card-sm:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.material-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(22,104,48,0.9); color: #a3f0c0; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; letter-spacing: .3px;
  backdrop-filter: blur(4px);
}
.card-thumb {
  width: 100%; aspect-ratio: 1 / 1;
  background-size: cover; background-position: center;
  transition: transform 0.4s ease;
  overflow: hidden;
}
.product-card-sm:hover .card-thumb { transform: scale(1.06); }
.card-info { padding: 12px; }
.card-name { font-size: 14px; font-weight: 600; display: block; margin-bottom: 8px; line-height: 1.3; }
.card-footer { display: flex; justify-content: space-between; align-items: center; }
.card-price { color: var(--accent); font-weight: 700; font-size: 15px; }

.add-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #13a2ff 0%, #0a7fd4 100%);
  color: #fff; border: none;
  font-size: 20px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(19,162,255,0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}
.add-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(19,162,255,0.5);
}
.add-btn:active { transform: scale(0.97); }

/* ── CTA / CUSTOM PROJECT ─────────────────────────────────── */
.custom-cta {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(19,162,255,0.04) 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(19,162,255,0.14);
  padding: 30px 22px; text-align: center; margin-bottom: 20px;
}
.cta-icon { margin-bottom: 14px; }
.custom-cta h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.2px; }
.custom-cta p { font-size: 13px; color: var(--text-sub); line-height: 1.6; margin-bottom: 16px; }

/* ── BOTTOM NAV ────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(9,14,23,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex; justify-content: center; gap: 0;
  padding: 10px 8px 14px; z-index: 100;
}
.bottom-nav .nav-item { flex: 0 1 140px; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500;
  transition: color var(--transition);
  border-radius: 10px;
  padding: 4px 6px;
}
.nav-item.active { color: var(--accent); }
.nav-item:hover { color: var(--text-sub); }
.nav-item svg { display: block; }

/* ── RESPONSIVE ────────────────────────────────────────────── */

@media (max-width: 480px) {
  .hero-card h1 { font-size: 22px; }
  .hero-card { padding: 20px 16px 22px; }
  .hero-content { max-width: 55%; }
  .hero-img { width: 44%; right: -6px; }
  .hero-img img { max-width: 160px; }
  .btn-primary { font-size: 14px; padding: 12px 16px; }
  .cat-icon { width: 48px; height: 48px; }
  .products-grid { gap: 10px; }
}

@media (min-width: 640px) {
  .topbar { padding: 14px 24px; }
  .container { padding: 18px 24px 24px; }
  .hero-card { padding: 32px 28px 34px; }
  .hero-card h1 { font-size: 32px; }
  .hero-img img { max-width: 280px; }
  .hero-desc { font-size: 14px; }
  .btn-primary { display: inline-flex; width: auto; padding: 14px 28px; }
  .cats-row { gap: 16px; }
  .cat-icon { width: 64px; height: 64px; }
  .cat span { font-size: 13px; }
  .section-header h3 { font-size: 20px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .featured-product { min-height: 220px; }
  .featured-title { font-size: 18px; }
  .custom-cta { padding: 36px 28px; }
}

@media (min-width: 900px) {
  .topbar { padding: 14px 32px; }
  .container { padding: 22px 32px 28px; }
  .hero-card { padding: 40px 36px 42px; }
  .hero-card h1 { font-size: 38px; }
  .hero-content { max-width: 55%; }
  .hero-img { width: 40%; right: 20px; top: 20px; }
  .hero-img img { max-width: 340px; }
  .hero-desc { font-size: 15px; max-width: 420px; }
  .cats-row { gap: 20px; }
  .cat-icon { width: 72px; height: 72px; border-radius: 18px; }
  .cat-icon svg { width: 28px; height: 28px; }
  .cat span { font-size: 14px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .featured-product { min-height: 260px; }
  .featured-img { width: 35%; }
  .featured-title { font-size: 20px; }
  .featured-price { font-size: 20px; }
}

@media (min-width: 1200px) {
  .hero-card { padding: 48px 44px 50px; }
  .hero-card h1 { font-size: 44px; }
  .hero-img img { max-width: 380px; }
  .hero-desc { font-size: 16px; max-width: 480px; }
  .cats-row { gap: 24px; }
  .cat-icon { width: 80px; height: 80px; }
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .section-header h3 { font-size: 22px; }
  .featured-img { width: 30%; min-height: 300px; }
  .featured-title { font-size: 22px; }
}

/* ===================================================================
   CATALOG PAGE STYLES
   =================================================================== */

.catalog-page-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.4px;
}

/* ── Filters ──────────────────────────────────────────────── */
.catalog-filters {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.filters-row {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }
.filter-group-price { min-width: 180px; flex: 1; }
.filter-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
}

.filter-input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 14px; min-width: 130px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: rgba(255,255,255,0.04);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-sub);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}
.chip:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  color: var(--text);
}
.chip.active {
  background: rgba(19,162,255,0.18);
  color: var(--accent-light);
  border-color: rgba(19,162,255,0.4);
  font-weight: 700;
}

.price-slider {
  width: 100%; accent-color: var(--accent); cursor: pointer;
}
.price-value { font-size: 13px; color: var(--muted); }

/* ── Toggle switch ─────────────────────────────────────────── */
.checkbox-inline {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  cursor: pointer; user-select: none;
}
.checkbox-inline input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 40px; height: 22px; flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  outline: none;
}
.checkbox-inline input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--transition), background var(--transition);
}
.checkbox-inline input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-inline input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: #fff;
}
.checkbox-inline:hover input[type="checkbox"]:not(:checked) {
  border-color: rgba(255,255,255,0.25);
}
.checkbox-inline span { line-height: 1; color: var(--text-sub); transition: color var(--transition); }
.checkbox-inline input[type="checkbox"]:checked ~ span { color: var(--text); }

.btn-filter {
  background: linear-gradient(135deg, #13a2ff 0%, #0a7fd4 100%);
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 22px; font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: box-shadow var(--transition), transform var(--transition);
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(19,162,255,0.25);
}
.btn-filter:hover {
  box-shadow: 0 4px 16px rgba(19,162,255,0.4);
  transform: translateY(-1px);
}
.btn-filter:active { transform: translateY(0); }

#id_size.filter-input { max-width: 360px; width: 100%; box-sizing: border-box; }
.detail-attrs dd { word-break: break-word; max-width: 520px; }

@media (max-width: 720px) {
  #id_size.filter-input { max-width: 100%; }
  .detail-attrs dd { max-width: 100%; }
}

/* ── Catalog Product Grid ─────────────────────────────────── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.catalog-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
}
.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 0 1px rgba(19,162,255,0.12);
  border-color: rgba(19,162,255,0.2);
}

.catalog-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
  position: relative;
}
.catalog-card-img::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(13,22,34,0.6) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.catalog-card:hover .catalog-card-img { transform: scale(1.07); }
.catalog-card:hover .catalog-card-img::after { opacity: 1; }

.catalog-card-body {
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
  position: relative; flex: 1;
}
.catalog-card-name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text); }
.catalog-card-desc {
  font-size: 12px; color: var(--text-sub); line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.catalog-card-price { color: var(--accent); font-weight: 700; font-size: 16px; }
.catalog-card-body .add-btn { position: absolute; bottom: 12px; right: 12px; }

.out-of-stock-label {
  font-size: 11px; color: var(--red); font-weight: 600; letter-spacing: .3px;
}
.empty-msg { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex; gap: 12px; align-items: center;
  justify-content: center; margin-top: 28px; padding: 12px 0;
}
.page-link {
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.page-link:hover {
  background: var(--bg-card-hover);
  border-color: rgba(19,162,255,0.3);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.page-info { font-size: 13px; color: var(--muted); }

/* ── Catalog Responsive ───────────────────────────────────── */
@media (min-width: 640px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .catalog-page-title { font-size: 30px; }
}
@media (min-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .filter-group-price { max-width: 260px; }
}
@media (min-width: 1200px) {
  .catalog-grid { grid-template-columns: repeat(5, 1fr); gap: 20px; }
}
@media (max-width: 480px) {
  .catalog-filters { padding: 14px; }
  .filters-row { gap: 12px; }
  .chips { gap: 6px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .catalog-grid { gap: 10px; }
  .catalog-card-body { padding: 10px; }
}

/* ===== PRODUCT DETAIL ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-bottom: 100px;
}
@media (min-width: 768px) {
  .product-detail { grid-template-columns: 1fr 1fr; align-items: start; gap: 40px; }
}

.detail-gallery { display: flex; flex-direction: column; gap: 10px; }

.detail-main-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  transition: box-shadow var(--transition);
}
.detail-main-img:hover {
  box-shadow: var(--shadow-md);
}

.detail-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-thumb {
  width: 68px; height: 68px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.detail-thumb:hover { transform: scale(1.05); }
.detail-thumb.active,
.detail-thumb:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

.detail-info { display: flex; flex-direction: column; gap: 12px; }

.detail-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -.3px;
}

.detail-description {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin: 0;
  white-space: pre-line;
}

.detail-price {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.3px;
}

.detail-attrs {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 6px 18px;
  align-items: start;
  margin: 4px 0 10px 0;
  font-size: .9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.detail-attrs dt { color: var(--muted); font-weight: 700; margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }
.detail-attrs dd { margin: 0; color: var(--text); word-break: break-word; max-width: 420px; }

.detail-color { margin-top: 4px; }
.detail-color-options {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: .92rem;
  cursor: pointer;
}

.detail-color-option input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  margin: 0;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: transparent;
  display: inline-grid;
  place-content: center;
  transition: border-color .18s ease, transform .12s ease;
}
.detail-color-option input[type="radio"]::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  transform: scale(0);
  transition: transform .14s ease;
  background: var(--accent);
}
.detail-color-option input[type="radio"]:checked { border-color: var(--accent); }
.detail-color-option input[type="radio"]:checked::before { transform: scale(1); }
.detail-color-option input[type="radio"]:focus-visible {
  outline: 2px solid rgba(19,162,255,.45);
  outline-offset: 2px;
}
.detail-color-option:hover input[type="radio"] { transform: scale(1.05); }

.detail-color-swatch {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.22);
  background: transparent;
  flex-shrink: 0;
  transition: box-shadow var(--transition);
}
.detail-color-text { line-height: 1; }
.detail-color-option input[type="radio"]:checked + .detail-color-swatch {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.detail-color-option input[type="radio"]:checked + .detail-color-swatch + .detail-color-text {
  color: var(--accent-light);
  font-weight: 700;
}

@media (max-width: 900px) {
  .detail-attrs { grid-template-columns: 160px 1fr; }
}
@media (max-width: 520px) {
  .detail-attrs { grid-template-columns: 1fr; }
  .detail-attrs dt { margin-top: 10px; }
  .detail-attrs dd { max-width: 100%; }
  .detail-name { font-size: 1.3rem; }
}

/* Make catalog cards fully clickable */
.catalog-card > a.card-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

/* ===== CART DRAWER ===== */
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(400px, 82vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--glass-border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 48px rgba(0,0,0,.6);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.cart-drawer-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }

.cart-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  display: flex;
}
.cart-close-btn:hover { color: var(--text); background: rgba(255,255,255,0.10); }

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-empty {
  text-align: center; color: var(--muted);
  margin-top: 48px; font-size: .9rem;
}

.cart-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
}
.cart-item-img {
  width: 60px; height: 60px; border-radius: 8px;
  background-size: cover; background-position: center;
  background-color: var(--bg-card); flex-shrink: 0;
}
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-item-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--accent); }
.cart-item-qty { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }

.qty-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--text);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  font-family: inherit;
}
.qty-btn:hover { background: rgba(255,255,255,.08); }

.cart-remove-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px; flex-shrink: 0;
  transition: color var(--transition);
  border-radius: 6px;
}
.cart-remove-btn:hover { color: var(--red); }

.cart-drawer-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.cart-total-row {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 1rem; color: var(--text);
}
#cart-total { color: var(--accent); font-size: 1.1rem; }

.cart-checkout-btn {
  width: 100%; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}
.cart-checkout-btn:not(:disabled):hover {
  box-shadow: 0 6px 20px rgba(34,197,94,0.45);
}
.cart-checkout-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.btn-clear-cart {
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer;
  text-align: center; text-decoration: underline;
  transition: color var(--transition);
  font-family: inherit;
}
.btn-clear-cart:hover { color: var(--red); }

/* ===== BOTTOM NAV EXTRAS ===== */
.nav-wa-icon { color: #25D366; }
.nav-item button { font-family: inherit; }

.nav-item .nav-cart-badge {
  position: absolute; top: -5px; right: -7px;
  min-width: 16px; height: 16px; padding: 0 3px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
  border: 2px solid var(--bg);
}

/* Image preview used in novo_produto form */
.image-preview { cursor: pointer; border-radius: 8px; }

/* ===== CALCULADORA DE VENDAS ===== */
.calculadora-form-row { align-items: flex-end; }
.calculadora-field { min-width: 220px; flex: 1 1 220px; }
.calculadora-field .filter-input { width: 100%; }
.calculadora-resultado { margin-top: 16px; }
.calculadora-attrs { grid-template-columns: 220px 1fr; }

@media (max-width: 700px) {
  .calculadora-attrs { grid-template-columns: 1fr; }
}

/* ===== AUTH PAGES (LOGIN / CADASTRO) ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 100px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.4px;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-sub);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-field input,
.auth-field .filter-input {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  font-size: 15px;
}

.auth-divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  margin: 20px 0 32px;
  font-size: .85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--accent-light); }
