/*
  1. Use a more-intuitive box-sizing model.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}
/*
  2. Remove default margin
*/
* {
  margin: 0;
}
/*
  3. Allow percentage-based heights in the application
*/
html,
body {
  height: 100%;
}
/*
  Typographic tweaks!
  4. Add accessible line-height
  5. Improve text rendering
*/
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/*
  6. Improve media defaults
*/
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  width: 100%;
}
/*
  7. Remove built-in form typography styles
*/
input,
button,
textarea,
select {
  font: inherit;
}
/*
  8. Avoid text overflows
*/
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
/*
  9. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

ul,
li {
  margin: 0;
  padding: 0;
}

/* */

:root {
  --h1-font-size: clamp(26px, 4px + 5.5vw, 48px);
  --h2-font-size: clamp(2.2em, 1.9em + 0.75vw, 2.8em);
  --h3-font-size: calc(var(--h2-font-size) / 1.2);
  --p-font-size: calc(clamp(1.6em, 1.5em + 0.25vw, 1.8em) * 0.95);

  /**/
  --color-main: #1d3425;
  --color-main2: #419945;
  --color-main3: #57718a;
  --color-sub: #91af35;
  --color-sub-hover: #000;
  --font-header: 'Cardo', serif;
  --font-body: 'Poppins', serif;

  --h1-margin-bottom: clamp(32px, 24px + 2vw, 48px);
  --h2-margin-bottom: 24px;
  --h3-margin: 48px;

  --section-padding: clamp(48px, 4em + 2vw, 64px);
  --div-nekretnineDet-font-size: 1.6em;
  --ul-text-small-font-size: 1.6em;
}

/* Hide the arrows for number input fields */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield; /* Firefox */
}

html {
  scroll-behavior: smooth;
  scroll-padding: 0px;
}

body {
  background-color: #e5e3da;
  color: var(--color-main);
  font-family: var(--font-body);
  font-size: 62.5%;
  font-weight: 300;
}

header {
  align-content: space-between;
  background-color: rgba(0, 0, 0, 0.1);
  background-image: url('images/hero.jpg');
  background-size: cover;
  display: flex;
  flex-wrap: wrap;
  height: 100vh;
  justify-content: center;
  max-height: 1200px;

  &::before {
    background-color: rgba(29, 52, 37, 0.75);
    content: '';
    height: 100vh;
    left: 0;
    max-height: 1200px;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1;
  }

  nav {
    align-items: center;
    display: flex;
    flex: 0 0 min(90%, 1900px);
    justify-content: space-between;
    height: 100px;
    position: relative;
    z-index: 10;

    #logo {
      aspect-ratio: 2.25;
      display: flex;
      flex: 0 0 180px;
      font-family: var(--font-header);
      font-size: 2.4em;
      color: var(--color-main);

      img {
        aspect-ratio: 2.25;
      }
    }

    ul {
      display: flex;

      li {
        list-style: none;

        a {
          color: #fff;
          font-size: calc(var(--p-font-size) * 0.85);
          font-weight: 400;
          text-decoration: none;
        }
      }
    }

    #main_nav {
      display: flex;
      gap: 24px;

      a {
        color: #fff;
        transition: all 0.5s;

        &:hover {
          color: var(--color-sub);
        }
      }
    }

    #flags {
      gap: 8px;

      li {
        height: 32px;
        width: 32px;

        a {
          display: flex;
        }
      }
    }

    @media (max-width: 1350px) {
      flex-direction: column;
      height: auto;
      gap: 24px;
      margin-top: 12px;

      #logo {
        flex: 0 0 80px;
        max-width: 180px;
        order: 1;
      }

      #main_nav {
        display: none !important;
        flex-wrap: wrap;
        order: 3;

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

      #flags {
        order: 2;
      }
    }
  }

  & > div {
    display: flex;
    flex: 0 0 min(90%, 1080px);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10dvh;
    padding: 0 5vw;
    position: relative;
    z-index: 10;

    h1 {
      color: #fff;
      flex: 0 0 100%;
      font-size: var(--h1-font-size);
      font-weight: 400;
      margin-bottom: var(--h1-margin-bottom);
      text-align: center;
    }

    .headline {
      color: rgba(255, 255, 255, 0.8);
      flex: 0 0 100%;
      font-size: calc(var(--p-font-size) * 1.1);
      margin-bottom: calc(var(--h1-margin-bottom) / 1);
      text-align: center;
    }

    .cta {
      display: flex;
      flex: 0 0 450px;
      gap: 16px;

      @media (max-width: 500px) {
        flex: 0 0 100%;
        flex-wrap: wrap;
        margin-inline: auto;

        a {
          flex: 0 0 100%;
        }
      }
    }

    a {
      background-color: var(--color-sub);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      color: var(--color-main);
      display: flex;
      flex: 0 0 calc(50% - 8px);
      font-size: var(--p-font-size);
      font-weight: 700;
      justify-content: center;
      padding: 16px 24px;
      text-align: center;
      text-decoration: none;
      transition: all 0.5s;

      &.prica {
        background-color: transparent;
        border: 1px solid rgba(255, 255, 255, 1);
        color: #fff;
        cursor: pointer;
      }

      &:hover {
        background-color: var(--color-main);
        border: 1px solid var(--color-sub);
        color: #fff;
      }
    }
  }
}

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

  & + p {
    margin-top: 32px;
  }
}

