/* =========================================================
   SamsonArt — Global Stylesheet
   Theme: Dark Urban Gallery — Graffiti meets Luxury
   ========================================================= */

@font-face {
  font-family: 'YoungerThanMe';
  src: url('../fonts/YoungerThanMe.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* --- Variables --- */
:root {
  --purple:      #3d2a72;
  --purple-lt:   #5a3da0;
  --red:         #c0282a;
  --red-lt:      #e03030;
  --dark:        #060408;
  --dark2:       #0e0a18;
  --text:        #e8ddd0;
  --muted:       #8a7a6a;
  --glass:       rgba(10, 6, 22, 0.78);
  --glass2:      rgba(8, 5, 18, 0.88);
  --border:      rgba(61, 42, 114, 0.45);
  --border2:     rgba(192, 40, 42, 0.35);
  --nav-h:       150px;
  --radius:      12px;
  --font-head:   'YoungerThanMe', sans-serif;
  --font-ui:     'YoungerThanMe', 'Barlow Condensed', sans-serif;
  --font-body:   'Crimson Pro', serif;
  --glow-red:    0 0 24px rgba(192,40,42,0.5), 0 0 60px rgba(192,40,42,0.2);
  --glow-purple: 0 0 20px rgba(61,42,114,0.6);
  --bg-h:        52vh;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================================
   FIXED BACKGROUND LAYER
   ========================================================= */
#bg-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom:0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.half-opacity {
  opacity: 40%;
}

#bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  filter: brightness(0.82) saturate(0.8) sepia(0.08);
  z-index: 2;
}

#bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(ellipse 60% 80% at 20% 50%, transparent 0%, rgba(6,4,14,0.18) 100%),
              linear-gradient(to right, rgba(6,4,14,0.0) 0%, rgba(6,4,14,0.40) 100%),
              linear-gradient(to bottom, rgba(6,4,14,0.06) 0%, rgba(6,4,14,0.22) 100%);
}

#eyes-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* =========================================================
   FIXED LOGO
   ========================================================= */
#logo-wrap {
  position: fixed;
  top: calc(var(--nav-h) - 10.5vw);
  left: 24px;
  z-index: 5;
  pointer-events: none;
}

#logo-wrap img {
  height: 20vw;
  width: auto;
  filter: drop-shadow(0 4px 24px rgba(192,40,42,1));
  opacity: 0.97;
}

/* =========================================================
   FIXED STAMP
   ========================================================= */
#stamp-wrap {
  position: fixed;
  bottom: 20px;
  right: 28px;
  z-index: 150;
  pointer-events: none;
  animation: stamp-float 5s ease-in-out infinite;
}

#stamp-wrap img {
  height: 180px;
  width: auto;
  opacity: 0.55;
  filter: drop-shadow(0 0 18px rgba(61,42,114,0.6));
}

@keyframes stamp-float {
  0%, 100% { transform: translateY(0px) rotate(-3deg); }
  50%       { transform: translateY(-8px) rotate(-3deg); }
}

/* =========================================================
   NAVIGATION
   ========================================================= */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px 0 0;
  gap: 6px;
  background: linear-gradient(to bottom, rgba(6,4,14,0.96) 0%, rgba(6,4,14,0.7) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}


#nav-logo {
  display: none;
  align-items: center;
  flex-shrink: 0;
  margin-right: 8px;
  text-decoration: none;
}
#nav-logo img {
  height: calc(var(--nav-h) - 16px);
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(192,40,42,0.45));
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(61,42,114,0.22);
}

.nav-link.active {
  color: var(--text);
  border-color: var(--red);
  background: rgba(192,40,42,0.18);
  box-shadow: var(--glow-red);
}

.nav-admin {
  margin-left: 0;
  color: var(--muted) !important;
  border-color: var(--border) !important;
  background: rgba(255,255,255,0.04) !important;
}

.nav-admin:hover {
  color: var(--text) !important;
  border-color: var(--purple-lt) !important;
  background: rgba(61,42,114,0.28) !important;
  box-shadow: var(--glow-purple) !important;
}

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
#main-content {
  position: fixed;
  top: calc(var(--nav-h) + 180px + 12px);
  left: 40px;
  bottom: 0;
  width: calc(56vw - 40px);
  z-index: 10;
  padding: 0 20px 8px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) transparent;
}

