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

body {
  font-family: 'Arial', sans-serif;
  background: #2a152f;
  color: #f1b7ff;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation (from main.html) */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(42, 21, 47, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(241, 183, 255, 0.1);
  padding: 15px 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { height: 40px; width: auto; }

.nav-links { display: none; gap: 32px; }

.nav-links a {
  color: #f1b7ff;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.3s;
}
.nav-links a:hover { opacity: 1; }

.nav-actions { display: flex; gap: 16px; align-items: center; }

.icon-btn {
  background: transparent;
  border: none;
  color: #f1b7ff;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
  position: relative;
  font-size: 18px;
}
.icon-btn:hover { background: rgba(241, 183, 255, 0.1); }

.cart-badge {
  position: absolute;
  top: -8px; right: -8px;
  background: #f1b7ff; color: #2a152f;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  font-weight: bold;
}

/* Starry Background (from main.html) */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.star {
  position: absolute;
  width: 24px; height: 18px;
  opacity: 0.4;
  animation: twinkle 4s infinite;
  transition: opacity 0.3s ease;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  25% { opacity: 0.7; }
  50% { opacity: 1; }
  75% { opacity: 0.6; }
}

/* Main Content (store page) */
.main-content {
  margin-top: 80px;
  padding: 40px 0;
  position: relative;
  z-index: 10;
}

/* Search and Filters */
.store-header { text-align: center; margin-bottom: 40px; }

.store-title {
  font-size: 3rem; font-weight: bold; margin-bottom: 16px;
  background: linear-gradient(135deg, #f1b7ff, #d8a7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-container {
  max-width: 500px;
  margin: 0 auto 30px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  border-radius: 25px;
  border: 2px solid rgba(241, 183, 255, 0.3);
  background: rgba(241, 183, 255, 0.1);
  color: #f1b7ff;
  font-size: 16px;
  backdrop-filter: blur(10px);
}
.search-input::placeholder { color: rgba(241, 183, 255, 0.6); }
.search-btn {
  position: absolute; right: 5px; top: 5px;
  background: linear-gradient(135deg, #f1b7ff, #d8a7ff);
  border: none; padding: 10px 15px; border-radius: 20px;
  cursor: pointer; color: #2a152f; font-size: 16px;
}

/* Categories */
.categories-container { margin-bottom: 40px; }
.categories-toggle { text-align: center; margin-bottom: 20px; }
.toggle-btn {
  background: rgba(241, 183, 255, 0.2);
  border: 2px solid rgba(241, 183, 255, 0.3);
  color: #f1b7ff;
  padding: 10px 20px; border-radius: 25px;
  cursor: pointer; font-size: 16px; transition: all 0.3s;
}
.toggle-btn:hover { background: rgba(241, 183, 255, 0.3); }

.categories-list {
  display: none; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 20px;
}
.categories-list.active { display: flex; }

.category-btn {
  background: rgba(241, 183, 255, 0.1);
  border: 1px solid rgba(241, 183, 255, 0.3);
  color: #f1b7ff;
  padding: 8px 16px; border-radius: 20px;
  cursor: pointer; transition: all 0.3s; font-size: 14px;
}
.category-btn:hover,
.category-btn.active {
  background: linear-gradient(135deg, #f1b7ff, #d8a7ff);
  color: #2a152f;
}

/* Products Grid */
.products-container { margin-bottom: 40px; }

.products-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 30px;
}
.products-count { font-size: 18px; opacity: 0.8; }

.sort-select {
  background: rgba(241, 183, 255, 0.1);
  border: 1px solid rgba(241, 183, 255, 0.3);
  color: #f1b7ff; padding: 8px 12px;
  border-radius: 8px; cursor: pointer;
}

/* === Fixed columns, no stretch === */
.products-grid{
  --card-w: 300px;
  --gap: 25px;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* exactly 3 columns */
  gap: var(--gap);

  /* limit total grid width to 3 cards + 2 gaps, then center */
  max-width: calc(3 * var(--card-w) + 2 * var(--gap));
  margin-inline: auto;
  justify-content: center;
}

.product-card {
  background: rgba(241, 183, 255, 0.1);
  border: 1px solid rgba(241, 183, 255, 0.2);
  border-radius: 15px; overflow: hidden;
  transition: all 0.3s; backdrop-filter: blur(10px);
  position: relative;
}
.product-card:hover {
  background: rgba(241, 183, 255, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(241, 183, 255, 0.2);
}

.product-image {
  width: 100%; height: 220px;
  background: linear-gradient(135deg, rgba(241, 183, 255, 0.2), rgba(216, 167, 255, 0.2));
  position: relative; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-image img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}

.product-badge {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, #f1b7ff, #d8a7ff);
  color: #2a152f; padding: 4px 8px; border-radius: 12px;
  font-size: 12px; font-weight: bold;
}

.product-info { padding: 20px; }

.product-category {
  font-size: 12px; opacity: 0.7;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px;
}
.product-title { font-size: 18px; font-weight: bold; margin-bottom: 8px; line-height: 1.3; }
.product-description { font-size: 14px; opacity: 0.8; margin-bottom: 12px; line-height: 1.4; }

.product-footer { display: flex; justify-content: space-between; align-items: center; }
.price { font-size: 20px; font-weight: bold; color: #f1b7ff; }
.price-original { font-size: 14px; opacity: 0.6; text-decoration: line-through; margin-left: 8px; }

/* Responsive */
@media (min-width: 768px) {
  .nav-links { display: flex; }
}

@media (max-width: 767px) {
  .store-title { font-size: 2rem; }
  .slide-cart { width: 100%; right: -100%; } /* slide-cart comes from main.html */
  .products-header { flex-direction: column; gap: 15px; align-items: stretch; }
  .categories-list { justify-content: flex-start; }

  /* exactly 2 columns on mobile, centered, no stretch */
  .products-grid{
    --card-w: 260px;
    --gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    max-width: calc(2 * var(--card-w) + 1 * var(--gap));
  }
}

@media (max-width: 480px) {
  .container { padding: 0 15px; }
}

/* Empty/Loading states */
.loading {
  text-align: center; padding: 40px; font-size: 18px; opacity: 0.7;
}
.no-results {
  text-align: center; padding: 40px; opacity: 0.7;
}
.no-results h3 { margin-bottom: 10px; }