main {
}

section {
  padding: var(--section-padding) 0;

  h2 {
    font-size: var(--h2-font-size);
    font-family: var(--font-header);
    margin-bottom: calc(var(--h1-margin-bottom) * 0.75);
  }

  & + section {
    border-top: 1px solid rgba(29, 52, 37, 0.1);
  }
}

#about {
  padding-inline: 5vw;

  h2 {
    text-align: center;

    @media (max-width: 720px) {
      text-align: left;
    }
  }

  div.img {
    margin: 0 auto 32px;
    width: min(100%, 720px);

    img {
      aspect-ratio: 1.67;
      background-color: rgba(0, 0, 0, 0.2);
      border-radius: 8px;
      display: block;
      width: 100%;
    }
  }

  p {
    margin: 0 auto;
    text-align: center;
    width: min(100%, 720px);

    @media (max-width: 720px) {
      text-align: left;
    }
  }
}

#product {
  background-color: #f8f2ed;
  background-color: #e5e3da;
  display: flex;
  flex-wrap: wrap;
  gap: var(--h1-margin-bottom);
  justify-content: center;

  > div {
    align-items: center;
    display: flex;
    flex: 0 0 min(90%, 1200px);
    flex-wrap: wrap;
    gap: var(--section-padding);

    &:nth-child(even) {
      flex-direction: row-reverse;
    }

    > div {
      display: flex;
      flex: 0 0 calc((100% - var(--section-padding)) / 2);

      &.data {
        flex-wrap: wrap;

        h2 {
          flex: 0 0 100%;
        }

        ul {
          display: flex;
          flex-wrap: wrap;
          font-size: var(--p-font-size);
          gap: 16px;
          list-style: none;

          li {
            flex: 0 0 100%;

            span {
              display: inline !important;

              &.head {
                font-weight: 700;
              }
            }
          }
        }
      }

      &.photo {
        div.img {
          background-color: rgba(0, 0, 0, 0.05);
          width: 100%;

          img {
            aspect-ratio: 1.33;
            border-radius: 8px;
            min-width: 100%;
            object-fit: cover;
          }
        }
      }
    }

    @media (max-width: 1100px) {
      gap: var(--h1-margin-bottom);

      > div {
        flex: 0 0 100%;

        img {
          aspect-ratio: 16 / 9 !important;
        }
      }
    }
  }
}

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

  p {
    margin: 0 auto;
    text-align: center;
    width: min(90%, 720px);

    &.success {
      border: 1px solid green;
      border-radius: 8px;
      color: green;
      margin-bottom: 32px;
      padding: 16px;
      width: 100%;
    }

    &.error {
      border: 1px solid red;
      border-radius: 8px;
      color: red;
      margin-bottom: 32px;
      padding: 16px;
      width: 100%;
    }
  }

  & > div {
    display: flex;
    gap: var(--section-padding);
    margin: var(--section-padding) auto 0;
    width: min(90%, 1200px);

    div.products {
      background-color: rgba(0, 0, 0, 0.05);
      border-radius: 8px;
      display: grid;
      flex: 0 0 calc((100% - var(--section-padding)) / 2);
      gap: 16px;
      grid-template-columns: 1fr;
      padding: 16px;
    }

    div.form {
      flex: 0 0 calc((100% - var(--section-padding)) / 2);
    }

    @media (max-width: 1100px) {
      flex-wrap: wrap;

      div.products,
      div.form {
        flex: 0 0 100%;
      }
    }
  }

  div.product {
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    font-size: calc(var(--p-font-size) * 0.8);
    gap: 16px;
    padding-bottom: 16px;

    .measure {
      align-items: center;
      aspect-ratio: 1;
      background-color: rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      display: flex;
      flex: 0 0 70px;
      justify-content: center;
      text-align: center;
    }

    @media (max-width: 400px) {
      gap: 12px;

      .measure {
        flex: 0 0 60px;
      }
    }

    .quantity {
      display: flex;
      align-items: center;

      button {
        align-items: center;
        background-color: var(--color-sub);
        border: 1px solid var(--color-main);
        border-radius: 50%;
        color: #fff;
        cursor: pointer;
        display: flex;
        height: 24px;
        justify-content: center;
        transition: all 0.5s;
        width: 24px;

        &:hover {
          background-color: var(--color-main);
        }
      }

      input {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 4px;
        box-sizing: border-box;
        color: var(--color-main);
        font-family: var(--font-body);
        font-weight: 400;
        margin: 0 12px;
        padding: 8px 12px;
        text-align: center;
        transition: background 1s;
        width: 50px;

        @media (max-width: 400px) {
          margin: 0 8px;
        }
      }
    }

    .price {
      display: flex;
      flex: 1;
      justify-content: space-between;
    }

    .unit-price {
    }

    .total-price {
      font-weight: 400;
    }
  }

  div.total {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    font-size: 1.5em;
    font-weight: 700;
    justify-content: space-between;
    padding-bottom: 16px;
  }

  span.napomena {
    font-size: 1.3em;
  }

  fieldset {
    border: 0;
    margin: 0;
    padding: 0;

    ul {
      list-style: none;

      li {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;

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

        &.btn {
          justify-content: right;
          margin-top: 24px;
        }
      }
    }

    label {
      display: flex;
      font-size: calc(var(--p-font-size) * 0.9);
      width: 150px;
    }

    input,
    textarea,
    select,
    button {
      background: #fff;
      border: 1px solid rgba(0, 0, 0, 0.2);
      border-radius: 4px;
      box-sizing: border-box;
      color: var(--color-main);
      font-family: var(--font-body);
      font-size: calc(var(--p-font-size) * 0.9);
      font-weight: 400;
      margin: 0;
      padding: 8px 12px;
      width: calc(100% - 150px);
      transition: background 1s;
    }

    textarea {
      height: 200px;
    }

    button {
      background-color: var(--color-sub);
      color: #fff;
      cursor: pointer;
      padding: 12px 12px;

      &:hover {
        background-color: var(--color-main);
      }
    }

    @media (max-width: 700px) {
      label,
      input,
      textarea,
      select,
      button {
        width: 100%;
      }
    }
  }
}

