/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Respect user scaling, prevent inflation quirks */
html {
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Native smooth scroll behavior for anchor links */
html {
  scroll-behavior: smooth;
}

/* Remove default margin & collapse quirks */
body {
  margin: 0;
}
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

/* Lists that explicitly opt out of bullets */
ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}

/* Core body defaults */
body {
  min-height: 100vh; /* fallback */
  min-height: 100dvh; /* stabilnije na mobitelima */
  line-height: 1.5;
}

/* Tighter headings & controls */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance heading wrapping when podržano */
@supports (text-wrap: balance) {
  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }
}

/* Unclassed links: nicer underline, inherit color */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Media are block-level, responsive */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form controls inherit typography */
input,
button,
textarea,
select {
  font: inherit;
  margin: 0;
}
button,
[type='button'],
[type='submit'],
[role='button'] {
  cursor: pointer;
}

/* Textareas without rows aren't tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anchored targets get breathing room */
:target {
  scroll-margin-block: 5ex;
}

/* Visible focus (a11y) */
:focus-visible {
  outline: 2px solid;
  outline-offset: 0.15em;
}

/* System color schemes hint (pomaže UI-u i form kontrolama) */
:root {
  color-scheme: light dark;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html:focus-within {
    scroll-behavior: auto;
  }
}

/**/

:root {
  /* Tipografska skala (fluidna) */
  --fs-300: clamp(0.875rem, 0.85rem + 0.13vw, 1rem);
  --fs-400: clamp(1rem, 0.975rem + 0.13vw, 1.125rem);
  --fs-500: clamp(1.125rem, 1.075rem + 0.25vw, 1.25rem);
  --fs-600: clamp(1.375rem, 1.275rem + 0.5vw, 1.625rem);
  --fs-700: clamp(1.75rem, 1.5rem + 1.25vw, 2.25rem);
  --fs-800: clamp(2.375rem, 2rem + 1.88vw, 3.25rem);
  --fs-900: clamp(3rem, 2.45rem + 2.73vw, 4.5rem);

  /* Mapiranje na headinge */
  --h1-size: var(--fs-900);
  --h2-size: var(--fs-800);
  --h3-size: var(--fs-700);
  --h4-size: var(--fs-600);
  --h5-size: var(--fs-500);
  --h6-size: var(--fs-400);
  --body-size: calc(var(--fs-600) * 0.95);
  --small-size: var(--fs-500);

  /* Line-height */
  --lh-tight: 1.1;
  --lh-normal: 1.5;

  /* Razmaci (8pt ritam, u rem) */
  --space-1: 0.4rem; /* 4px */
  --space-2: 0.8rem; /* 8px */
  --space-3: 1.2rem; /* 12px */
  --space-4: 1.6rem; /* 16px */
  --space-5: 2.4rem; /* 24px */
  --space-6: 3.2rem; /* 32px */
  --space-7: clamp(4.8rem, 4rem + 2vw, 6.4rem); /* 48px → 64px → 102px */
  --space-8: clamp(6.4rem, 5rem + 3.5vw, 9.6rem); /* 64px → 80px → 154px */
  --space-9: clamp(9.6rem, 7rem + 6.5vw, 16rem); /* 96px → 112px → 256px (hero) */

  /* Layout */
  --container: 72rem; /* ~1152px @16px */
  --gutter: var(--space-4);

  --font-header: 'Montserrat', 'Arial', sans-serif;
  --font-body: 'Inter', 'Arial', sans-serif;
}

/* ==== PRIMJENA ==== */
html {
  font-size: 62.5%; /* 1rem = 10px (62.5% od 16px) */
}

body {
  background-color: #fff;
  color: #333;
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: var(--body-size);
  font-style: normal;
  font-weight: 300;
  line-height: var(--lh-normal);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-header);
  font-weight: 500;
  line-height: var(--lh-tight);
  margin: 0 0 calc(var(--space-7) * 0.75);
}

h1 {
  font-size: var(--h1-size);
  text-align: center;
  margin-inline: auto;
  max-width: 90%;
}

h2 {
  font-size: var(--h2-size);

  &.text {
    margin-top: calc(var(--space-7) * 0.625);
  }

  &.c {
    text-align: center;
  }
}
h3 {
  font-size: var(--h3-size);
}
h4 {
  font-size: var(--h4-size);
}
h5 {
  font-size: var(--h5-size);
}
h6 {
  font-size: var(--h6-size);
}

