/* ================================
   QUERIES.CSS — Mobile-First Responsive
   Base styles = mobile, media queries scale UP
   rem and em do NOT depend on html font-size in media queries
   1rem = 1em = 16px
   ================================ */

/* ===== Below 1344px (Smaller desktops) ===== */
@media (max-width: 84em) {
  .hero {
    max-width: 120rem;
    text-align: center;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .upravnik-section-col p {
    font-size: 2rem;
  }

  .kontakt-map {
    height: 25rem;
    width: min(50rem, 100%);
  }
}

/* ===== Below 1200px (Landscape tablets) ===== */
@media (max-width: 75em) {
  html {
    font-size: 56.25%;
  }

  .grid {
    column-gap: 4.8rem;
    row-gap: 6.4rem;
  }

  .header {
    padding: 0 3.2rem;
  }

  .main-nav-list {
    gap: 3.2rem;
  }

  .testimonials-container {
    padding: 9.6rem 3.2rem;
  }

  .section-upravnik {
    padding: 9.6rem 3.2rem;
  }
}

/* ===== Below 944px (Tablets) ===== */
@media (max-width: 59em) {
  html {
    font-size: 50%;
  }

  .step-number {
    font-size: 6.4rem;
  }

  .service-content {
    padding: 2.4rem 3.2rem;
  }

  .service-title {
    font-size: 2rem;
  }

  .upravnik-section-col p {
    font-size: 2rem;
  }

  .section-testimonials {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(6, 1fr);
  }

  .cta {
    grid-template-columns: 3fr 2fr;
  }

  .cta-form {
    grid-template-columns: 1fr;
  }

  .btn-form {
    margin-top: 1.2rem;
  }

  /* === MOBILE NAV === */
  .btn-mobile-nav {
    display: block;
    z-index: 11;
  }

  .main-nav {
    z-index: 10;
    background-color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: translateX(100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease-in;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .nav-open .main-nav {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
  }

  .nav-open .icon-mobile-nav--close {
    display: block;
  }

  .nav-open .icon-mobile-nav--open {
    display: none;
  }

  .main-nav-list {
    visibility: inherit;
    flex-direction: column;
    align-items: start;
    gap: 3.2rem;
  }

  .main-nav-link:link,
  .main-nav-link:visited {
    font-size: 3rem;
  }

  /* --- Mobile submenu (click-toggled) --- */
  li:hover > ul#submenu {
    /* Disable hover-based submenu on mobile */
    opacity: 0;
    visibility: hidden;
  }

  #submenu {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    margin-top: 1.2rem;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.4s ease, margin-top 0.3s ease, visibility 0.3s;
    background-color: var(--color-primary-light);
    border-radius: var(--radius-md);
    padding: 0 1.6rem;
    box-shadow: none;
    white-space: normal;
  }

  #submenu::before {
    display: none;
  }

  #submenu li {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  li.submenu-open > ul#submenu {
    opacity: 1;
    visibility: visible;
    max-height: 30rem;
    padding: 1.2rem 1.6rem;
    margin-top: 1.2rem;
  }

  li.submenu-open > ul#submenu li {
    opacity: 1;
    transform: translateY(0);
  }

  li.submenu-open > ul#submenu li:nth-child(1) {
    transition-delay: 0.05s;
  }

  li.submenu-open > ul#submenu li:nth-child(2) {
    transition-delay: 0.1s;
  }

  li.submenu-open > ul#submenu li:nth-child(3) {
    transition-delay: 0.15s;
  }

  #submenu .main-nav-link:link,
  #submenu .main-nav-link:visited {
    font-size: 2.4rem;
  }

  /* --- Servis pages mobile tweaks --- */
  .contact-bar-item a {
    padding: 0.6rem 1.2rem;
    font-size: 1.2rem;
  }

  .zaduzenja-title {
    font-size: 2rem;
  }

  .ciscenje-description {
    margin-left: 1.2rem;
  }

  .zimska-tertiari,
  .zimska-secondary {
    margin-left: 0;
  }

  .zimska-item span {
    font-size: 1.8rem;
  }

  .step-description {
    font-size: 1.4rem;
  }
}