#harvesting {
  h2 {
    text-align: center;

    @media (max-width: 720px) {
      text-align: left;
      margin-inline: auto;
      width: min(90%, 720px);
    }
  }

  p {
    margin: 0 auto;
    text-align: center;
    width: min(90%, 720px);

    & + p {
      margin-top: 32px;
    }

    @media (max-width: 720px) {
      text-align: left;
    }
  }

  ul.text {
    font-size: var(--p-font-size);
    list-style: none;
    margin: 16px auto 32px;
    text-align: center;
    width: min(90%, 720px);

    @media (max-width: 720px) {
      text-align: left;
    }
  }

  ul.photo {
    display: grid;
    gap: calc(var(--h1-margin-bottom) / 2);
    grid-template-columns: 1fr 1fr;
    list-style: none;
    margin: 32px auto 0;
    width: min(90%, 1200px);

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

    li {
      border-radius: 8px;
      overflow: hidden;
    }
  }
}

#artichokes {
  h2 {
    text-align: center;

    @media (max-width: 720px) {
      text-align: left;
      margin-inline: auto;
      width: min(90%, 720px);
    }
  }

  p {
    margin: 0 auto;
    text-align: center;
    width: min(90%, 720px);

    & + p {
      margin-top: 32px;
    }

    @media (max-width: 720px) {
      text-align: left;
    }
  }

  ul.text {
    font-size: var(--p-font-size);
    list-style: none;
    margin: 16px auto 32px;
    text-align: center;
    width: min(90%, 720px);

    @media (max-width: 720px) {
      text-align: left;
    }
  }

  ul.photo {
    display: grid;
    gap: calc(var(--h1-margin-bottom) / 2);
    grid-template-columns: 1fr 1fr;
    list-style: none;
    margin: 32px auto 0;
    width: min(90%, 1200px);

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

    li {
      border-radius: 8px;
      overflow: hidden;
    }
  }
}

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

  ul {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0 auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    width: min(90%, 1200px);

    &::-webkit-scrollbar {
      display: none;
    }

    li {
      border: 1px solid rgba(0, 0, 0, 0.1);
      border: 1px solid var(--color-sub);
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      gap: 16px;
      overflow: hidden;
      padding: 32px;
      scroll-snap-align: start;
      width: 100%;

      > div {
        display: flex;
        justify-content: center;

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

  #navButtons2 {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr;
    margin: 0 auto;
    width: 120px;

    button {
      background-color: var(--color-sub);
      border: 1px solid var(--color-main);
      border-radius: 4px;
      color: #fff;
      cursor: pointer;
      display: flex;
      justify-content: center;
      padding: 12px 16px;
      transition: all 0.5s;

      &:hover {
        background-color: var(--color-main);
      }

      svg {
        color: #fff;
        stroke-width: 2;
        height: 16px;
        width: 16;
      }
    }
  }

  #prevButton2:disabled,
  #nextButton2:disabled {
    border-color: rgba(0, 0, 0, 0.1);
    cursor: not-allowed;

    svg {
      color: rgba(0, 0, 0, 0.1);
    }
  }

  #scrollProgress2 {
    background: rgba(0, 0, 0, 0.05);
    height: 4px;
    margin: 16px auto;
    width: 120px;
  }

  #scrollProgressBar2 {
    background: var(--color-main);
    height: 100%;
    transition: width 0.5s ease; /* Add transition for smooth filling */
    width: 0;
  }

  /**/
}

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

  p {
    text-align: center;
  }
}

footer {
  background-color: var(--color-main);
  font-size: calc(var(--p-font-size) * 0.8);
  padding: var(--section-padding) 5vw;

  p {
    color: #fff;
    font-size: 1em;
    text-align: center;

    & + p {
      margin-top: 16px;
    }
  }

  ul {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0 auto 24px;
    padding: 16px 0;

    @media (max-width: 500px) {
      flex-wrap: wrap;
      margin-bottom: 32px;
      padding: 0;

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

  a {
    color: #fff;
    text-decoration: underline;
  }
}