small {
  font-size: var(--small-size);
}

/* Flow spacing helper */
.flow > * + * {
  margin-block-start: var(--flow-space, var(--space-5));
}

/* Sekcije i kontejner */
.section {
  padding-block: var(--space-7);
}
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mt32 {
  margin-top: 32px !important;
}

/* Komponentno skaliranje: promijeni samo font-size wrappera */
.card {
  font-size: 0.9375em;
} /* sve unutra (naslovi, margine) se proporcionalno smanjuju */

/* Breakpointi u em (reagiraju i na zoom / base font) */
@media (min-width: 48em) {
  /* ≈ 768px @16px */
  :root {
    --gutter: var(--space-5);
  }
}
@media (min-width: 64em) {
  /* ≈ 1024px */
  :root {
    --container: 80em;
  }
}

.text-align-left {
  text-align: left !important;
}

.mb32 {
  margin-bottom: 32px !important;
}

p.text {
  font-size: var(--body-size);
  margin: 0;

  &.c {
    text-align: center;
  }

  &.intro {
    margin-inline: auto;
    max-width: 800px;
    text-align: center;

    &.l {
      text-align: left;
    }
  }

  &.err {
    color: red;
  }

  &.suc {
    color: green;
  }

  + p.text,
  + ul.text {
    margin-top: 16px;
  }
}

ul.text {
  font-size: var(--body-size);
  margin: 0;

  &.intro {
    margin-inline: auto;
    max-width: 800px;
    text-align: center;
    padding-left: 24px;

    &.l {
      text-align: left;
    }
  }

  + p.text,
  + ul.text {
    margin-top: 16px;
  }
}

a.btn {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  color: #fff;
  display: block;
  font-size: var(--body-size);
  margin-inline: auto;
  margin-top: 48px;
  padding: 16px 32px;
  text-decoration: none;
  transition: all 0.3s ease;
  width: fit-content;

  &:hover {
    background-color: #7ed957;
    color: #fff;
  }
}

/* HEADER */

header {
  border-bottom: 1px solid #ccc;

  & div.prva-linija {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: var(--small-size);
    line-height: 45px;

    & > div {
      display: flex;
      gap: 16px;
      margin-left: calc((100vw - 1200px) / 2);

      @media (max-width: 1333px) {
        margin-left: 5vw;
      }

      a {
        align-items: center;
        display: flex;
        gap: 8px;
        transition: all 0.3s ease;

        &:hover {
          color: #7ed957;
          text-decoration: none;
        }

        span.icon {
          height: 16px;
          width: 16px;
        }
      }
    }
  }

  & div.druga-linija {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-inline: auto;
    padding: var(--space-3) 0;
    width: min(90%, 1200px);
  }

  & a.logo {
    aspect-ratio: 1;
    display: block;
    width: 150px;
  }

  & nav {
    font-size: var(--fs-600);
    font-weight: 500;
  }

  & #main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    list-style: none;
    margin: 0;

    a {
      display: block;
      color: inherit;
      text-decoration: none;
      transition: all 0.3s ease;

      &:hover {
        color: #7ed957;
        text-decoration: underline;
      }
    }
  }

  @media (max-width: 750px) {
    & div.druga-linija {
      padding-bottom: 0;
    }

    & a.logo {
      aspect-ratio: 1;
      margin-bottom: var(--space-3);
      margin-inline: auto;
      width: 150px;
    }

    & nav {
      flex: 0 0 100%;
      flex-wrap: wrap;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }

    li {
      flex: 0 0 100%;
    }

    & #main-nav {
      gap: 8px;
      max-height: 0;
      transition: all 0.3s ease;

      a {
        background-color: rgba(0, 0, 0, 0.05);
        border-radius: 4px;
        line-height: 40px;
        text-align: center;
      }

      &.active {
        margin-bottom: var(--space-3);
        max-height: 500px;
      }
    }
  }

  #ham {
    background: #7ed957;
    display: none;
    height: 45px;
    position: absolute;
    right: 0px;
    top: 0px;
    width: 45px;

    @media screen and (max-width: 750px) {
      display: block;
    }
  }

  .burger-container {
    cursor: pointer;
    display: inline-block;
    height: 45px;
    position: absolute;
    transform: rotate(0deg);
    transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99);
    width: 45px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 1000;

    & #burger {
      display: block;
      height: 8px;
      margin: -4px auto 0;
      position: relative;
      top: 50%;
      width: 18px;
    }

    .active & {
      transform: rotate(90deg);

      & #burger .bar {
        background: #fff;
        transition: all 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99);
        transition-delay: 0.2s;
      }

      & #burger .bar.topBar {
        transform: translateY(4px) rotate(45deg);
      }

      & #burger .bar.btmBar {
        transform: translateY(3px) rotate(-45deg);
      }
    }
  }

  .bar {
    background: #fff;
    display: block;
    height: 1px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99);
    transition-delay: 0s;
    width: 100%;

    &.topBar {
      transform: translateY(0px) rotate(0deg);
    }

    &.btmBar {
      transform: translateY(6px) rotate(0deg);
    }
  }
}

