/* Categoria page — filterable product browse */

.cat-header{
  background: linear-gradient(180deg, var(--cream) 0%, white 100%);
  padding: 40px 0 0;
  border-bottom: 1px solid var(--line);
}
.crumbs{
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-family: var(--mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}
.crumbs a{ color: var(--ink-2); transition: color .15s ease; }
.crumbs a:hover{ color: var(--blue-700); }
.crumbs span{ opacity: 0.5; }
.cat-header h1{
  font-family: var(--serif); font-size: clamp(40px, 5vw, 64px);
  font-weight: 400; letter-spacing: -0.02em;
  color: var(--blue-900);
  margin: 12px 0 6px;
}
.cat-sub{ font-size: 15px; color: var(--ink-2); margin: 0 0 22px; }

.cat-tabs{
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 0 -8px;
}
.cat-tabs a{
  font-size: 14px; padding: 12px 16px;
  color: var(--ink-2);
  position: relative;
  transition: color .15s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cat-tabs a:hover{ color: var(--blue-700); }
.cat-tabs a.is-active{
  color: var(--blue-800);
  border-bottom-color: var(--blue-600);
  font-weight: 500;
}

/* main */
.cat-main{ padding: 32px 0 80px; }

/* sort bar — flow normal (não sticky pra não atrapalhar leitura) */
.sortbar{
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  margin-bottom: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 20px -12px rgba(8,51,68,0.08);
  flex-wrap: wrap;
}
.sortbar .count{ font-size: 14px; color: var(--ink-2); }
.sortbar .count strong{ color: var(--ink); font-weight: 600; }
.sortbar .spacer{ flex: 1; }
.sort-wrap{
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
}
.sort-label{
  font-size: 12px; font-family: var(--mono);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.sort-select{
  border: none; background: var(--cream);
  font: 500 13px/1 'Inter', sans-serif;
  color: var(--ink);
  padding: 8px 32px 8px 14px; border-radius: 999px;
  cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230b2e36' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filters-toggle{
  height: 38px; padding: 0 14px;
  border-radius: 10px;
  background: white; border: 1px solid var(--line);
  font: 500 13px/1 'Inter', sans-serif;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
}

/* grid */
.cat-grid{
  display: grid; grid-template-columns: 240px 1fr;
  gap: 32px; padding-top: 8px;
}

/* filters sidebar — sticky discreto, só desktop */
.filters{
  align-self: start;
  padding-right: 8px;
}
@media (min-width: 1024px) {
  .filters {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}
.filters-head{
  display: none; align-items: center; justify-content: space-between;
  padding: 12px 0; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.filters-head h3{ margin: 0; font-family: var(--serif); font-size: 20px; }
.filters-head button{
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--ink-2); border-radius: 8px;
}
.f-title{
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue-600); font-weight: 500;
  margin-bottom: 6px;
}
.f-group{
  border-bottom: 1px dashed var(--line);
  padding: 14px 0;
}
.f-group:last-of-type{ border-bottom: none; }
.f-group summary{
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 500; color: var(--ink);
  padding: 4px 0;
  user-select: none;
}
.f-group summary::-webkit-details-marker{ display: none; }
.f-group summary::after{
  content: '+'; font-size: 18px; font-weight: 300;
  color: var(--ink-3); transition: transform .15s ease;
}
.f-group[open] summary::after{ content: '−'; }
.f-body{
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px;
}
.f-link, .f-check{
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-2);
  cursor: pointer;
  padding: 4px 0;
  transition: color .15s ease;
}
.f-link:hover, .f-check:hover{ color: var(--blue-700); }
.f-check input{
  width: 16px; height: 16px; accent-color: var(--blue-600);
  flex-shrink: 0;
}
.f-check .count{
  margin-left: auto;
  font-size: 11px; color: var(--ink-3);
  font-family: var(--mono);
}

/* swatches */
.f-swatches{
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.f-swatch{
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
}
.f-swatch .dot{
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .15s ease;
}
.f-swatch:hover .dot{ box-shadow: 0 0 0 1.5px var(--blue-500); }
.f-swatch.is-active .dot{ box-shadow: 0 0 0 2px var(--blue-700); }
.f-swatch .lbl{
  font-size: 10px; color: var(--ink-3);
  text-align: center; line-height: 1.1;
}

/* price range */
.price-range{
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}
.price-range label{
  flex: 1; display: flex; flex-direction: column; gap: 4px;
  font-size: 10px; font-family: var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
}
.price-input{
  display: flex; align-items: center;
  background: white; border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px; color: var(--ink-3);
}
.price-input input{
  border: none; outline: none; background: transparent;
  width: 100%; padding: 4px;
  font: 500 13px/1 'Inter', sans-serif;
  color: var(--ink);
}
.price-range .dash{ color: var(--ink-3); padding-top: 16px; }
.apply-price{
  margin-top: 12px;
  height: 34px; width: 100%;
  border: none; border-radius: 8px;
  background: var(--ink); color: white;
  font: 500 12px/1 'Inter', sans-serif;
  letter-spacing: 0.05em; cursor: pointer;
  transition: background .15s ease;
}
.apply-price:hover{ background: var(--blue-800); }

.clear-all{
  margin-top: 20px;
  width: 100%; height: 40px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 10px;
  font: 500 12px/1 'Inter', sans-serif;
  color: var(--ink-2);
  cursor: pointer; letter-spacing: 0.05em;
  transition: all .15s ease;
}
.clear-all:hover{ border-color: var(--blue-500); color: var(--blue-700); }

/* product grid */
.products-grid{
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px 18px;
}
.p-card{
  background: white;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  transition: transform .2s ease;
}
.p-card:hover{ transform: translateY(-3px); }
.p-card .imgs{
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 12px;
  background: #f0eee9;
}
.p-card .imgs img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .35s ease, transform .35s ease;
}
.p-card .imgs > div.main-img{
  position: absolute; inset: 0;
  transition: opacity .35s ease;
}
.p-card .imgs .hover-img{
  opacity: 0;
  transform: scale(1.02);
}
.p-card:hover .imgs .hover-img{ opacity: 1; transform: scale(1); }
.p-card:hover .imgs:has(.hover-img) .main-img{ opacity: 0; }

.p-badge{
  position: absolute; top: 10px; left: 10px;
  z-index: 2;
  font-size: 10px; font-family: var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  background: white; color: var(--ink);
  padding: 4px 8px; border-radius: 6px;
  font-weight: 500;
  box-shadow: 0 4px 8px -2px rgba(8,51,68,0.12);
}
.p-badge.sale{ background: #e25c7c; color: white; }
.p-badge.new{ background: var(--ink); color: white; }

.p-fav{
  position: absolute; top: 10px; right: 10px;
  z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .2s ease, color .15s ease, background .15s ease;
}
.p-card:hover .p-fav{ opacity: 1; }
.p-fav:hover{ color: #e25c7c; background: white; }
@media (hover: none) {
  .p-fav { opacity: 1; }
}

.p-info{ padding: 14px 4px 4px; }
.p-name{
  font: 500 14px/1.3 'Inter', sans-serif;
  color: var(--ink);
  margin: 0 0 8px;
}
.p-price{
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
}
.p-price .now{
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  color: var(--blue-800); letter-spacing: -0.01em;
}
.p-price .old{
  font-size: 13px; color: var(--ink-3);
  text-decoration: line-through;
}
.p-price .off{
  font-size: 11px; color: #e25c7c; font-weight: 600;
  font-family: var(--mono); letter-spacing: 0.04em;
}
.p-installments{
  font-size: 11px; color: var(--ink-3); margin-top: 4px;
}

/* empty state */
.empty-state{
  grid-column: 1 / -1;
  padding: 64px 24px; text-align: center;
  color: var(--ink-3);
}
.empty-state .ico{
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--blue-50);
  color: var(--blue-700);
  display: inline-flex; align-items: center; justify-content: center;
}
.empty-state h3{ margin: 0 0 6px; color: var(--ink); font-family: var(--serif); font-weight: 500; font-size: 22px; }
.empty-state p{ margin: 0; font-size: 14px; }

/* mobile */
.only-mobile{ display: none; }
@media (max-width: 900px){
  .only-mobile{ display: inline-flex; }
  .cat-grid{ grid-template-columns: 1fr; }
  .filters{
    position: fixed; inset: 0; z-index: 200;
    background: white;
    padding: 18px 22px 30px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
    max-height: 100vh;
  }
  body.filters-open .filters{ transform: translateX(0); }
  body.filters-open{ overflow: hidden; }
  .filters-head{ display: flex; }
  .products-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px){
  .products-grid{ grid-template-columns: 1fr 1fr; gap: 16px 12px; }
}

/* ===========================================================
   DARK MODE — categoria page
   =========================================================== */
[data-theme="dark"] body { background: #0a1622 !important; color: #ecfeff; }
[data-theme="dark"] .topbar { background: linear-gradient(135deg, #0a1f3d 0%, #142a4f 100%); color: rgba(255,255,255,0.85); }
[data-theme="dark"] header.nav { background: #14202d !important; border-color: #2a4865 !important; }
[data-theme="dark"] .nav .logo, [data-theme="dark"] .nav .wordmark { color: #ecfeff; }
[data-theme="dark"] .back { color: #b8d6e6; }
[data-theme="dark"] .back:hover { background: rgba(103,232,249,0.08); color: #67e8f9; }

[data-theme="dark"] .cat-header {
  background: linear-gradient(180deg, #0f1a26 0%, #14202d 100%) !important;
  border-color: #2a4865 !important;
}
[data-theme="dark"] .cat-header h1 { color: #ecfeff; }
[data-theme="dark"] .cat-sub { color: #b8d6e6; }
[data-theme="dark"] .crumbs a { color: #b8d6e6; }
[data-theme="dark"] .crumbs span { color: #7a99ab; }

[data-theme="dark"] .cat-tabs a { color: #b8d6e6; }
[data-theme="dark"] .cat-tabs a:hover { color: #67e8f9; }
[data-theme="dark"] .cat-tabs a.is-active { color: #d4af6a; border-bottom-color: #d4af6a; }

[data-theme="dark"] .sortbar { background: #14202d !important; border-color: #2a4865 !important; box-shadow: 0 8px 20px -12px rgba(0,0,0,0.5); }
[data-theme="dark"] .sortbar .count { color: #b8d6e6; }
[data-theme="dark"] .sortbar .count strong { color: #ecfeff; }
[data-theme="dark"] .sort-wrap { background: #0f1a26 !important; border-color: #2a4865 !important; }
[data-theme="dark"] .sort-label { color: #7a99ab; }
[data-theme="dark"] .sort-select { background: #14202d; color: #ecfeff; }
[data-theme="dark"] .filters-toggle { background: #14202d; border-color: #2a4865; color: #ecfeff; }

[data-theme="dark"] .filters { color: #ecfeff; }
[data-theme="dark"] .f-title { color: #d4af6a; }
[data-theme="dark"] .f-group { border-color: #2a4865; }
[data-theme="dark"] .f-group summary { color: #ecfeff; }
[data-theme="dark"] .f-group summary::after { color: #7a99ab; }
[data-theme="dark"] .f-link, [data-theme="dark"] .f-check { color: #b8d6e6; }
[data-theme="dark"] .f-link:hover { color: #67e8f9; }
[data-theme="dark"] .f-link.is-active { color: #d4af6a; }
[data-theme="dark"] .f-check .count { color: #7a99ab; }
[data-theme="dark"] .price-input { background: #0f1a26; border-color: #2a4865; color: #ecfeff; }
[data-theme="dark"] .price-input input { color: #ecfeff; }
[data-theme="dark"] .price-range label, [data-theme="dark"] .price-range .dash { color: #7a99ab; }
[data-theme="dark"] .apply-price { background: #d4af6a; color: #0a1622; }
[data-theme="dark"] .apply-price:hover { background: #fbbf24; }
[data-theme="dark"] .clear-all { border-color: #2a4865; color: #b8d6e6; }
[data-theme="dark"] .clear-all:hover { border-color: #d4af6a; color: #d4af6a; }

[data-theme="dark"] .p-card { background: #14202d; border: 1px solid #2a4865; }
[data-theme="dark"] .p-card:hover { border-color: rgba(212,175,106,0.4); box-shadow: 0 24px 48px -20px rgba(0,0,0,0.5); }
[data-theme="dark"] .p-card .imgs { background: #1a2540; }
[data-theme="dark"] .p-name { color: #ecfeff; }
[data-theme="dark"] .p-price .now { color: #ecfeff; }
[data-theme="dark"] .p-price .old { color: #7a99ab; }
[data-theme="dark"] .p-installments { color: #b8d6e6; }
[data-theme="dark"] .p-fav { background: rgba(20,32,45,0.92); color: #b8d6e6; }

[data-theme="dark"] .empty-state { color: #7a99ab; }
[data-theme="dark"] .empty-state .ico { background: #1a2540; color: #67e8f9; }
[data-theme="dark"] .empty-state h3 { color: #ecfeff; }

[data-theme="dark"] footer.foot { color: #7a99ab; }
@media (max-width: 900px) {
  [data-theme="dark"] .filters { background: #0f1a26 !important; }
}
