/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; max-width: 100%; }
body { max-width: 100%; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f4f4f4; color: #222; }
a { text-decoration: none; color: inherit; }

/* === HEADER === */
.header {
  background: #c0000c;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
body { padding-top: 64px; }
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.logo-arts { color: #fff; }
.logo-comercial { color: #ffd0d0; }

.header-search {
  flex: 1;
  display: flex;
  max-width: 520px;
}
.header-search input {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: 6px 0 0 6px;
  font-size: 14px;
  outline: none;
}
.header-search button {
  background: #8b0000;
  color: #fff;
  border: none;
  padding: 0 16px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 16px;
  transition: background .2s;
}
.header-search button:hover { background: #6a0000; }

.btn-admin {
  background: #fff;
  color: #c0000c;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 6px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.btn-admin:hover { background: #ffd0d0; }

/* === HAMBURGER === */
.btn-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  flex-shrink: 0;
}
.btn-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* === SIDE MENU === */
.side-menu {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  z-index: 300;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.side-menu.open { transform: translateX(0); }

.side-menu-header {
  background: #c0000c;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.side-menu-header .logo { font-size: 18px; font-weight: 800; }
.side-menu-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.side-menu-close:hover { background: rgba(255,255,255,.2); }

.side-menu-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.side-menu-item:hover { background: #ffeaea; color: #c0000c; }

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299;
}
.menu-overlay.open { display: block; }

/* === CARROSSEL === */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  max-height: 420px;
}
.carousel-track {
  display: flex;
  transition: transform .45s ease;
  height: 100%;
}
.carousel-slide {
  min-width: 100%;
  position: relative;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.carousel-slide a { display: block; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  color: #fff;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.carousel-btn:hover { background: rgba(192,0,12,.8); }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.carousel-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  border: none;
  transition: background .2s, transform .2s;
}
.carousel-dot.active { background: #fff; transform: scale(1.25); }

@media (max-width: 768px) {
  .carousel { max-height: 200px; }
  .carousel-slide img { max-height: 200px; }
  .carousel-btn { width: 32px; height: 32px; font-size: 14px; }
}

/* === PROMOÇÕES === */
.promo-section {
  max-width: 1400px;
  margin: 24px auto 0;
  padding: 0 24px;
}
.promo-header { margin-bottom: 14px; }
.promo-title {
  font-size: 20px;
  font-weight: 800;
  color: #c0000c;
  letter-spacing: .3px;
}
.promo-track-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.promo-track {
  display: flex;
  gap: 16px;
  overflow: hidden;
  scroll-behavior: smooth;
  flex: 1;
}
.promo-card {
  min-width: 200px;
  max-width: 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.promo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(192,0,12,.18);
  border-color: #c0000c;
}
.promo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fafafa;
  padding: 10px;
}
.promo-card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.promo-card-body { padding: 10px 12px 14px; }
.promo-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.promo-card-code { font-size: 11px; color: #aaa; margin-top: 2px; }
.promo-badge {
  display: inline-block;
  background: #c0000c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.promo-btn {
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.promo-btn:hover { background: #c0000c; color: #fff; border-color: #c0000c; }

@media (max-width: 768px) {
  .promo-section { padding: 0 12px; }
  .promo-card { min-width: 150px; max-width: 150px; }
}

/* === LAYOUT === */
.layout {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* === SIDEBAR === */
.sidebar {
  width: 220px;
  min-width: 180px;
  background: #fff;
  border-radius: 10px;
  padding: 20px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  align-self: flex-start;
}
.sidebar h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  margin-bottom: 10px;
}
.cat-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
}
.cat-toggle svg { transition: transform .25s; flex-shrink: 0; }
.cat-toggle.open svg { transform: rotate(180deg); }
.cat-list { overflow: hidden; transition: max-height .4s ease, opacity .3s ease; max-height: 3000px; opacity: 1; }
.cat-list.collapsed { max-height: 0; opacity: 0; }
.sidebar ul { list-style: none; }
.sidebar ul li {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.sidebar ul li:hover { background: #ffeaea; color: #c0000c; }
.sidebar ul li.active { background: #c0000c; color: #fff; font-weight: 600; }
.sidebar ul li.cat-promo { color: #c0000c; font-weight: 700; }
.sidebar ul li.cat-promo:hover { background: #ffeaea; }
.sidebar ul li.cat-promo.active { background: #c0000c; color: #fff; }

.price-filter { display: flex; flex-direction: column; gap: 8px; }
.price-filter input {
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.price-filter input:focus { border-color: #c0000c; }

/* === MAIN === */
.main { flex: 1; min-width: 0; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.toolbar span { font-size: 13px; color: #666; }
.toolbar select {
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.toolbar select:focus { border-color: #c0000c; }

/* === PRODUCT GRID === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.product-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(192,0,12,.15);
}
.card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fafafa;
  padding: 12px;
}
.card-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ccc;
}
.card-body { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card-category {
  font-size: 11px;
  background: #ffeaea;
  color: #c0000c;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
  font-weight: 600;
}
.card-name { font-size: 14px; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.card-code { font-size: 11px; color: #999; }
.card-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #c0000c;
}
.card-price.no-price { font-size: 13px; color: #aaa; font-weight: 400; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #aaa;
  font-size: 16px;
}

/* === MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 14px;
  max-width: 820px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
  transition: background .15s;
}
.modal-close:hover { background: #c0000c; color: #fff; }
.modal-content { display: flex; gap: 0; }
.modal-img-wrap {
  width: 44%;
  min-width: 200px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border-radius: 14px 0 0 14px;
}
.modal-img-wrap img { max-width: 100%; max-height: 320px; object-fit: contain; }
.modal-info { flex: 1; padding: 36px 32px; display: flex; flex-direction: column; gap: 10px; }
.badge {
  background: #ffeaea;
  color: #c0000c;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  align-self: flex-start;
}
.modal-info h2 { font-size: 22px; line-height: 1.3; }
.modal-info .code { font-size: 12px; color: #999; }
.modal-info .desc { font-size: 14px; color: #555; line-height: 1.6; }
.modal-price { font-size: 26px; font-weight: 800; color: #c0000c; margin-top: 8px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .layout { flex-direction: column; padding: 0 12px; }
  .sidebar { width: 100%; position: static; }
  .header-inner { gap: 10px; padding: 0 12px; }
  .logo { font-size: 16px; white-space: nowrap; flex-shrink: 0; }
  .header-search { max-width: 100%; }
  .btn-admin { display: none; }
  .modal-content { flex-direction: column; }
  .modal-img-wrap { width: 100%; border-radius: 14px 14px 0 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