.hero-tagline {
  position: fixed;
  top: calc(var(--nav-h) + 50px + 14px);
  left: 0;
  right: 0;
  text-align: center;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 1.9rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
  z-index: 15;
  pointer-events: none;
}

.hero-tagline span {
  display: inline-block;
  padding: 7px 20px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--glass);
  backdrop-filter: blur(6px);
}

/* =========================================================
   CATEGORY SECTIONS (HOME)
   ========================================================= */
.cat-section {
  margin-bottom: 16px;
  background: rgba(6, 4, 14, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 8px;
}

.cat-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.cat-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1;
  text-shadow: 0 0 40px rgba(192,40,42,0.25);
}

.cat-title::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  margin-left: 12px;
  vertical-align: middle;
  box-shadow: var(--glow-red);
}

.view-all {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  background: none;
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.view-all:hover {
  background: rgba(192,40,42,0.18);
  box-shadow: var(--glow-red);
  color: var(--red-lt);
}

/* =========================================================
   CAROUSEL
   ========================================================= */
.car-wrapper {
  position: relative;
  overflow: hidden;
}

.car-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 6px 4px 12px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.car-track::-webkit-scrollbar { display: none; }

.car-card {
  flex: 0 0 180px;
  height: 135px;
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
  background: rgba(14, 10, 24, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s;
}

.car-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), var(--glow-purple);
  border-color: var(--purple-lt);
}

.car-card img,
.car-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-card:hover img,
.car-card:hover video { transform: scale(1.06); }

.media-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  pointer-events: none;
  transition: opacity 0.25s;
}
.car-card:hover .media-play-badge,
.grid-card:hover .media-play-badge { opacity: 0; }

.car-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6,4,14,0.85) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  opacity: 0;
  transition: opacity 0.25s;
}

.car-card:hover .car-overlay { opacity: 1; }

.car-overlay span {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  text-transform: uppercase;
}

.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 2.2rem;
  line-height: 1;
  width: 44px;
  height: 72px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.car-btn:hover {
  background: rgba(61,42,114,0.55);
  border-color: var(--purple-lt);
  box-shadow: var(--glow-purple);
}

.car-prev { left: 0; }
.car-next { right: 0; }

/* =========================================================
   CATEGORY PAGE
   ========================================================= */
.cat-page-header {
  text-align: left;
  padding: 0 0 16px;
}

.cat-page-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0.08em;
  color: var(--text);
  text-shadow: 0 0 80px rgba(192,40,42,0.3);
  line-height: 1;
}

.cat-page-count {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 12px;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.grid-card {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
  background: var(--dark2);
  transition: transform 0.28s ease, box-shadow 0.28s, border-color 0.28s;
}

.grid-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 18px 45px rgba(0,0,0,0.65), var(--glow-purple);
  border-color: var(--purple-lt);
}

.grid-card img,
.grid-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.grid-card:hover img,
.grid-card:hover video { transform: scale(1.07); }
.grid-card .car-overlay { opacity: 0; transition: opacity 0.25s; }
.grid-card:hover .car-overlay { opacity: 1; }

/* =========================================================
   NO ART PLACEHOLDER
   ========================================================= */
.no-art {
  text-align: center;
  padding: 60px 20px;
  background: var(--glass);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}

.no-art-icon { font-size: 3rem; display: block; margin-bottom: 16px; }

.no-art p {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  line-height: 1.8;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4,2,10,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox.open #lb-img {
  transform: scale(1);
}

#lb-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.8);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

#lb-close {
  position: absolute;
  top: 20px;
  left: 24px;
  background: var(--glass2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: var(--font-ui);
  font-weight: 700;
}

#lb-close:hover {
  background: rgba(192,40,42,0.35);
  border-color: var(--red);
  box-shadow: var(--glow-red);
}

.lb-title {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}


/* =========================================================
   LOADING SPINNER
   ========================================================= */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   ADMIN PAGE SPECIFICS
   ========================================================= */
#login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), var(--glow-purple);
}

.login-box h1 {
  font-family: var(--font-head);
  font-size: 2.8rem;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 8px;
}

