/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Lilita+One&display=swap');

/* === Variables === */
:root {
  --red: #a4161a;
  --red-dark: #660708;
  --orange: #e38f14;
  --dark: #161a1d;
  --black: #0b090a;
  --gray: #545454;
  --gray-light: #807e7f;
  --bg-light: #f5f3f4;
  --white: #ffffff;
  --content-width: 1290px;
  --font-body: Helvetica, Arial, sans-serif;
  --font-heading: 'Anton', sans-serif;
  --font-button: 'Lilita One', sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--black);
  background: var(--white);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; display: block; }

.site-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header === */
.site-header {
  background: var(--white);
  border-bottom: 5px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.logo:hover { color: var(--red-dark); }
.nav-links {
  display: flex;
  gap: 0;
}
.nav-links a {
  display: inline-block;
  padding: 0.6em 1em;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--white);
  background: var(--dark);
  transition: background 0.2s;
}
.nav-links a:hover {
  background: var(--red);
  color: var(--white);
}

/* === Hero === */
.hero {
  background: var(--bg-light);
  padding: 3rem 1.5rem;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  color: var(--red);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.hero p {
  color: var(--gray);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* === Motif Grid === */
.motif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.motif-card {
  display: block;
  text-align: center;
  background: var(--white);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  color: var(--black);
}
.motif-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transform: translateY(-2px);
  color: var(--black);
}
.motif-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg-light);
}
.motif-card span {
  font-size: 0.9rem;
  font-weight: 700;
  display: block;
  padding: 0.75rem;
}

