:root {
  --bg: #202124;
  --panel: #303134;
  --line: #3c4043;
  --text: #f4f6fb;
  --muted: #aeb4bd;
  --blue: #0a84ff;
  --blue2: #0066cc;
  --white: #fff;
  --soft: #f4f6f8;
  --danger: #e5484d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; }
textarea { min-height: 96px; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 18px;
  background: rgba(32, 33, 36, .95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--blue);
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
}

.brand-logo {
  width: auto;
  max-width: 138px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.nav-pills {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-pills a,
.header-search input,
input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 13px;
}

.nav-pills a {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
}

.header-search {
  flex: 1 1 220px;
  max-width: 300px;
  padding: 0;
  border: 0;
  background: transparent;
}

.header-search input {
  width: 100%;
  height: 40px;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn,
button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  background: #e9edf2;
  color: #111;
  font-weight: 700;
  line-height: 1.2;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue2); }
.btn-light { background: #fff; color: #0d1117; }

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 20px 0 18px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar { display: none; }

.category-pill {
  min-width: 128px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
  margin-bottom: 18px;
}

.section-head h1,
.container h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.section-head a {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.carousel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 22px;
  line-height: 1;
}

.latest-carousel-wrap { overflow: hidden; }

.latest-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(172px, 180px);
  gap: 16px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.latest-carousel::-webkit-scrollbar { display: none; }

.auto-carousel-wrap {
  position: relative;
}

.auto-carousel-wrap::before,
.auto-carousel-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 34px;
  z-index: 2;
  pointer-events: none;
}

.auto-carousel-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.auto-carousel-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg), transparent);
}

.auto-carousel-track {
  width: max-content;
  min-width: 100%;
  animation: carousel-left 34s linear infinite;
  overflow: visible;
}

.auto-carousel-wrap:hover .auto-carousel-track {
  animation-play-state: paused;
}

@keyframes carousel-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.carousel-slide {
  scroll-snap-align: start;
}

.carousel-slide .product-card { height: 100%; }

.home-product-section {
  margin-bottom: 8px;
}

.repair-banner {
  margin-top: 12px;
}

.repair-banner-link {
  min-height: 190px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #0a84ff, #101828);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  overflow: hidden;
}

.repair-banner-copy span,
.repair-page-copy span {
  display: inline-block;
  margin-bottom: 8px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.repair-banner-copy h2 {
  max-width: 560px;
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.repair-banner-copy p {
  max-width: 620px;
  margin: 10px 0 14px;
  color: #eaf4ff;
}

.repair-banner-copy strong {
  color: #fff;
  font-size: 15px;
}

.repair-banner-media {
  height: 150px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  border-radius: 14px;
}

.repair-banner-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.repair-page {
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 28px;
  align-items: center;
  padding: 46px 0 22px;
}

.repair-page-copy h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.08;
}

.repair-page-copy p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.6;
}

.repair-page-media {
  min-height: 330px;
  display: grid;
  place-items: center;
  background: #f7f8fa;
  border-radius: 18px;
}

.repair-page-media img {
  max-height: 290px;
  object-fit: contain;
}

.repair-service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.repair-service-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.repair-service-grid strong {
  display: block;
  margin-bottom: 6px;
}

