:root {
  --bg: #050505;
  --paper: #050505;
  /* Re-added to match theme */
  --ink: #ffffff;
  --ink-muted: #a0a0a0;
  --accent: #d4b483;
  --menu-bg: #0a0a0a;
  --border: #333333;
}

/* Base styles */
*,
*::before,
*::after {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0
}

img {
  max-width: 100%;
  display: block
}

a {
  color: inherit;
  text-decoration: none
}

ul {
  list-style: none;
  margin: 0;
  padding: 0
}

button {
  font: inherit
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  animation: fadeIn 0.8s ease-out;
  /* Sticky Footer Setup */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

h1,
h2,
h3,
h4,
nav a {
  font-family: 'Playfair Display', serif;
}

/* BRAND */
.brand {
  padding: 40px 0;
  text-align: center;
  background: #000000;
}

.brand img {
  height: 100px;
  width: auto;
  margin: auto;
  opacity: 0.9;
}

/* ... */

.page-header {
  max-width: 800px;
  margin: 0 auto 40px;
  /* Reset to 0 top, user said "except subpages" */
  text-align: left;
}

/* Helper for pages that NEED spacing (Home, Over, Contact, Exposities) */
.page-header.with-spacing {
  margin-top: 40px;
}

/* DESKTOP NAV */
.nav-desktop {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.8);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.nav-desktop ul {
  display: flex;
  justify-content: center;
  align-items: center;
  /* Fix vertical alignment */
  gap: 50px;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  display: block;
  padding: 20px 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  transition: color 0.3s;
  position: relative;
}

/* Dropdown Menu */
.nav-desktop li {
  position: relative;
}

.nav-desktop .dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--border);
  min-width: 220px;
  padding: 10px 0;
  display: none;
  flex-direction: column;
  gap: 0;
  text-align: center;
  border-radius: 4px;
}

.nav-desktop li:hover .dropdown {
  display: flex;
}

.nav-desktop .dropdown a {
  padding: 12px 20px;
  font-size: 13px;
  border-bottom: 1px solid #222;
  white-space: nowrap;
}

.nav-desktop .dropdown a:last-child {
  border-bottom: none;
}

.nav-desktop .dropdown a:hover {
  background: #222;
  color: var(--accent);
}

.nav-desktop a:hover {
  color: var(--accent);
}

/* Active State Design */
.nav-desktop a.active {
  color: var(--accent);
}

.nav-desktop a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: 15px;
  /* Subtle underline for hover */
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-desktop a:hover::after {
  width: 100%;
}

.nav-desktop a.active::after {
  bottom: 15px;
  width: 100%;
  height: 1px;
}

/* Override for active */


/* MOBILE HEADER (New) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 20px;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.mobile-logo {
  height: 50px;
  width: auto;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-trigger {
  pointer-events: auto;
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0;
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: none;
}

.menu-trigger span {
  display: none;
  /* Hide text "Menu" to save space or keep? User said "menu button". Let's keep icon. */
}

/* Override trigger style for new layout */
.menu-trigger:hover {
  background: transparent;
  transform: none;
  color: #fff;
}

.burger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.burger-icon span {
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  transition: 0.3s;
}

.menu-trigger:hover .burger-icon span {
  background: #000;
}

/* FULLSCREEN OVERLAY */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--menu-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay-close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-close:hover {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
}

.overlay-menu {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 25px;
  height: 100%;
  justify-content: center;
  padding-bottom: 50px;
}

.overlay-menu a.main-link {
  font-size: 42px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s, transform 0.3s;
  display: block;
  letter-spacing: -0.02em;
}

.overlay-menu a.main-link:hover {
  color: var(--accent);
  transform: scale(1.05);
}

.overlay-menu a.main-link.active {
  color: var(--accent);
}

.overlay-sub {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: -10px;
  margin-bottom: 10px;
}

.overlay-sub a {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  transition: 0.3s;
}

.overlay-sub a:hover {
  color: var(--accent);
}

.overlay-sub a.active {
  color: var(--accent);
}

