﻿:root {
  --bg: #0f1117;
  --bg-soft: #171923;
  --surface: #ffffff;
  --surface-soft: #f4f5f8;
  --primary: #6200ee;
  --primary-strong: #4f00c2;
  --text-dark: #1a1b22;
  --text-mid: #5e6273;
  --text-light: #ebecf5;
  --line: #e4e6ee;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --shadow-soft: 0 10px 24px rgba(15, 17, 23, 0.14);
}

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

body {
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at top right, #1a1230 0%, #0f1117 55%);
  color: var(--text-light);
  min-width: 320px;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  background: rgba(15, 17, 23, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.header.scrolled {
  background: rgba(12, 13, 20, 0.98);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: min-height 220ms ease;
}

.header.scrolled .header-inner {
  min-height: 56px;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-right: auto;
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.cart-icon {
  position: relative;
}

#cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-row {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition: max-height 220ms ease, opacity 180ms ease, padding-bottom 220ms ease;
}

.header.search-open .search-row {
  max-height: 72px;
  opacity: 1;
  padding-bottom: 8px;
}

.search-row input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.92rem;
}

.search-row input::placeholder {
  color: rgba(235, 236, 245, 0.74);
}

.search-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98, 0, 238, 0.25);
}

.chips-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}

.chips-wrap::-webkit-scrollbar {
  display: none;
}

.chip {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  color: #ececff;
  cursor: pointer;
  transform: translateY(8px);
  opacity: 0;
  animation: chipIn 360ms ease forwards;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.16);
}

.chip.active {
  background: var(--primary);
  color: #fff;
}

.chips-wrap .chip:nth-child(1) { animation-delay: 20ms; }
.chips-wrap .chip:nth-child(2) { animation-delay: 60ms; }
.chips-wrap .chip:nth-child(3) { animation-delay: 100ms; }
.chips-wrap .chip:nth-child(4) { animation-delay: 140ms; }
.chips-wrap .chip:nth-child(5) { animation-delay: 180ms; }
.chips-wrap .chip:nth-child(6) { animation-delay: 220ms; }
.chips-wrap .chip:nth-child(7) { animation-delay: 260ms; }

.page-content {
  padding-top: 92px;
  padding-bottom: 48px;
  display: grid;
  gap: 24px;
}

#home-section,
#categories-section,
#profile-section {
  scroll-margin-top: 112px;
}

.home-anchor {
  display: grid;
  gap: 6px;
}

.home-anchor h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.category-pill {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-m);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.category-image {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-m);
}

.category-pill.active {
  background: rgba(98, 0, 238, 0.14);
  border-color: rgba(169, 140, 255, 0.75);
}

.category-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
}

#count {
  color: rgba(235, 236, 245, 0.9);
  font-weight: 500;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  color: var(--text-dark);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card.animate-in {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  animation: cardIn 320ms ease forwards;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(15, 17, 23, 0.22);
}

.card-media {
  position: relative;
  padding: 12px;
  background: var(--surface-soft);
}

.card img {
  width: 100%;
  height: 156px;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(15, 17, 23, 0.18));
  cursor: zoom-in;
}

.card-body {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.card-body h3 {
  font-size: 0.95rem;
  line-height: 1.3;
  font-weight: 800;
}

.card-subtitle {
  color: var(--text-mid);
  font-size: 0.78rem;
  font-weight: 500;
}

.card-price {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 800;
}

.card button.add-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-m);
  padding: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.card button.add-btn:hover {
  background: var(--primary-strong);
}

.not-found {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 0;
  color: rgba(235, 236, 245, 0.72);
}

.profile-section {
  background: linear-gradient(160deg, rgba(98, 0, 238, 0.24), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-l);
  padding: 20px;
  display: grid;
  gap: 10px;
}

.profile-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-section p {
  font-size: 0.88rem;
  color: rgba(235, 236, 245, 0.84);
}

.profile-section a {
  width: fit-content;
  padding: 10px 14px;
  border-radius: var(--radius-m);
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.cart {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100%;
  background: #141722;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  transform: translateX(100%);
}

.cart:not(.hidden) {
  transform: translateX(0);
}

.cart-header,
.cart-footer {
  padding: 16px;
  border-color: rgba(255, 255, 255, 0.12);
}

.cart-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-close-btn {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius-s);
  background: #fff;
}

.cart-item-info h4 {
  font-size: 0.88rem;
}

.cart-item-info p {
  color: #cfd2e6;
  font-size: 0.78rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cart-item-quantity button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #252a3c;
  color: #fff;
  cursor: pointer;
}

.cart-item-remove {
  margin-left: 8px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cart-total span {
  color: #9f75ff;
  font-weight: 700;
}

.whatsapp-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-m);
  padding: 12px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.footer {
  margin-top: auto;
  padding: 20px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.footer-container {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.footer p,
.footer a {
  font-size: 0.84rem;
  color: #cfd1df;
}

.footer a {
  color: #a98cff;
}

.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  z-index: 40;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 0s;
}

.back-to-top:hover {
  background: var(--primary-strong);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(480px, 92vw);
  background: #121525;
  color: #fff;
  border-radius: var(--radius-l);
  padding: 20px;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.image-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.image-fullscreen-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chipIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .header-inner {
    min-height: 72px;
  }

  .search-row {
    max-width: 520px;
    margin: 0 auto;
  }

  .page-content {
    padding-top: 104px;
    gap: 32px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 240px));
    justify-content: start;
    gap: 20px;
  }

  .category-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .card img {
    height: 186px;
  }

  .footer {
    padding-bottom: 28px;
  }

  .back-to-top {
    right: 24px;
    bottom: 24px;
  }
}

@media (min-width: 1180px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }

  .category-row {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}
