/* =========================
   Base Variables
   ========================= */
:root {
  --bg-1: #f5f5f5;
  --bg-2: #ffffff;
  --bg-3: #e8e8e8;

  --accent: #864128;
  --accent-hover: #a04d30;
  --brown: #d4c4be;

  --text: rgba(0, 0, 0, 0.9);
  --muted: rgba(0, 0, 0, 0.6);

  --padX: 60px;
  
  --font-serif: "Caladea", Georgia, serif;
  --font-sans: "Montserrat", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #f0f0f0;
  color: var(--text);
  font-family: var(--font-sans);
  text-rendering: geometricPrecision;
  font-feature-settings: "kern" 1, "liga" 1, "clig" 1;
}

body {
  position: relative;
  padding-top: 70px;
}

/* Page Transitions */
main {
  animation: pageEnter 0.25s ease forwards;
}

body.page-exit main {
  animation: pageExit 0.15s ease forwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-15px);
  }
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

h1 span,
h2 span {
  color: var(--accent);
}

/* =========================
   Catalog Main
   ========================= */
.catalog-main {
  min-height: 100vh;
  background:
    radial-gradient(900px 450px at 15% 20%, rgba(134, 65, 40, 0.08), transparent 55%),
    radial-gradient(850px 420px at 85% 75%, rgba(134, 65, 40, 0.06), transparent 55%),
    var(--bg-1);
}

.catalog-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px var(--padX) 80px;
}

/* Catalog Hero with Video */
.catalog-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 56px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.catalog-hero-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.15);
}

.catalog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.6) 0%,
    rgba(0,0,0,0.25) 50%,
    rgba(0,0,0,0.15) 100%
  );
  z-index: 1;
}

.catalog-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 24px;
}

.catalog-hero-content h1 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 2.6rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.catalog-hero-content h1 span {
  color: var(--accent);
}

.catalog-hero-content .catalog-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .catalog-hero {
    height: 220px;
    border-radius: 16px;
    margin-bottom: 36px;
  }
  .catalog-hero-content {
    padding: 32px 16px;
  }
  .catalog-hero-content h1 {
    font-size: 1.75rem;
  }
}

/* Catalog Heading (legacy fallback) */
.catalog-heading {
  text-align: center;
  margin-bottom: 56px;
  padding: 12px 0 0;
}

.catalog-heading h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.catalog-heading h1 span {
  color: var(--accent);
}