/* CONTENT */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  padding: 40px 0 80px;
  /* Increased bottom padding for global footer spacing */
  flex: 1;
  min-width: 0;
  /* Enable shrinking in flex container */
  width: 100%;
}

.page-header {
  max-width: 800px;
  margin: 40px auto 40px;
  /* Added top margin */
  text-align: left;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  display: block;
  margin-bottom: 10px;
}

h1 {
  font-size: 42px;
  margin: 0 0 15px;
  color: var(--ink);
}

.gallery-section {
  margin-bottom: 80px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  /* Strict constraint */
}

.gallery-section h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.gallery-section .lead {
  color: var(--ink-muted);
  margin-bottom: 30px;
}

/* Sliders */
.slider-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 20px;
  overflow: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 0 20px;
  scrollbar-width: thin;
  max-width: 100%;
  /* Ensure rail doesn't force parent width */
}

.rail::-webkit-scrollbar {
  height: 4px
}

.rail::-webkit-scrollbar-thumb {
  background: #444
}

.card {
  scroll-snap-align: center;
  background: #0b0b0b;
  border: 1px solid #181818;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3/2;
  height: 320px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  flex: 1;
  cursor: pointer;
  transition: transform 0.5s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card figcaption {
  padding: 15px;
  text-align: left;
  border-top: 1px solid #181818;
}

.caption-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}

.caption-meta {
  display: block;
  font-size: 13px;
  color: #888;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
  font-size: 20px;
}

.arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prev {
  left: -22px;
}

.next {
  right: -22px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300
}

.lightbox.open {
  display: flex
}

.lightbox .frame {
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  position: relative
}

.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Model Viewer for AR Preview */
model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  /* Improved visibility */
  border: 1px solid #fff;
  /* Clearer border */
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  z-index: 1000;
  /* Ensure strictly above model viewer */
}

.lb-close:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.zoom-lens {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: none;
  background-repeat: no-repeat;
  background-color: rgba(0, 0, 0, 0.5);
  /* Fallback */
  pointer-events: none;
  /* Let clicks pass through */
  z-index: 100;
  display: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ar-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  text-align: center;
  z-index: 2000;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  max-width: 80%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.ar-toast.active {
  opacity: 1;
  pointer-events: auto;
}

/* LB Header (Replaces Caption) */
.lb-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 60px 20px 20px;
  /* Right padding for Close button */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  /* Let clicks pass through */
}