.login-box p {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 36px;
}

#admin-panel {
  position: relative;
  z-index: 4;
  padding: calc(var(--nav-h) + 32px) 20px 48px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(12px);
}

.admin-card h2 {
  font-family: var(--font-head);
  font-size: 1.9rem;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  color: var(--text);
}

.admin-card h2 span { color: var(--red); }

/* Form elements */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 15px;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--purple-lt);
  box-shadow: 0 0 0 3px rgba(61,42,114,0.25);
}

.btn {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.22s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-lt));
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--purple-lt), #7a50d0);
  box-shadow: var(--glow-purple);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.78rem;
}

.btn-danger {
  background: rgba(192,40,42,0.25);
  border: 1px solid var(--border2);
  color: var(--red-lt);
}
.btn-danger:hover { background: rgba(192,40,42,0.45); box-shadow: var(--glow-red); }

#login-error {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--red-lt);
  text-align: center;
  min-height: 20px;
  margin-top: 10px;
}

/* Drop zone */
#drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(61,42,114,0.06);
  margin-bottom: 18px;
}

#drop-zone:hover, #drop-zone.drag-over {
  border-color: var(--purple-lt);
  background: rgba(61,42,114,0.18);
  box-shadow: var(--glow-purple);
}

#drop-zone .dz-icon { font-size: 2.8rem; display: block; margin-bottom: 12px; }

#drop-zone p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

#drop-zone strong { color: var(--text); }

/* Progress */
.progress-wrap {
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  height: 4px;
  margin: 12px 0;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--purple), var(--red));
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

#upload-status {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 22px;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

/* Gallery list */
#gallery-list {
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  transition: background 0.2s;
}

.gallery-item:hover { background: rgba(61,42,114,0.18); }

.gallery-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.item-name {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-lt);
}

.cat-edit-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}

.cat-select {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(61,42,114,0.25);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 130px;
}

.cat-select:focus {
  border-color: var(--purple-lt);
  box-shadow: 0 0 0 2px rgba(61,42,114,0.3);
}

.cat-select option {
  background: #1a1030;
  color: var(--text);
}

.save-cat-btn {
  background: rgba(61,42,114,0.3);
  border: 1px solid var(--border);
  color: #4caf50;
  font-size: 0.8rem;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
}

.save-cat-btn:hover {
  background: rgba(76,175,80,0.25);
  border-color: #4caf50;
  box-shadow: 0 0 10px rgba(76,175,80,0.3);
}

.cat-saved-msg {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.del-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  flex-shrink: 0;
}

.del-btn:hover {
  color: var(--red-lt);
  border-color: var(--border2);
  background: rgba(192,40,42,0.2);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.admin-header h1 {
  font-family: var(--font-head);
  font-size: 2.6rem;
  letter-spacing: 0.08em;
}

.pw-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pw-section h3 {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

#pw-msg {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  min-height: 18px;
  margin-top: 8px;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-lt); }


/* =========================================================
   NAV DROPDOWN — CATEGORIES
   ========================================================= */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-arrow {
  font-size: 0.7em;
  transition: transform 0.2s ease;
  display: inline-block;
}

.nav-dropdown.open .nav-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 1000;
  overflow: hidden;
  animation: dropdown-in 0.15s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown.open .nav-dropdown-menu { display: block; }