.repair-service-grid span {
  color: var(--muted);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.product-card {
  background: #f7f8fa;
  color: #111;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

.product-media {
  height: 210px;
  background: #e9ebef;
  display: grid;
  place-items: center;
  padding: 12px;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info { padding: 12px; }

.product-info h3 {
  margin: 8px 0 6px;
  font-size: 15px;
  line-height: 1.25;
}

.product-info p {
  margin: 0 0 8px;
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.price,
.product-info strong {
  font-weight: 850;
}

.chip {
  display: inline-block;
  background: #e8f2ff;
  color: #0369c9;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.brand-card {
  min-height: 82px;
  background: var(--blue);
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.brand-card img { height: 28px; }

.seller-callout,
.info-band {
  margin-top: 46px;
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0a84ff, #0a55aa);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}

.seller-callout p,
.info-band p { color: #eaf4ff; }

.stats { display: grid; gap: 12px; }

.stats a {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 38px 16px;
}

.search-page { padding-top: 26px; }

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr) auto;
  gap: 10px;
  background: #24262a;
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 16px;
}

.filters-store {
  grid-template-columns: 2fr repeat(3, 1fr) auto;
}

.filters input,
.filters select {
  width: 100%;
  border-radius: 12px;
}

.empty { color: var(--muted); }

.product-detail {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 34px;
  padding: 52px 0;
}

.gallery {
  background: #f7f8fa;
  border-radius: 20px;
  min-height: 500px;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gallery img {
  max-height: 420px;
  object-fit: contain;
}

.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
}

.detail-panel h1 {
  font-size: 36px;
  margin: 14px 0;
}

.detail-panel .price {
  font-size: 30px;
  color: #fff;
}

.seller-box {
  display: grid;
  gap: 10px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.product-detail-page {
  width: min(920px, calc(100% - 32px));
  padding: 26px 0 10px;
}

.product-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 38px;
}

.product-action-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-action-link {
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
}

.product-action-link:hover {
  color: var(--blue);
}

.product-action-whatsapp {
  color: #25d366;
}

button.product-action-link {
  background: transparent;
  color: var(--text);
  padding-left: 0;
  padding-right: 0;
}

.product-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
  gap: 32px;
  align-items: start;
}

.product-hero-media {
  aspect-ratio: 1 / 1;
  background: #f7f8fa;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.product-gallery-block {
  display: grid;
  gap: 10px;
}

.product-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
}

.product-gallery-strip a {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #f7f8fa;
  border: 1px solid var(--line);
}

.product-gallery-strip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail-info {
  padding-top: 4px;
}

.product-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.product-detail-info h1 {
  margin: 8px 0 0;
  font-size: 34px;
  line-height: 1.08;
}

.product-detail-price {
  display: block;
  margin-top: 14px;
  color: var(--blue);
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.product-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.product-detail-tags span {
  background: #e8eef7;
  color: #1f2937;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
}

.product-description {
  margin: 18px 0 0;
  color: var(--text);
  line-height: 1.6;
}

.product-whatsapp-main {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .25);
}

.product-whatsapp-main:hover {
  background: #20bd5a;
}

.related-products {
  margin-top: 24px;
}

.store-grid,
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.store-card,
.auth-card,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}

.auth-card {
  width: min(460px, calc(100% - 32px));
  margin: 70px auto;
}

.auth-card form,
.grid-form { display: grid; gap: 14px; }

.auth-card label,
.grid-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.auth-card input,
.grid-form input,
.grid-form select,
.grid-form textarea {
  width: 100%;
  border-radius: 12px;
}

.alert {
  background: #3b1d21;
  color: #ffd7dc;
  padding: 12px;
  border-radius: 12px;
}

.dashboard-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: #f3f5f7;
  color: #111;
}

.sidebar {
  background: #111318;
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar a,
.link-button {
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  color: #e9eef5;
  text-align: left;
}

.sidebar a:hover,
.link-button:hover { background: #20242c; }

.muted { color: var(--muted); }

.dashboard-main {
  padding: 28px;
  overflow: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric-grid article {
  background: #fff;
  border: 1px solid #dde2e8;
  border-radius: 14px;
  padding: 18px;
}

.metric-grid span {
  display: block;
  color: #667085;
}

.metric-grid b { font-size: 28px; }

.admin-card {
  background: #fff;
  color: #111;
  border-color: #dde2e8;
  margin-bottom: 22px;
}

.grid-form { grid-template-columns: repeat(4, 1fr); }
.grid-form .wide { grid-column: span 4; }

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px;
  vertical-align: top;
}

.danger { background: #ffe4e6; color: #be123c; }

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form input,
.inline-form select {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 8px;
  max-width: 130px;
}

.notice {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  padding: 12px 14px;
  border-radius: 12px;
}

.content-form textarea { min-height: 84px; }

.content-preview-logo {
  max-width: 180px;
  max-height: 70px;
  object-fit: contain;
  margin: 8px 0;
  background: #111318;
  border-radius: 10px;
  padding: 8px;
}

.content-preview-banner {
  max-width: 360px;
  max-height: 140px;
  object-fit: contain;
  margin: 8px 0;
  background: #eef2f7;
  border-radius: 12px;
  padding: 8px;
}

.category-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.category-admin-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.category-admin-list span {
  display: block;
  color: #667085;
  font-size: 13px;
}

.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  background: #22c55e;
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.print-page { background: #fff; color: #111; }

.receipt {
  width: 300px;
  margin: 20px auto;
  font-size: 14px;
}

.receipt h1 { text-align: center; }

.receipt-wide {
  width: min(720px, calc(100% - 32px));
}

.receipt table th,
.receipt table td {
  color: #111;
  border-bottom: 1px solid #ddd;
  padding: 8px 4px;
}

.table-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #eef2f7;
  border-radius: 8px;
}

.image-admin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-admin-list form {
  display: grid;
  gap: 6px;
  max-width: 94px;
}

.image-admin-list img {
  width: 72px;
  height: 58px;
  object-fit: contain;
  background: #eef2f7;
  border-radius: 8px;
}

.image-admin-list button {
  padding: 6px 8px;
  font-size: 11px;
}

.content-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.invoice-lines {
  display: grid;
  gap: 10px;
}

.invoice-line {
  display: grid;
  grid-template-columns: 1.25fr 1.4fr .7fr .9fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.ticket-search {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

.ticket-search input {
  min-width: 260px;
}

.ticket-result {
  margin: 18px 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ticket-result article {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.ticket-result article span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 721px) {
  .topbar { flex-wrap: nowrap; }
  .header-search {
    order: 0;
    flex: 1 1 220px;
    max-width: 300px;
  }
}

@media print {
  .receipt { margin: 0; }
  .btn { display: none; }
}

@media (max-width: 980px) {
  .filters { grid-template-columns: 1fr; }
  .filters-store { grid-template-columns: 1fr; }
  .product-detail,
  .dashboard-body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metric-grid,
  .grid-form { grid-template-columns: repeat(2, 1fr); }
  .grid-form .wide { grid-column: span 2; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 24px, 1180px); }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
  }

  .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .nav-actions { margin-left: auto; }

  .brand { font-size: 16px; }

  .nav-pills a {
    padding: 8px 11px;
    font-size: 13px;
  }

  .section-head {
    margin-top: 28px;
    margin-bottom: 15px;
  }

  .section-head h1,
  .container h2 { font-size: 24px; }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-detail-page {
    width: min(100% - 24px, 920px);
    padding-top: 18px;
  }

  .product-actionbar {
    margin-bottom: 12px;
  }

  .product-action-right {
    gap: 10px;
  }

  .product-action-link {
    font-size: 14px;
  }

  .product-detail-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .product-hero-media {
    border-radius: 16px;
  }

  .product-detail-info h1 {
    font-size: 25px;
  }

  .product-detail-price {
    font-size: 32px;
  }

  .latest-carousel {
    grid-auto-columns: calc((100% - 12px) / 2);
    gap: 12px;
  }

  .product-media { height: 158px; }

  .product-info { padding: 10px; }

  .product-info h3 {
    font-size: 14px;
    min-height: 34px;
  }

  .product-info p { font-size: 12px; }

  .brand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .brand-card {
    min-height: 74px;
    font-size: 12px;
  }

  .store-grid,
  .compare-grid { grid-template-columns: 1fr; }

  .repair-banner-link,
  .repair-page {
    grid-template-columns: 1fr;
  }

  .repair-banner-link {
    min-height: 0;
    padding: 18px;
  }

  .repair-banner-copy h2,
  .repair-page-copy h1 {
    font-size: 26px;
  }

  .repair-banner-media {
    height: 132px;
  }

  .repair-service-grid {
    grid-template-columns: 1fr;
  }

  .invoice-line {
    grid-template-columns: 1fr;
  }

  .ticket-search {
    display: grid;
  }

  .ticket-search input {
    min-width: 0;
    width: 100%;
  }

  .seller-callout,
  .info-band {
    display: block;
    padding: 22px;
  }

  .gallery { min-height: 340px; }

  .detail-panel h1 { font-size: 28px; }
  .detail-panel .price { font-size: 26px; }
}

@media (max-width: 420px) {
  .topbar {
    gap: 8px;
    padding: 9px 12px;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .category-strip { padding: 16px 0 14px; }

  .category-pill {
    min-width: 116px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .product-grid { gap: 10px; }
  .product-card { border-radius: 12px; }
  .product-media { height: 142px; padding: 10px; }
  .product-info h3 { font-size: 13px; }
  .chip { font-size: 10px; padding: 4px 8px; }

  .panel-head { align-items: flex-start; flex-direction: column; }
  .metric-grid,
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .wide { grid-column: auto; }

  .whatsapp-float {
    right: 12px;
    bottom: 12px;
    padding: 11px 14px;
  }
}