/* BREADCRUMB */

.breadcrumb {
  font-size: var(--small-size);
  line-height: 1.5;
  margin-inline: auto;
  margin-top: 32px;
  position: relative;
  width: min(90%, 1200px);

  & ol {
    font-size: calc(var(--p-font-size) * 0.8);
    font-weight: 300;
    list-style-type: none;
    margin: 0;
    overflow: hidden;
    padding: 3px 0;
    width: auto;
  }

  & li {
    float: left;
    line-height: 22px;
    margin-right: 10px;

    &:after {
      content: ' > ';
      margin-left: 4px;
    }

    &:last-of-type {
      margin-right: 0;

      & a {
        padding-left: 0;
      }

      &:after {
        content: '';
        padding: 1px 0;
      }
    }
  }
}

/* MAIN */

main {
  padding: 64px 0;

  &.index {
    padding: 0;

    > div {
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    div.index {
      margin-inline: auto;
      padding: var(--space-7) 0;

      h2 {
        text-align: center;
      }
    }
  }
}

div.index {
  margin-inline: auto;
  width: min(90%, 1200px);
}

#hero {
  align-items: center;
  background-color: #eee;
  display: flex;
  height: 60vh;
  width: 100%;

  div {
    margin-inline: auto;
    width: min(90%, 900px);

    h1 {
      text-align: center;
      text-wrap: balance;
    }

    span {
      display: block;
      font-size: var(--body-size);
      text-align: center;
      text-wrap: balance;
    }
  }
}

#index-kategorije {
  & > div {
    margin-inline: auto;
    width: min(90%, 1440px);
  }

  ul {
    display: flex;
    gap: var(--space-4);

    li {
      aspect-ratio: 1.5;
      background-color: rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      display: flex;
      flex: 0 0 300px;
      overflow: hidden;

      a {
        display: flex;
        flex: 1;
        position: relative;

        img {
          flex: 1;
        }

        div {
          bottom: 0;
          left: 0;
          position: absolute;
          width: 100%;

          h3 {
            background-color: rgba(0, 0, 0, 0.5);
            color: #fff;
            font-size: calc(var(--fs-700) / 1.1);
            margin: 0;
            padding: 16px;
            text-align: center;
            transition: all 0.3s ease;
            width: 100%;
          }
        }

        &:hover h3 {
          background-color: rgba(0, 0, 0, 0.75);
          padding: 24px;
        }
      }
    }
  }
}

.scroll-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;

  .scroll-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  /* Za slučaj kada su dugmad direktno u scroll-wrapper */
  .scroll-btn {
    align-self: center;
  }

  .scroll-btn:first-of-type {
    margin-right: 8px;
  }
}

.scroll-list {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  overflow-x: auto;
  padding: 0;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */

  &::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  li {
    flex: 0 0 auto;
  }
}

.scroll-btn {
  align-items: center;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  color: #aaa;
  cursor: pointer;
  display: flex;
  font-size: 2rem;
  height: 48px;
  justify-content: center;
  transition: all 0.3s ease;
  width: 48px;

  &:hover {
    border-color: #7ed957;
    color: #7ed957;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;

    &:hover {
      border: 1px solid rgba(0, 0, 0, 0.1);
      color: #aaa;
    }
  }
}

