/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
  --color-bg: #2A1D30;
  --color-text: #fff;
  --color-text-muted: rgba(255, 255, 255, .5);
  --color-btn-text: #363636;
  --font-heading: 'Marcellus', serif;
  --max-width: 42em;
}

/* Links */
a,
a:focus,
a:hover {
  color: var(--color-text);
}

/* Custom default button */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
  color: var(--color-btn-text);
  text-shadow: none;
  background-color: var(--color-text);
  border: .05rem solid var(--color-text);
}

/* Base structure */
html, body {
  height: 100%;
}

body {
  display: flex;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-heading);
}

.cover-container {
  max-width: var(--max-width);
}

/* Cover */
.cover {
  padding: 0 1.5rem;
}
.cover .btn-lg {
  padding: .75rem 1.25rem;
  font-weight: 700;
}
.lead {
  font-size: 1rem;
}

/* Footer */
.mastfoot {
  color: var(--color-text-muted);
}

/* Header layout */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.header-logo {
  width: 20%;
}

.header-title {
  font-size: 3.5rem;
  margin: 0;
}

/* Products grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 280px));
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

.product-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Product gallery */
.product-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  width: 100%;
  margin-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.product-gallery::-webkit-scrollbar {
  height: 6px;
}

.product-gallery::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.product-gallery::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.product-image {
  min-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: opacity 0.2s;
}

.product-image:hover {
  opacity: 0.9;
}

.product-name {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.product-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.product-price {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.loading {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
}

.error {
  grid-column: 1 / -1;
  color: #ff6b6b;
}

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  z-index: 1001;
}

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