.dropdown-item {
  display: block;
  padding: 9px 16px;
  border-radius: 0;
  border-bottom: 1px solid rgba(61,42,114,0.2);
  white-space: nowrap;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover {
  background: rgba(61,42,114,0.35);
  color: #fff;
}
.dropdown-item.active {
  color: var(--red-lt);
  background: rgba(192,40,42,0.12);
}

/* =========================================================
   RESPONSIVE — everything > 900px is BASE STYLES above
   ========================================================= */

/* Dropdown hidden on wide, shown on narrow */
@media (min-width: 901px) {
  .nav-dropdown { display: none; } 
}

/* ── Narrow / Mobile  ≤ 900px ── */
@media (max-width: 900px) {

  /* Variables */
  :root {
    --nav-h:    60px;   
  }

  /* Hide flat category links, show dropdown */
  .nav-cat-wide { display: none; }
  .nav-dropdown { display: inline-block; }

  /* Nav */
  
  #nav-logo  { display: flex; height: calc(var(--nav-h));}
  #main-nav {
    padding: 0 10px;
    justify-content: flex-start;
    gap: 3px;
  }
  #nav-logo img  { height: calc(var(--nav-h) + 50px); filter: drop-shadow(0 4px 12px rgb(221, 87, 89));}
  .nav-link      { font-size: 0.7rem; padding: 5px 8px; }
  .nav-admin     { margin-left: auto; }

  /* Dropdown menu — full width */
  .nav-dropdown-menu {
    position: fixed;
    top: calc(var(--nav-h) *1.5);
    left: 0; right: 0;
    min-width: 100vw;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .dropdown-item { padding: 12px 20px; font-size: 1rem; }

  /* Logo/stamp */
  #stamp-wrap { top: calc(var(--nav-h) + var(--bg-h) - 100px); right: 10px; }
  #stamp-wrap img { height: 70px; }

  /* Hero tagline — slim bar under nav */
  .hero-tagline {
    top: var(--nav-h);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    padding: 6px 0;
    background: rgba(6,4,14,0.7);
    backdrop-filter: blur(6px);
  }
  .hero-tagline span {
    border: none;
    background: none;
    backdrop-filter: none;
    padding: 0;
  }

  /* Background: top half of screen */
  #bg-container {
   height: var(--bg-h);
    bottom: auto;
  }
  #bg-overlay {
    background:
      linear-gradient(to bottom, rgba(6,4,14,0.0) 60%, rgba(6,4,14,0.95) 100%),
      linear-gradient(to right,  rgba(6,4,14,0.0) 0%,  rgba(6,4,14,0.25) 100%);
  }
  /* object-position handled in its own breakpoint block below to match JS MOBILE_BP */

  /* Main content: flows below background */
  #main-content {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-top: calc(var(--bg-h) + 32px);
     padding: 0 14px 20px;
    overflow: visible;
  }

  /* Footer */
  #site-footer { height: var(--footer-h); }

  /* Carousels */
  .car-card { flex: 0 0 150px; height: 110px; }

  /* Lightbox */
  #lb-img { max-height: 80vh; }
  .lb-title { font-size: 0.85rem; }

  /* Category page */
  .cat-page-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .cat-grid-card img { height: 120px; }

  /* Admin — show decorative logo in bg area */
  .is-admin #logo-wrap {
    top: calc(var(--nav-h) - 15vw);
    left: 16px;
  }
  .is-admin #logo-wrap img {
    height: 28vw;
  }
  .isIndex #logo-wrap {
    display: none;
  }

  .admin-grid  { grid-template-columns: 1fr; }
  #admin-panel { padding: calc(var(--nav-h) + 12px) 10px 16px; }
  .admin-card  { padding: 14px 12px; border-radius: 8px; }
  .admin-card h2 { font-size: 1.2rem; margin-bottom: 14px; }
  .admin-header { flex-wrap: wrap; gap: 10px; }
  .admin-header h1 { font-size: 1.8rem; }
  .field       { margin-bottom: 12px; }
  .login-box   { padding: 24px 16px; border-radius: 12px; }
  .login-box h1 { font-size: 2rem; }
  .gallery-item { flex-direction: column; gap: 8px; }
  .gallery-item img { width: 100% !important; height: 120px !important; object-fit: cover; }
  .btn         { padding: 10px 16px; font-size: 0.8rem; }
  #gallery-list { max-height: 60vh; }
}

/* ── Small mobile  ≤ 420px ── */
@media (max-width: 420px) {
  .nav-link    { font-size: 0.62rem; padding: 4px 6px; }
  #bg-container { height: 45vh; }
  #main-content { margin-top: calc(45vh + 28px); }
  .cat-grid    { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  #stamp-wrap { top: calc(var(--nav-h) + 45vh - 100px); }
}

/* Landscape mobile intentionally not handled — portrait layout holds in all orientations */

@media (max-width: 1500px) {
  .nav-link {
    font-size: 0.8rem;
  }
}

/* ── bg-image object-position — must match JS MOBILE_BP (900) exactly ── */
@media (max-width: 900px) {
  #bg-image { object-position: center center; }
}