#index-novo {
  ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));

    gap: var(--space-7);

    li {
      display: flex;
      gap: 32px;

      & > a {
        display: flex;
        gap: 32px;
        text-decoration: none;

        div {
          display: flex;
          flex-direction: column;
          justify-content: center;
          gap: 32px;

          &.photo {
            aspect-ratio: 1;
            flex: 0 0 240px;

            img {
              aspect-ratio: 1;
              border: 1px solid rgba(0, 0, 0, 0.1);
              border-radius: 4px;
              transition: all 0.3s ease;
            }
          }

          &:not(.photo) {
            flex: 1;
          }

          h3 {
            margin-bottom: 0;
          }

          p {
          }
        }

        &:hover {
          img {
            border: 1px solid #7ed957 !important;
          }
        }
      }
    }

    @media (max-width: 600px) {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

      li {
        flex-wrap: wrap;

        & > a {
          flex-wrap: wrap;

          div:not(.photo) {
            flex: 1 0 100%;
          }
        }
      }
    }
  }
}

#index-reference {
  ul {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: calc((var(--space-7) / 2) + 16px) calc(var(--space-7) / 2);
    margin: var(--space-7) auto;

    li {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      overflow: hidden;

      a {
        border-radius: 4px;
        flex: 1;
        overflow: hidden;
        transition: all 0.3s ease;

        img {
          aspect-ratio: 1.5;
          border-radius: 4px;
          object-fit: cover;
          width: 100%;
        }

        h3 {
          margin: 32px 0 0;
          text-align: center;
        }

        &:hover {
          color: #7ed957;
          text-decoration: none;
        }
      }
    }

    &.facts {
      grid-template-columns: 1fr 1fr 1fr;

      @media (max-width: 600px) {
        grid-template-columns: 1fr;
      }

      li {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;

        span {
          display: flex;
          flex: 0 0 100%;
          font-size: var(--body-size);
          justify-content: center;

          &:first-child {
          }

          &:nth-child(2) {
            font-size: calc(var(--body-size) * 3);
            font-weight: 200;
          }

          &:last-child {
            text-align: right;
          }
        }
      }
    }
  }
}

#index-zasto {
  ul {
    display: grid;
    font-size: var(--body-size);
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: calc(var(--space-7) / 2) calc(var(--space-7) / 2);
    margin: 48px auto;

    @media (max-width: 800px) {
      grid-template-columns: 1fr 1fr;
    }

    @media (max-width: 440px) {
      grid-template-columns: 1fr 1fr;
    }

    li {
      background-color: rgba(0, 0, 0, 0.05);
      border-radius: 16px;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      padding: 32px;

      span {
        &.icon {
          align-items: center;
          aspect-ratio: 1;
          border-radius: 50%;
          display: flex;
          flex: 0 0 32px;
          justify-content: center;
          margin-bottom: 16px;

          svg {
            height: 32px;
            stroke-width: 1;
            width: 32px;
          }
        }

        &.text {
          flex: 0 0 100%;
          text-align: center;
        }
      }
    }
  }
}

#index-blog {
  ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);

    @media (max-width: 700px) {
      grid-template-columns: 1fr;
    }

    li {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;

      a {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        text-decoration: none;

        img {
          aspect-ratio: 1.75;
          border: 1px solid rgba(0, 0, 0, 0.1);
          border-radius: 4px;
          margin-bottom: 32px;
          object-fit: cover;
          width: 100%;
        }

        div {
          flex: 1 1 auto;
          margin-top: auto;

          h3 {
            margin-bottom: 24px;
            margin-inline: auto;
            text-align: left;
            width: 100%;
          }

          p {
          }

          span {
            color: #777;
            display: block;
            font-size: calc(var(--body-size) * 0.8);
            margin-top: 16px;

            &.date {
              text-decoration: none;
            }
          }
        }

        &:hover h3 {
          text-decoration: underline;
        }
      }
    }
  }
}

#index-faq {
  margin-inline: auto;
  width: min(100%, 800px);
}

details.faq {
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 12px;

  & summary {
    align-items: center;
    background: #f7f7f7;
    cursor: pointer;
    display: flex;
    font-size: var(--body-size);
    font-weight: 600;
    line-height: 120%;
    list-style: none;
    padding: 16px 32px 16px 16px;
    position: relative;
    transition: background 0.3s ease;

    &::-webkit-details-marker {
      display: none;
    }

    &:hover {
      background: #ececec;
    }

    &::after {
      content: '+';
      font-size: 1.2em;
      position: absolute;
      right: 1em;
      transition: transform 0.3s ease;
    }
  }
}