.catalog-subtitle {
  font-size: 1.05rem;
  color: var(--text-3);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* =========================
   Filters
   ========================= */
.catalog-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* =========================
   Search
   ========================= */
.catalog-search {
  flex: 1;
  max-width: 360px;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 11px 42px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  outline: none;
  background: rgba(255, 255, 255, 1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(134, 65, 40, 0.08);
}

.search-input-wrapper input::placeholder {
  color: var(--muted);
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-clear:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

.search-info {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  display: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.search-info.visible {
  display: block;
}

.search-info.show {
  opacity: 1;
  transform: translateY(0);
}

.catalog-no-results {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.catalog-no-results.visible {
  display: flex;
}

.catalog-no-results.show {
  opacity: 1;
  transform: translateY(0);
}

.catalog-no-results svg {
  opacity: 0.3;
  margin-bottom: 16px;
  color: var(--muted);
}

.catalog-no-results h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  font-weight: 600;
  color: var(--text);
}

.catalog-no-results p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* =========================
   Catalog Grid
   ========================= */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.catalog-item {
  display: block;
  cursor: pointer;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  border: none;
  text-decoration: none;
  color: inherit;
}

.catalog-item:hover {
  /* no shadow, no lift */
}

.catalog-item-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-3);
  border-radius: 16px;
}

.catalog-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s cubic-bezier(.25,.8,.25,1);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.catalog-item:hover .catalog-item-image img {
  transform: scale(1.05);
}

/* Badges */
.catalog-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.badge {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.badge-pdf {
  background: rgba(220, 53, 69, 0.9);
  border-color: rgba(220, 53, 69, 0.4);
  color: #fff;
}

.badge-files {
  background: rgba(134, 65, 40, 0.9);
  border-color: rgba(134, 65, 40, 0.4);
  color: #fff;
}

.badge-images {
  background: rgba(100, 180, 120, 0.9);
  border-color: rgba(100, 180, 120, 0.4);
  color: #fff;
}

/* Color Dots in Catalog */
.catalog-item-colors {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: default;
  transition: transform 0.2s ease;
}

.color-dot:hover {
  transform: scale(1.2);
  z-index: 1;
}

.color-dot.more {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

/* Item Info — below image */
.catalog-item-info {
  padding: 12px 4px 4px;
}

.catalog-item-info h3 {
  margin: 0 0 2px 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-1, #222);
}

.catalog-item-category {
  margin: 0;
  font-size: 12px;
  color: var(--text-3, #999);
  font-weight: 500;
}

/* Empty State */
.catalog-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.catalog-empty svg {
  opacity: 0.3;
  margin-bottom: 20px;
  color: var(--accent);
}

.catalog-empty h2 {
  font-size: 28px;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.catalog-empty p {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 24px 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(134, 65, 40, 0.3);
}

/* =========================
   Modal
   ========================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  animation: modalFadeOut 0.4s ease forwards;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease forwards;
}

.modal.closing {
  animation: modalFadeOut 0.3s ease forwards;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-2);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: scale(0.7) translateY(40px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal.closing .modal-content {
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 1, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(134, 65, 40, 0.9);
  border-color: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}

.modal-body {
  overflow-y: auto;
  max-height: 90vh;
  padding: 40px;
}

.modal-images {
  margin-bottom: 32px;
}

.modal-main-image {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.modal-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-3);
}

.modal-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.modal-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.modal-thumbnail:hover {
  border-color: var(--accent);
}

.modal-thumbnail.active {
  border-color: var(--accent);
}

.modal-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info h2 {
  font-size: 32px;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.modal-category {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(134, 65, 40, 0.2);
  border: 1px solid rgba(134, 65, 40, 0.4);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.modal-description {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 32px;
  white-space: pre-wrap;
}

/* PDF Download Button */
.modal-pdf {
  margin-bottom: 24px;
}

.pdf-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: 12px;
}

.pdf-card .pdf-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(220, 53, 69, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc3545;
}

.pdf-card .pdf-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdf-card .pdf-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #dc3545;
}

.pdf-card .pdf-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pdf-actions {
  display: flex;
  gap: 8px;
}

.pdf-view-btn,
.pdf-download-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pdf-view-btn {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.pdf-view-btn:hover {
  background: rgba(220, 53, 69, 0.25);
  border-color: rgba(220, 53, 69, 0.5);
  transform: translateY(-2px);
}

.pdf-download-btn {
  background: #dc3545;
  color: white;
}

.pdf-download-btn:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.modal-files {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 24px;
}

.modal-files h3 {
  font-size: 20px;
  margin: 0 0 16px 0;
  font-weight: 600;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(134, 65, 40, 0.4);
}

.file-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(134, 65, 40, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.file-info {
  flex: 1;
}

.file-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.file-download {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.file-download:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* =========================
   Category Selection Grid
   ========================= */
.category-grid-section {
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.category-card:hover {
  background: rgba(134, 65, 40, 0.03);
  border-color: rgba(134, 65, 40, 0.25);
}

.category-card:active {
  transform: scale(0.98);
}

.category-card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.75;
  transition: all 0.25s ease;
}

.category-card:hover .category-card-icon {
  opacity: 1;
}

.category-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.category-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Catalog Toolbar */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* Back to Categories */
.back-to-categories {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0;
  font-family: inherit;
  white-space: nowrap;
}

.back-to-categories:hover {
  background: rgba(134, 65, 40, 0.08);
  border-color: rgba(134, 65, 40, 0.3);
  color: var(--accent);
  transform: translateX(-4px);
}

.back-to-categories svg {
  transition: transform 0.2s ease;
}

.back-to-categories:hover svg {
  transform: translateX(-3px);
}

/* (catalog-view-title removed) */

/* =========================
   Responsive
   ========================= */
@media (max-width: 1024px) {
  :root {
    --padX: 40px;
  }
  
  /* catalog-header removed */
}

@media (max-width: 768px) {
  :root {
    --padX: 20px;
  }
  
  body {
    padding-top: 60px;
  }
  
  .catalog-container {
    padding-top: 32px;
    padding-bottom: 40px;
  }
  
  /* catalog-header removed */
  
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .catalog-item {
    border-radius: 12px;
  }
  
  .catalog-item-image {
    border-radius: 12px;
  }
  
  .catalog-item-info {
    padding: 8px 2px 2px;
  }
  
  .catalog-item-info h3 {
    font-size: 13px;
  }
  
  .catalog-item-category {
    font-size: 10px;
  }
  
  .color-dot {
    width: 14px;
    height: 14px;
  }
  
  .catalog-badges {
    top: 8px;
    right: 8px;
  }
  
  .badge {
    padding: 4px 8px;
    font-size: 10px;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .category-card {
    padding: 14px 14px;
    gap: 10px;
  }
  
  .category-card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  
  .category-card-icon svg {
    width: 22px;
    height: 22px;
  }
  
  .category-card-name {
    font-size: 13px;
  }
  
  .category-card-count {
    font-size: 11px;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .catalog-search {
    max-width: 100%;
  }
  
  .back-to-categories {
    padding: 8px 16px;
    font-size: 13px;
    align-self: flex-start;
  }
  
  /* Modal Mobile */
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 95vh;
    max-height: 95dvh;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }
  
  .modal-body {
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: calc(95vh - 20px);
    max-height: calc(95dvh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
  
  .modal-main-image {
    height: 250px;
    border-radius: 8px;
  }
  
  .modal-images {
    margin-bottom: 20px;
  }
  
  .modal-thumbnails {
    gap: 8px;
  }
  
  .modal-thumbnail {
    width: 60px;
    height: 60px;
  }
  
  .modal-info h2 {
    font-size: 22px;
    padding-right: 40px;
  }
  
  .modal-category {
    padding: 4px 10px;
    font-size: 11px;
    margin-bottom: 12px;
  }
  
  .modal-description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
  }
  
  .modal-details {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
  
  .detail-item {
    padding: 12px;
  }
  
  .modal-files,
  .modal-pdf {
    margin-bottom: 16px;
  }
  
  .modal-files h3,
  .modal-pdf h3 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .file-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .file-download {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  
  .pdf-card {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .pdf-actions {
    width: 100%;
    justify-content: center;
  }
  
  .pdf-view-btn,
  .pdf-download-btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .modal-main-image {
    height: 200px;
  }
  
  .category-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .category-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 10px;
  }
  
  .category-card-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
  
  .category-card-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .category-card-name {
    font-size: 13px;
  }
}

/* =========================
   Site Footer
   ========================= */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.85);
  margin-top: 80px;
  font-family: var(--font-sans);
}

.footer-inner {
  padding: 48px var(--padX) 32px;
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 48px;
}

/* About section (left) */
.footer-about {
  padding-right: 24px;
}

.footer-about-title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 14px;
  line-height: 1.3;
}

.footer-about-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

/* Contact columns grid */
.footer-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 36px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 16px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.footer-col li svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.5;
}

.footer-col li a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col li a:hover {
  color: #fff;
}

.footer-col li span {
  color: rgba(255,255,255,0.75);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px var(--padX);
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}

/* When no about section — contacts take full width */
.footer-inner > .footer-contacts:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .site-footer {
    margin-top: 48px;
  }
  .footer-inner {
    padding: 32px 20px 24px;
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-about {
    padding-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 24px;
  }
  .footer-contacts {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom {
    padding: 16px 20px;
  }
}
