:root {
  --primary: #b0653b;
  --primary-dark: #8f4e2c;
  --dark: #2b211b;
  --text: #4a3a30;
  --bg: #faf6f1;
  --bg-alt: #f1e8df;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(43, 33, 27, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--dark);
}

.logo span {
  color: var(--primary);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-list a {
  color: var(--dark);
  font-weight: normal;
  transition: color 0.2s;
}

.nav-list a:hover {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--dark);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ---------- Slider ---------- */

.slider-section {
  position: relative;
}

.hero-slider {
  height: 60vh;
  min-height: 380px;
  max-height: 640px;
}

.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.swiper-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.slide-content {
  position: absolute;
  z-index: 1;
  color: var(--white);
  max-width: 720px;
  padding: 20px 24px;
}

.slide-content.pos-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.slide-content.pos-left-bottom {
  left: 24px;
  bottom: 64px;
  text-align: left;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius);
}

.slide-content.pos-right-bottom {
  right: 24px;
  bottom: 64px;
  text-align: right;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius);
}

.slide-content h2 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  margin-bottom: 12px;
}

.slide-content p {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-slider .swiper-pagination-bullet {
  background: var(--white);
  opacity: 0.7;
}

.hero-slider .swiper-pagination-bullet-active {
  background: var(--primary);
  opacity: 1;
}

/* ---------- Sekcije ---------- */

.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--dark);
  margin-bottom: 16px;
}

.section-title-sm {
  margin-top: 40px;
  font-size: 1.4rem;
}

.section-text {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 32px;
}

/* ---------- Galerija ---------- */

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

.collection-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--dark);
  transition: transform 0.2s, box-shadow 0.2s;
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(43, 33, 27, 0.18);
}

.collection-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
}

.collection-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.collection-card:hover .collection-thumb img {
  transform: scale(1.06);
}

.collection-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text);
  font-style: italic;
}

.collection-name {
  display: block;
  padding: 12px 12px 0;
  font-weight: bold;
  font-size: 1.05rem;
}

.collection-count {
  display: block;
  padding: 0 12px 12px;
  font-size: 0.85rem;
  color: var(--primary-dark);
}

.loading {
  text-align: center;
  color: var(--text);
  grid-column: 1 / -1;
  padding: 24px;
}

.empty {
  text-align: center;
  color: var(--text);
  grid-column: 1 / -1;
  padding: 24px;
  font-style: italic;
}

/* ---------- Kontakt ---------- */

.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-info {
  font-size: 1.1rem;
}

.contact-info p {
  margin-bottom: 8px;
}

.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.contact-form-title {
  color: var(--dark);
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.contact-form .btn-primary {
  width: 100%;
  font-size: 1.05rem;
}

/* ---------- PhotoSwipe - info i upit ---------- */

.pswp-product-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 20px 24px;
  pointer-events: none;
  box-sizing: border-box;
}

.pswp-info-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--white);
  font-size: 1rem;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.pswp-info-left .hidden {
  display: none;
}

.pswp-dimension {
  font-weight: bold;
}

.pswp-inquiry {
  pointer-events: auto;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.2s;
  white-space: nowrap;
}

.pswp-inquiry:hover {
  background: var(--primary-dark);
}

/* ---------- Footer ---------- */

.footer {
  background: var(--dark);
  color: #d8cfc6;
  text-align: center;
  padding: 24px 0;
  font-size: 0.9rem;
}

/* ---------- Upload stranica ---------- */

.upload-main {
  padding: 48px 20px;
}

.upload-form {
  max-width: 640px;
  margin: 0 auto 24px;
}

.drop-zone {
  display: block;
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  background: var(--white);
  text-align: center;
  padding: 48px 24px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 16px;
}

.drop-zone.dragover {
  background: #fdf0e6;
  border-color: var(--primary-dark);
}

.drop-text {
  color: var(--primary);
  font-size: 1.1rem;
}

.collection-create {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.collection-create .field-input {
  flex: 1;
}

.collection-create .btn {
  white-space: nowrap;
}

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

.preview-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
}

.preview-item .field-input {
  margin-bottom: 0;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.preview-hint {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.upload-form .btn-primary {
  width: 100%;
  font-size: 1.05rem;
  margin-top: 4px;
}

.btn-ghost {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-ghost:hover {
  background: var(--bg-alt);
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--dark);
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid #d8c9ba;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  color: var(--dark);
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
}

.slider-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-item {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.slider-item img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
}

.slider-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.slider-item-title {
  font-weight: bold;
  color: var(--dark);
}

.slider-item-text {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.slider-item-pos {
  align-self: flex-start;
  font-size: 0.75rem;
  background: var(--bg-alt);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 12px;
}

.slider-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-item-actions .btn {
  font-size: 0.85rem;
  padding: 8px 12px;
  white-space: nowrap;
}

.slider-item-actions .btn-edit {
  background: var(--primary);
}

.slider-item-actions .btn-edit:hover {
  background: var(--primary-dark);
}

.slider-item-actions .btn:not(.btn-edit) {
  background: #b3261e;
}

.slider-item-actions .btn:not(.btn-edit):hover {
  background: #8f1e18;
}

@media (max-width: 600px) {
  .slider-item {
    grid-template-columns: 1fr;
  }
  .slider-item img {
    width: 100%;
    height: 160px;
  }
  .slider-item-actions {
    flex-direction: row;
  }
  .slider-item-actions .btn {
    flex: 1;
  }
}

.upload-status {
  margin-top: 12px;
  text-align: center;
  font-weight: bold;
}

.upload-status.error {
  color: #b3261e;
}

.upload-status.success {
  color: #1e7d32;
}

.admin-collection {
  margin-bottom: 32px;
}

.admin-collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.admin-collection-head h3 {
  color: var(--dark);
  font-size: 1.2rem;
}

.admin-count {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--primary-dark);
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
}

.admin-collection-head .btn-delete {
  background: #b3261e;
  font-size: 0.85rem;
  padding: 8px 12px;
}

.admin-collection-head .btn-delete:hover {
  background: #8f1e18;
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.admin-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
}

.admin-item .admin-name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item .admin-meta {
  font-size: 0.8rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item .btn {
  font-size: 0.85rem;
  padding: 8px 12px;
  background: #b3261e;
}

.admin-item .btn:hover {
  background: #8f1e18;
}

/* ---------- Responsive (mobitel) ---------- */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    display: none;
    padding: 16px 20px 24px;
  }

  .nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .hero-slider {
    height: 55vh;
    min-height: 340px;
  }

  .section {
    padding: 48px 0;
  }

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

  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .collection-create {
    flex-direction: column;
  }

  .collection-create .btn {
    width: 100%;
  }
}