details.faq[open] summary::after {
  content: '-';
}

/* Sadržaj FAQ-a */
details.faq p,
details.faq ul {
  color: #333;
  font-size: calc(var(--body-size) * 0.9);
  line-height: 1.6;
  margin: 0;
  padding: 16px;
}

details.faq ul {
  list-style: disc;
  padding-left: 2rem;
}

/* Blaga animacija otvaranja FAQ-a */
details.faq[open] summary + * {
  animation: fadeIn 0.3s ease-in-out;
}

details.faq + p {
  margin-top: 24px;
}

#kategorije-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-items: start;
  gap: calc((var(--space-7) / 2) + 16px) calc(var(--space-7) / 2);
  margin: var(--space-7) auto;
  width: min(90%, 1200px);

  /* optional tighter control on very small screens */
  @media (max-width: 400px) {
    grid-template-columns: 1fr;
  }

  li {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    a {
      flex: 1;

      img {
        aspect-ratio: 1.5;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 4px;
        object-fit: cover;
        width: 100%;
      }

      h3 {
        margin: 32px 0 0;
        text-align: center;
      }

      &:hover {
        text-decoration: none;
      }
    }
  }
}

#proizvod-det {
  align-items: flex-start;
  display: flex;
  gap: 64px;
  margin: 48px auto;
  width: min(90%, 1200px);

  & > div {
    flex: 0 0 calc(50% - 16px);

    &.img {
      background-color: rgba(0, 0, 0, 0.1);

      &.data {
      }
    }
  }
}

/* Blog */

div.hero-holder {
  background-color: #eee;
  border-radius: 8px;
  display: flex;
  margin-bottom: calc(var(--space-7) * 0.75);
  margin-inline: auto;
  max-height: 75vh;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: min(90%, 1440px);

  img {
    object-fit: cover;
    width: 100%;
  }

  h1 {
    background-color: rgba(0, 0, 0, 0.5);
    bottom: 0;
    color: #fff;
    font-size: calc(var(--h1-size) * 0.8);
    margin-bottom: 0;
    max-width: 100%;
    padding: calc(var(--space-7) / 2) 5vw;
    position: absolute;
    text-align: center;
    width: 100%;
  }
}

#blog-det {
  margin-inline: auto;
  width: min(90%, 800px);

  h2 {
    font-size: calc(var(--h2-size) * 1);
    margin: calc(var(--space-7) * 0.625) auto calc(var(--space-7) * 0.5);
  }
  p,
  ul {
    font-size: var(--body-size);
    line-height: 1.6;
  }

  ul {
    padding-left: 24px;
  }
}

/* Kontakt */

#kontakt-det {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr 1fr;
  margin: auto;
  width: min(90%, 1200px);

  @media (max-width: 1100px) {
    grid-template-columns: 1fr;
  }

  > div {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: var(--space-6);

    & + div {
      background-color: #fff;
      padding: 0;
    }
  }

  #results_inner {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: none;
    font-size: var(--body-size);
    margin: 0 auto 32px;
    padding: 16px;
    text-align: center;

    &.process {
      display: block;
    }

    &.ok {
      border-color: green;
      color: green;
      display: block;
    }

    &.err {
      border-color: red;
      color: red;
      display: block;
    }
  }
}

/* FOOTER */

footer {
  background-color: #7ed957;
  padding: var(--space-6) 0;
  text-align: center;
}

/* AMIN */

#admin-menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);

  li {
    display: flex;
    flex: 0 0 100%;
    font-size: var(--body-size);

    a {
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      flex: 0 0 100%;
      padding: 8px;
      text-align: center;
      text-decoration: none;
    }
  }
}

div.admin-container {
  margin-inline: auto;
  width: min(100%, 800px);
}

/**/

