/* ============================================
   Musilab Audio - Shared Custom Styles
   Consolidates inline CSS from all SSR templates
   ============================================ */

/* ---- Category Buttons (products page) ---- */
.category-btn {
  display: inline-block;
  text-decoration: none;
  margin-right: 10px;
  margin-bottom: 10px;
  padding: 8px 20px;
  border: 1px solid #369;
  background: white;
  color: #369;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}
.category-btn.active,
.category-btn:hover {
  background: #369;
  color: white;
}

/* ---- Product Cards (index + products pages) ---- */
.product-item {
  margin-bottom: 30px;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(54, 102, 153, 0.2);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 8px 25px rgba(54, 102, 153, 0.15);
  transform: translateY(-3px);
}

.product-card-img-wrapper {
  display: block;
  width: 100%;
  padding-top: 100%;
  position: relative;
  background: #f8f9fa;
  overflow: hidden;
}

.product-card-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.product-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-category {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(54, 102, 153, 0.1);
  color: #369;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.product-card-description {
  flex: 1;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 0.75rem;
}

.product-card-price {
  margin: 0;
  font-weight: 600;
  color: #369;
}

.product-link {
  cursor: pointer;
  transition: opacity 0.3s ease;
  text-decoration: none;
}

.product-link:hover {
  opacity: 0.8;
}

/* ---- Product Tags (detail page) ---- */
.product-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #e8f4fd;
  color: #369;
  border-radius: 15px;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 8px;
}

/* ---- Product Detail Text (detail page) ---- */
.product-detail-text {
  line-height: 1.8;
  white-space: pre-wrap;
  color: #555;
  font-size: 15px;
}

/* ---- Product Gallery (detail page) ---- */
.product-gallery {
  width: 100%;
  margin-bottom: 30px;
}

.gallery-main {
  width: 100%;
  height: 400px;
  background: #f8f9fa;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

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

.gallery-thumbs {
  width: 100%;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: #f8f9fa;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.gallery-thumb.active {
  border-color: #369;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.5);
}

.gallery-nav-prev {
  left: 20px;
}

.gallery-nav-next {
  right: 20px;
}

/* ---- Related Products (detail page) ---- */
.related-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}

.related-product-card-img-wrapper {
  width: 100%;
  padding-top: 70%;
  position: relative;
  background: #f8f9fa;
  border-radius: 4px;
}

.related-product-card-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.related-product-card .card-body {
  padding: 0.5rem 0;
}

.related-product-card .card-title {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
}

.related-product-card .card-title:hover {
  color: #369;
}

.related-link {
  text-decoration: none;
}

/* ---- Breadcrumb ---- */
.breadcrumb-nav {
  padding: 1rem 0;
  background: transparent;
}

.breadcrumb-nav .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
}

.breadcrumb-nav .breadcrumb-item a {
  color: #369;
  text-decoration: none;
}

.breadcrumb-nav .breadcrumb-item.active {
  color: #999;
}

/* ---- Scroll Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Lazy Loading Images ---- */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}
img[loading="lazy"].loaded {
  opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .category-btn {
    padding: 6px 14px;
    font-size: 12px;
  }

  .gallery-main {
    height: 280px;
  }

  .gallery-thumb {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 576px) {
  .product-card-body {
    padding: 1rem;
  }

  .product-card-title {
    font-size: 1rem;
  }

  .gallery-main {
    height: 200px;
  }

  .gallery-thumb {
    width: 50px;
    height: 50px;
  }

  .gallery-nav {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .gallery-nav-prev {
    left: 10px;
  }

  .gallery-nav-next {
    right: 10px;
  }
}