/* === Section Headings === */
.categories-overview h2,
.recent-motifs h2,
.related-motifs h2,
.other-categories h2 {
  font-family: var(--font-heading);
  font-size: 2em;
  color: var(--dark);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* === Single Motif Page === */
.motif-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.motif-page h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  color: var(--red);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.motif-image {
  text-align: center;
  margin-bottom: 1.5rem;
  background: var(--bg-light);
  border-radius: 5px;
  padding: 1rem;
}
.motif-image img {
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 5px;
}
.motif-description {
  margin-bottom: 1.25rem;
  color: var(--gray);
  font-size: 1.05rem;
  line-height: 1.8;
}
.motif-actions {
  margin-bottom: 1.5rem;
}
.motif-nav {
  margin: 1.5rem 0;
}
.motif-nav a {
  display: inline-block;
  margin-right: 1rem;
  font-weight: 700;
}
.product-link {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-light);
  border-radius: 5px;
  border-left: 4px solid var(--orange);
}
.product-link a {
  font-weight: 700;
  color: var(--dark);
}
.product-link a:hover { color: var(--orange); }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 5px;
  font-size: 1.1rem;
  font-family: var(--font-button);
  cursor: pointer;
  border: none;
  background: var(--dark);
  color: var(--white);
  transition: background 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
}
.btn:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  color: var(--white);
}
.btn-download {
  background: var(--orange);
  color: var(--white);
  font-size: 1.2rem;
  padding: 0.85rem 2.5rem;
}
.btn-download:hover { background: #c77a0e; color: var(--white); }
.btn-buy {
  background: var(--red);
  color: var(--white);
  font-size: 1.2rem;
  padding: 0.85rem 2.5rem;
}
.btn-buy:hover { background: var(--red-dark); color: var(--white); }

/* === Categories === */
.categories-overview {
  max-width: var(--content-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.category-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--dark);
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  text-transform: uppercase;
  transition: background 0.2s;
}
.category-tag:hover { background: var(--red); color: var(--white); }
.category-tag span { opacity: 0.7; }

.category-page h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.category-desc { color: var(--gray); margin-bottom: 1rem; }
.result-count { color: var(--gray-light); font-size: 0.9rem; margin-bottom: 1rem; }
.other-categories { margin-top: 3rem; }

/* === Recent Section === */
.recent-motifs {
  max-width: var(--content-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}
.pagination a {
  padding: 0.5rem 1.25rem;
  background: var(--dark);
  color: var(--white);
  border-radius: 5px;
  font-weight: 500;
  transition: background 0.2s;
}
.pagination a:hover { background: var(--red); color: var(--white); }
.pagination span { color: var(--gray); }

/* === Product Page === */
.product-page {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  padding: 0 1.5rem;
}
.product-page h1 {
  font-family: var(--font-heading);
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.product-cta { margin: 2rem 0; }
.back-link { margin-top: 2rem; }

/* === Related === */
.related-motifs {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  border-top: 3px solid var(--bg-light);
}

/* === Error Page === */
.error-page {
  text-align: center;
  padding: 5rem 1.5rem;
}
.error-page h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.error-page p { margin-bottom: 2rem; color: var(--gray); font-size: 1.1rem; }

/* === Footer === */
.site-footer {
  background: var(--gray);
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
  text-align: center;
  color: var(--white);
  font-size: 0.9rem;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--orange); }

/* === Consent Banner === */
#consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  color: var(--white);
  z-index: 9999;
}
.consent-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.consent-inner p { font-size: 0.85rem; margin: 0; }
.consent-inner a { color: var(--orange); }
.consent-buttons {
  display: flex;
  gap: 0.5rem;
}
.consent-buttons button {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-button);
}
.consent-buttons button:first-child {
  background: var(--orange);
  color: var(--white);
}
.consent-buttons button:first-child:hover { background: #c77a0e; }
.consent-buttons button:last-child {
  background: var(--gray-light);
  color: var(--white);
}

/* === Gallery === */
.gallery-page h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.gallery-seo-text { color: var(--gray); margin-bottom: 1.5rem; font-size: 0.95rem; }

.gallery-filters {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-light);
  border-radius: 5px;
  border: none;
}
.filter-group { margin-bottom: 0.75rem; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--dark);
  text-transform: uppercase;
}
.filter-group select {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--gray-light);
  border-radius: 5px;
  font-size: 0.9rem;
  background: var(--white);
  min-width: 200px;
}
.filter-group select:focus {
  border-color: var(--red);
  outline: none;
}
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag-toggle {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--white);
  border: 2px solid var(--gray-light);
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--dark);
  transition: all 0.15s;
}
.tag-toggle:hover { border-color: var(--red); color: var(--red); }
.tag-toggle.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.tag-toggle span { font-size: 0.75rem; opacity: 0.7; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--dark);
  color: var(--white);
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  font-size: 0.8rem;
}
.remove-filter {
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.remove-filter:hover { color: var(--orange); }
.clear-filters {
  font-size: 0.8rem;
  color: var(--gray-light);
}

.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.gallery-card {
  cursor: default;
  position: relative;
}
.gallery-card img { cursor: pointer; border-radius: 5px; }
.gallery-card .card-title {
  font-size: 0.85rem;
  font-weight: 700;
  display: block;
  margin-top: 0.4rem;
  color: var(--dark);
}
.gallery-card .card-title:hover { color: var(--red); }

.gallery-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-light);
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,9,10,0.9);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-content {
  position: relative;
  background: var(--white);
  border-radius: 5px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--gray);
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}
.lightbox-close:hover { color: var(--red); }
#lightbox-img {
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  margin: 1rem;
}
.lightbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 3px solid var(--bg-light);
  gap: 1rem;
}
.lightbox-footer span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-links a {
    padding: 0.5em 0.7em;
    font-size: 0.8rem;
  }
  .logo { font-size: 1.4rem; }
  .hero { padding: 2rem 1rem; }
}

@media (max-width: 600px) {
  .motif-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .consent-inner { flex-direction: column; text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-group select { width: 100%; min-width: 0; }
  #lightbox-img { max-width: 95vw; max-height: 60vh; margin: 0.5rem; }
  .lightbox-footer { flex-direction: column; text-align: center; }
}