fieldset.upit {
  margin: 0;
  padding: 0;
  width: 100%;

  &.admin {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: var(--space-6);

    & + fieldset.admin {
      border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
  }

  & span.admin.text {
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: flex;
    flex: 1;
    font-size: calc(var(--p-font-size) * 0.9);
    font-weight: 300;
    padding: 8px 12px;

    &.none {
      border: 0;
      height: 0;
      padding: 0;
    }

    &.green {
      border: 1px solid green;
      color: green;
    }

    &.red {
      border: 1px solid red;
      color: red;
    }

    @media screen and (max-width: 600px) {
      flex: 0 0 100%;
    }
  }

  & > ol {
    list-style: none;
    margin: 0;
    padding: 0;

    & > li {
      display: flex;
      justify-content: space-between;
      min-height: 44px;

      @media screen and (max-width: 600px) {
        flex-wrap: wrap;
      }

      & + li {
        margin-top: 10px;
      }

      &.provjera {
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        margin-top: 2px;

        & > div {
          align-items: center;
          display: flex;

          input {
            max-width: 60px;
          }

          img {
            background-color: rgba(0, 0, 0, 0.1);
            height: 34px;
            object-fit: cover;
            width: 100px;
          }

          span {
            align-items: center;
            display: flex;
            font-size: var(--body-size);
            justify-content: center;
            width: 20px;
          }

          input {
          }
        }
      }

      &.sbmt {
        justify-content: flex-end;
        margin-top: 24px;
      }

      &.chck {
        font-size: 0.9em;

        & > label {
          align-items: flex-start;
          display: flex;
          flex: 0 0 100% !important;
          gap: 8px;
          line-height: 125%;
        }

        & input {
          margin: 5px 12px 5px;

          &[type='checkbox'] {
            margin-inline: 0;
          }
        }

        & span {
          flex: 1 1 calc(100%);
          line-height: 150%;
        }
      }
    }
  }

  & label {
    display: flex;
    font-size: calc(var(--body-size) * 1);
    line-height: 44px;

    &.provjera {
      flex: 1;
      font-size: calc(var(--body-size) * 0.9);
      line-height: 34px;
      min-width: 250px;
    }

    img {
      width: 100px;
    }

    .upit.admin &:not(.spam, .provjera) {
      align-self: center;
      flex: 0 0 220px;
      font-size: calc(var(--body-size) * 0.9);
    }

    &.spam {
    }

    &.red {
      color: red;
    }
  }
}

fieldset.upit input.text,
fieldset.upit input.textx,
input.slike,
fieldset.upit select,
fieldset.upit textarea,
fieldset.upit button[type='submit'],
fieldset.upit .search-box {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 4px;
  box-sizing: border-box;
  color: #000;
  float: right;
  font-family: var(--font-body);
  font-size: calc(var(--body-size) * 1);
  font-weight: 300;
  margin: 0;
  padding: 8px 12px;
  transition: all 0.25s;
  width: calc(100% - 220px);

  &.textx {
    width: 100px;
  }

  &.velika {
    height: 400px;
  }

  &[readonly] {
    background-color: #fff;
    color: #555;
    cursor: not-allowed;
    opacity: 0.8;
  }

  &:hover {
    border: 1px solid rgba(0, 0, 0, 0.25);
  }

  &:focus {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.5);
    outline: none;
  }

  @media screen and (max-width: 600px) {
    width: 100%;
  }
}

fieldset.upit button[type='submit']:hover {
  background-color: #fff;
  border-color: green;
  color: green;
}

fieldset.upit button[type='submit'].del {
  background-color: red;
  border: 1px solid red;
  color: #fff;

  &:hover {
    background-color: #fff;
    color: red;
  }
}

#admin-product-nav {
  display: flex;
  flex-wrap: wrap;
  font-size: var(--body-size);
  gap: 4px;

  li {
    flex: 0 0 100%;

    a {
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      display: block;
      padding: 12px 16px;
      text-decoration: none;

      &:hover {
        background-color: rgba(0, 0, 0, 0.05);
      }
    }
  }
}

#admin-product-add {
  font-size: var(--body-size);
  margin: 32px auto 32px;
  width: fit-content;

  a {
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    color: inherit;
    display: flex;
    font-weight: 300;
    gap: 8px;
    padding: 8px;
    text-decoration: none;
    transition: all 0.3s ease;

    span {
      display: block;

      svg {
        color: rgba(0, 0, 0, 0.5);
        stroke-width: 1;
      }
    }

    &:hover {
      border-color: transparent;
    }
  }
}