/* ===== Below 768px (Smaller tablets) ===== */
@media (max-width: 48em) {
  .service-title {
    font-size: 1.8rem;
  }

  .upravnik-section-cols p {
    font-size: 1.8rem;
  }

  .pricing-header {
    font-size: 2.2rem;
  }

  .upravnik-img.slika2 {
    width: 30rem;
  }

  .zaduzenja-item span {
    font-size: 1.2rem;
  }

  .odrzavanje-item span {
    font-size: 1.4rem;
  }

  .odrzavanje3 img {
    height: auto;
  }

  .grid--3-colss {
    row-gap: 3.2rem;
  }

  .hero-heading-secondary {
    font-size: 2.2rem;
  }

  .ciscenje-img {
    width: 90%;
    height: 17rem;
  }

  .zimska-grid {
    column-gap: 3.2rem;
  }

  .zimska-item span {
    font-size: 1.4rem;
  }

  .zimska-gallery img:first-child {
    width: 25rem;
    height: 25rem;
  }

  .step-description {
    font-size: 1.2rem;
  }

  .kontakt-map {
    height: 20rem;
  }
}

/* ===== Below 576px (Large phones) ===== */
@media (max-width: 36em) {
  .btn:link,
  .btn:visited {
    font-size: 1.5rem;
    padding: 1.2rem 2.4rem;
  }

  .grid--2-cols,
  .grid--3-cols,
  .grid--4-cols,
  .grid--3-colss {
    grid-template-columns: 1fr;
  }

  .upravnik-section-cols {
    grid-template-columns: 3fr 1fr;
    column-gap: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    margin-top: 4rem;
    width: 26rem;
    align-items: center;
  }

  .hero-buttons a {
    width: 80%;
    text-align: center;
  }

  .testimonials {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .usluga {
    margin: 0 auto;
    width: 85%;
  }

  .usluge-servisi {
    row-gap: 4.8rem;
  }

  .upravnik-section-cols img {
    width: 15rem;
  }

  .upravnik-section-col p {
    font-size: 1.1rem;
    padding-bottom: 1.2rem;
  }

  .pricing-pre:first-child,
  .pricing-pre:last-child {
    grid-column: auto;
  }

  .pricing-pre {
    grid-template-columns: 1fr 1fr;
    width: 90%;
    margin: 0 auto;
  }

  .pricing-header {
    font-size: 1.4rem;
    line-height: 1.5;
  }

  .pricing-txt {
    font-size: 1.2rem;
  }

  .uradjeni-poslovi li {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
  }

  .cta {
    grid-template-columns: 1fr;
  }

  .cta-text-box {
    padding: 3.2rem;
  }

  .cta-image-box {
    height: 32rem;
    grid-row: 1;
  }

  .cta-text {
    font-size: 1.4rem;
  }

  .footer-logo1 {
    width: 8.4rem;
  }

  .footer-text {
    font-size: 1.6rem;
  }

  .footer-heading {
    font-size: 2.4rem;
    margin-bottom: 2.4rem;
  }

  .footer-link:link,
  .footer-link:visited {
    font-size: 1.6rem;
    justify-content: center;
    font-weight: 500;
  }

  .grid--footer {
    column-gap: 2.4rem;
  }

  /* Servis 1 — mobile: tekst prvo, slika ispod */
  .upravnik-cols img {
    width: 90%;
    margin: 0 auto;
  }

  .upravnik-cols2 {
    grid-template-columns: 1fr;
  }

  .upravnik-cols2 img {
    grid-row: 2;
    width: 80%;
    margin: 0 auto;
  }

  .upravnik-description {
    font-size: 1.4rem;
  }

  .upravnik-img.img2 {
    width: 13rem;
    height: 15rem;
  }

  .zaduzenja-section {
    width: 90%;
    margin: 0 auto;
  }

  .zaduzenja-item span {
    margin: 0;
    font-size: 1.6rem;
  }

  .zaduzenja-title {
    font-size: 2rem;
  }

  .zaduzenja-item strong {
    font-size: 1.6rem;
  }

  .upravnik-img.slika2 {
    width: 17rem;
    height: auto;
  }

  .upravnik-heading {
    font-size: 1.6rem;
  }

  .upravnik-z {
    grid-template-columns: 1fr;
    margin: 0 auto;
  }

  .odrzavanje3 {
    margin: 0 auto;
    width: 80%;
  }

  .odrzavanje3-description {
    font-size: 1.2rem;
  }

  .zaduzenja4-txt {
    grid-row: 1;
    margin: 1.2rem 2.4rem;
  }

  .zaduzenja4-cols {
    margin-top: 3.2rem;
  }

  .primary-odrzavanje {
    font-size: 2.4rem;
  }

  .upravnik-img {
    width: 20rem;
    height: 20rem;
  }

  .odrzavanje-desc {
    margin-bottom: 4.8rem;
  }

  .odrzavanje-gallery img:first-child {
    width: 20rem;
    height: auto;
  }

  .odrzavanje-gallery img:last-child {
    width: 20rem;
    height: auto;
    margin: 0;
  }

  .odrzavanje-lista span {
    font-size: 1.6rem;
  }

  /* Servis 3 */
  .ciscenje-cols img {
    grid-row: 1;
    width: 60%;
    height: 20rem;
    margin: 0 auto;
  }

  .ciscenje-cols {
    row-gap: 4rem;
  }

  .ciscenje-p {
    font-size: 2.4rem;
  }

  /* Servis 4 */
  .first,
  .zimska-secondary {
    font-size: 3.2rem;
  }

  .zimska-item img {
    width: 1.6rem;
    height: 1.6rem;
  }

  .zimska-gallery {
    flex-direction: column;
    align-items: center;
  }

  .zimska-gallery img,
  .zimska-gallery img:first-child {
    width: min(35rem, 100%);
    height: auto;
  }

  .zimska-section-cols img {
    width: 60%;
    height: 25rem;
  }

  .zimska-item span {
    font-size: 1.6rem;
  }

  /* O nama */
  .step-img {
    margin-bottom: 1.2rem;
  }

  .step-image-box:nth-child(2) {
    grid-row: 1;
  }

  .step-image-box:nth-child(6) {
    grid-row: 5;
  }

  .zimska-item {
    margin-left: 0;
  }

  /* Kontakt */
  .kontakt-map {
    height: 20rem;
    width: min(35rem, 100%);
  }

  .contact-bar {
    gap: 1.2rem;
    padding: 1.2rem;
  }

  .contact-bar-item a {
    padding: 0.6rem 1rem;
    font-size: 1.2rem;
  }
}

/* ===== Below 512px (Small phones) ===== */
@media (max-width: 32em) {

  .grid--footer {
    grid-template-columns: 1fr;
    row-gap: 4.8rem;
    text-align: center;
  }

  .footer-logo {
    text-align: center;
  }

  .footer-nav {
    text-align: center;
  }

  .contact-list {
    justify-content: center;
  }

  .hero-description {
    font-size: 1.6rem;
    margin-bottom: 3.2rem;
  }

  .section-cta .heading-secondary {
    font-size: 2.8rem;
  }

  .subheading {
    font-size: 1.2rem;
  }

  .upravnik-section-col {
    padding: 1.2rem;
  }

  .upravnik-section-col a {
    margin-left: 0;
  }

  .odrzavanje-gallery {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .odrzavanje-gallery img:first-child,
  .odrzavanje-gallery img:last-child {
    width: min(25rem, 100%);
    height: auto;
  }
}
