*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.header {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #f9fafb;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.site-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.main {
  max-width: 1200px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1rem;
}

/* Category buttons */
.filters {
  margin-bottom: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.filter-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.filter-button.active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.product-card {
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  border-color: #d1d5db;
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 62%;
  background: radial-gradient(circle at top left, #e5e7eb, #f9fafb);
}

.product-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(17, 24, 39, 0.88);
  color: #f9fafb;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.product-body {
  padding: 0.8rem 0.9rem 0.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.product-meta {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.product-footer {
  padding: 0 0.9rem 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
}

.tag-pill {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #eef2ff;
  color: #3730a3;
}

/* Video thumbnail button */
.video-thumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.video-thumb-btn:hover {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
  transform: translateY(-1px);
}

.video-thumb-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.video-thumb-icon::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-left: 2px;
}

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

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.modal-content {
  position: relative;
  background: #111827;
  color: #f9fafb;
  border-radius: 1rem;
  padding: 1rem 1rem 1.2rem;
  margin: 1rem;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  z-index: 10;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #e5e7eb;
}

.modal-body {
  margin-top: 0.5rem;
}

.modal-title {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-video {
  width: 100%;
  max-height: 420px;
  border-radius: 0.6rem;
  border: 1px solid #374151;
  background: #000;
}

.modal-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #d1d5db;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  padding: 1rem 1rem 1.5rem;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .site-title {
    font-size: 1.4rem;
  }

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