#admin-product-list {
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  list-style: none;
  margin: 32px auto 0;
  padding: 32px;

  li {
    display: flex;
    gap: 16px;

    & > a {
      color: inherit;
      display: flex;
      flex: 1;
      flex-wrap: wrap;
      gap: 16px;
      position: relative;
      text-decoration: none;

      &:hover {
        color: green;
        text-decoration: none;
      }
    }

    span {
      border-radius: 4px;
      color: #fff;
      font-size: calc(var(--body-size) * 0.8);
      padding: 4px 8px;
      position: absolute;
      top: 8px;

      &.status {
        background-color: #000;
        left: 8px;
      }

      &.sort {
        background-color: #000;
        right: 8px;
      }
    }

    img {
      aspect-ratio: 1.5;
      border-radius: 8px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      object-fit: cover;
      width: 100%;
    }

    h3 {
      font-size: calc(var(--h3-size) * 0.8);
      margin-bottom: 0;
      width: 100%;
    }
  }
}

#admin-proizvodi-slike {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-block: 0 32px;
  padding-bottom: 32px;

  li {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: move;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    position: relative;
    transition: all 0.3s ease;

    &:hover {
      border-color: #2196f3;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    &.dragging {
      opacity: 0.5;
      transform: scale(1.05);
      cursor: grabbing;
    }

    &.drag-over {
      background-color: rgba(76, 175, 80, 0.1);
      border: 2px dashed #4caf50;
      border-color: #4caf50;
      border-style: dashed;
      background: #e8f5e9;
    }

    &.marked-for-delete {
      border: 1px solid #000;
    }

    > input.text {
      flex: 0 0 100%;
    }
  }

  a {
    background-color: #eee;
    border-radius: 8px;
    display: flex;
    flex: 1 0 100%;
    text-align: center;

    > img {
      aspect-ratio: 1.5;
      background-color: aqua;
      border-radius: 4px;
      object-fit: cover;
      width: 100%;
    }
  }

  div {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 8px;
    justify-content: space-evenly;

    input[type='checkbox'] {
      cursor: pointer;
      transform: scale(1.5);
    }

    button {
      border-radius: 8px;
      border-style: none;
      cursor: pointer;
      display: flex;
      flex: 0 0 content-fit;
      font-size: var(--body-size);
      padding: 8px 12px;
      transition: background 0.3s;

      &:hover {
        background: #f44336;
        color: white;
      }
    }
  }
}

.drag-handle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #2196f3;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#admin-proizvodi-slike li:hover .drag-handle {
  opacity: 1;
}

/* ============================================
   1. CHANGES INDICATOR - Mali tekst pored gumba
   ============================================ */

.changes-indicator {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 12px;
  background: #ff9800;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  animation: pulse 2s infinite;
  vertical-align: middle;
}

/* Animacija za pulsiranje */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ============================================
   2. STATUS MSG - Velika notifikacija
   ============================================ */

.status-msg {
  animation: slideDown 0.3s ease;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  color: #333;
  display: none;
  font-size: var(--body-size);
  font-weight: 400;
  margin-bottom: 16px;
  padding: 12px;
  position: relative;
  text-align: center;

  &::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: bold;
  }

  a {
    color: inherit;
    text-decoration: underline;

    &:hover {
      text-decoration: none;
    }
  }
}

/* Animacija slide down */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SUCCESS - Zelena */
.status-msg.success {
  border-color: green;
  color: green;

  &::before {
    content: '✓';
  }
}

/* ERROR - Crvena */
.status-msg.error {
  border-color: red;
  color: red;

  &::before {
    content: '✕';
  }
}

/* WARNING - Narančasta */
.status-msg.warning {
  border-color: orange;
  color: #ff9800;

  &::before {
    content: '⚠';
  }
}

/* INFO - Plava */
.status-msg.info {
  background: #2196f3;
  color: white;

  &::before {
    content: 'ℹ';
  }
}

/* Close button (X) */
.status-msg .close-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 24px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.status-msg .close-btn:hover {
  opacity: 1;
}

/* ============================================
   4. SPREMI PROMJENE GUMB
   ============================================ */

.btn-spremi {
  padding: 12px 24px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-spremi:hover:not(:disabled) {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-spremi:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Kada ima nespremljene promjene - narančasti */
.btn-spremi.has-changes {
  background: #ff9800;
  animation: pulse 2s infinite;
}

.btn-spremi.has-changes:hover:not(:disabled) {
  background: #f57c00;
}

/* 404 page */
.error-links {
  margin-top: var(--space-7);
}