.lb-header h3 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lb-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-badge {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 12px;
  backdrop-filter: blur(5px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.lb-badge.outline {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
}

.lb-badge.available {
  background: rgba(46, 204, 113, 0.8);
  color: #fff;
}

.lb-badge.sold {
  background: rgba(231, 76, 60, 0.8);
  color: #fff;
}

.lb-badge.reserved {
  background: rgba(230, 126, 34, 0.8);
  color: #fff;
}

/* Hide Old Caption */
.lb-caption {
  display: none !important;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
  /* Above model viewer */
}

.lb-arrow:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.lb-arrow.prev {
  left: 20px;
}

.lb-arrow.next {
  right: 20px;
}

footer {
  margin-top: 60px;
  /* Added spacing between body and footer */
  border-top: 1px solid var(--border);
  padding: 60px 0;
  text-align: center;
  color: #555;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (max-width: 880px) {

  /* Disable sticky footer flex on mobile to fix scaling issues */
  body {
    display: block;
  }

  .nav-desktop {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  /* Hide default brand on mobile, we use mobile-header logo */
  .brand {
    display: none !important;
  }

  /* Add padding to body or main to account for fixed header (approx 70px) */
  main {
    padding-top: 80px;
  }


  .page-header {
    text-align: center;
  }

  .arrow {
    display: none;
  }

  .prev {
    left: 0;
  }

  .next {
    right: 0;
  }

  /* Mobile Lightbox Optimization */
  .lightbox .frame {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
  }

  .lightbox img {
    object-fit: contain;
  }
}

/* Language Toggle */
.lang-toggle {
  margin-left: 20px;
  display: inline-block;
  color: #888;
  font-size: 0.9em;
  cursor: pointer;
}

.lang-toggle span {
  padding: 0 5px;
}

.lang-toggle span.active {
  color: var(--accent);
  font-weight: bold;
  text-decoration: underline;
}

.lang-toggle span:hover {
  color: #333;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}


/* --- Search UI --- */
.search-trigger {
  cursor: pointer;
  font-size: 1.2rem;
  margin-left: 15px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.search-trigger:hover {
  opacity: 1;
}

/* AR Frame Options */
.frame-options {
  position: absolute;
  bottom: 80px;
  /* Above AR button */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 20px;
  border-radius: 30px;
  z-index: 20;
  backdrop-filter: blur(5px);
}

.frame-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.frame-btn:hover {
  transform: scale(1.1);
}

.frame-btn.active {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--accent);
}

/* Frame Colors for UI */
.frame-btn[data-frame="none"] {
  background: linear-gradient(45deg, #333 50%, #666 50%);
  background-size: 10px 10px;
}

/* Checkerboard for none/transparent */
.frame-btn[data-frame="black"] {
  background: #1a1a1a;
}

.frame-btn[data-frame="white"] {
  background: #f0f0f0;
}

.frame-btn[data-frame="wood"] {
  background: #5d4037;
}

.frame-btn[data-frame="gold"] {
  background: linear-gradient(135deg, #ffd700, #b8860b);
}

/* --- STATUS INDICATORS (Sold/Reserved) --- */
.card {
  position: relative;
  /* For badge positioning */
}

/* Badge on Grid */
/* Badge on Grid */
.card[data-status]::after {
  content: " ";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

/* Ensure card content layout works for captions */
.card {
  display: flex;
  flex-direction: column;
}

.card img {
  flex-grow: 1;
  object-fit: cover;
  height: 250px;
  /* Enforce height consistency */
}

.card figcaption {
  z-index: 10;
}

.card[data-status="sold"]::after {
  background: #ff4757;
  /* Red */
}

.card[data-status="reserved"]::after {
  background: #ffa502;
  /* Orange */
}

/* Lightbox Status Badge */
.lb-status {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.9em;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
}

.lb-status.sold {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.5);
}

.lb-status.reserved {
  background: rgba(255, 165, 2, 0.2);
  color: #ffa502;
  border: 1px solid rgba(255, 165, 2, 0.5);
}

/* --- SLIDESHOW CONTROLS --- */
.lb-slideshow-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 10px;
  transition: color 0.3s, transform 0.2s;
  margin-left: 15px;
  vertical-align: middle;
}

.lb-slideshow-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.lb-slideshow-btn.active {
  color: var(--accent);
}

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.search-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: #fff;
  font-size: 2rem;
  padding: 10px;
  width: 80%;
  max-width: 600px;
  text-align: center;
  font-family: 'Playfair Display', serif;
  outline: none;
}

/* Rich Search Results */
.search-results {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  text-decoration: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  transform: translateX(5px);
}

.search-img-wrap {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.search-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-cat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.8;
  margin-bottom: 0;
}

.search-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.search-meta {
  font-size: 12px;
  color: #888;
}

/* --- LIGHTBOX EXTRAS --- */
.lb-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  font-family: 'Playfair Display', serif;
  white-space: nowrap;
  z-index: 50;
  user-select: none;
}

.lb-inquire-btn {
  position: absolute;
  bottom: 20px;
  right: 80px;
  /* Left of Play button */
  background: var(--accent);
  color: #000;
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  z-index: 20;
  transition: transform 0.2s;
}

.lb-inquire-btn:hover {
  transform: scale(1.05);
  background: #fff;
}

@media (max-width: 480px) {

  /* Stack buttons on small mobile */
  .lb-inquire-btn {
    bottom: 70px;
    /* Move up above AR button */
    right: 50%;
    transform: translateX(50%);
    width: max-content;
  }
}

/* Scale Vis Removed */
.lb-scale-vis,
.human-sil,
.artwork-rect,
.scale-label {
  display: none !important;
}

/* FILTER BAR */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: #fff;
}

.filter-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}