/* Desktop (above 1200px) */
@media (min-width: 1200px) {
    :root {
        font-size: 16px;
    }
}

/* Large tablets and small desktops (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        font-size: 14px;
    }
    
    .fspan span {
        font-size: 0.75rem;
    }
}

@media (max-width: 920px) {

    html, body {
        margin-top:0;
        padding-top:0;
    }

    h1 {
        font-size: 4rem !important;
    }

    #o_nas h1::after, #kontakt h1::after, #partnerji h1::after, #galerija h1::after, #ponudba h1::after {
        bottom: 0.7rem;
    }

    #o_nas h1::after {
        bottom: 1.8rem;
        width:90%;
    }

    .nav-item {
        width: 100%;
        text-align: center;
    }

    .nav-center {
        order: 2;
        margin: 0; /* Remove margin */
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
    }

    .logo-button {
        order: 1;
        position: static;
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0; /* Remove margin */
        transform: none;
    }

    .language-buttons {
        order: 3;
        position: static;
        width: 100%;
        height: auto; 
        display: flex !important;
        justify-content: center;
        align-items: center; 
        gap: 1.5rem;
        padding: 1rem 0; 
        margin: 0; 
        transform: none;
    }

    .navbar-visible .language-buttons {
        visibility: visible;
        opacity: 1;
    }

    .navbar-visible {
        visibility: visible;
        position: fixed;
        top: 0;
        left: auto;
        right: -40vw;
        width: 40vw;
        height: 100vh;
        display: flex !important;
        flex-direction: column; 
        background-color: var(--primary-bg);
        transition: all 0.3s ease;
        z-index: 9999;
        padding: 6.25rem 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.6);
        opacity: 0;
    }

    .navbar-visible.active {
        right: 0;
        opacity: 1;
    }

    .navbar-visible.active {
        display: flex !important; /* Change from block to flex */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 1;
        padding: 2rem 0;
        
    }

    .navbar-visible.active .logo-button,
    .navbar-visible.active .nav-center,
    .navbar-visible.active .language-buttons {
        display: flex !important;
        opacity: 1;
        visibility: visible;
    }

    #navbar {
        position: fixed; 
        height: 100vh;
        min-width: 30vw;
        margin: 0;
        padding: 0; /* Remove padding */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Change from flex-start to center */
        gap: 2rem; /* Add consistent gap */
    }

    .nav-link::after {
        display:none;
    }

    .nav-link.hover::after {
        display:none;
    }

    .language-buttons .JezikiBtn {
        display: flex; /* Added to contain image */
        align-items: center;
        justify-content: center;
        height: 35px; /* Set fixed height for buttons */
    }

    .language-buttons .JezikiBtn img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Maintain aspect ratio */
    }

    #HomeBtn {
        display: flex !important; /* Force display */
        min-width: 80px; 
        min-height: 80px; 
        font-size: 1.8rem !important;
        background-color: var(--secondary-color);
        color: var(--primary-bg) !important;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    }

    .fa-home {
        font-size: 2.5rem;
    }

    #divnavbar {
        position: static; 
        height: auto; 
        min-height: 0; 
        margin: 0; 
        padding: 0; 
    }

    .container {
        margin: 0; 
        padding: 0;
        justify-content: space-between;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        font-size: inherit;
    }

    .nav-link {
        color: var(--secondary-color) !important;
        font-size: 1.6rem !important;
        padding: 1rem 0.5rem;
        min-height: 44px;
        width: 100%;
        display: block;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .menu-toggle {
        visibility: visible;
        position: fixed;
        top: 40px;
        right: 40px;
        z-index: 10000;
        min-width: 60px;     
        min-height: 60px;    
        background: var(--primary-bg);
        transition: all 0.3s ease;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8px;    /* Reduced padding */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }

    .menu-toggle span {
        display: block;
        min-width: 40px;
        height: 5px;
        margin: 3px 0;
        background-color: var(--secondary-color);
        border-radius: 3px;
        transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
        transform-origin: center;
    }

    .menu-toggle.active {
        background-color: var(--secondary-color);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    }

    .menu-toggle.active span{
        background-color: var(--primary-bg);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(11px) rotate(45deg); /* Adjusted translation */
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg); /* Adjusted translation */
    }

    .logo-button img {
        height: 60px !important;
    }


    #logo {
        position: absolute;
        left:40px;
        top:5px;
        z-index: 1;
        margin-bottom: 45px;
    }

    #logo img {
        height: 80px;
    }

    .visibility {
        visibility: hidden;
    }

    /* Language buttons scaling */
    .language-buttons .JezikiBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;   /* Changed from fixed px */
        height: 2.5rem;  /* Changed from fixed px */
        min-width: 35px; /* Minimum size */
        min-height: 35px;
    }

    .language-buttons .JezikiBtn img {
        width: 2.2rem;    /* Changed from fixed 35px */
        height: 2.2rem;   /* Changed from fixed 35px */
        min-width: 32px;  /* Minimum size */
        min-height: 32px;
        object-fit: contain;
    }

    .slideNovice {
        width: 300px;
    }

    .Popust {
        height: 90px;
        width: 90px;
        font-size: 1.4rem;
        top: -175px;
        right: 10px;
    }

    .slide {
        height: 300px;
        width: 250px;
    }

    .slide img {
        width: 180px;
    }

    #partnerji {
        height: 55vh;
        min-height: 55vh;
    }

    #slikePartnerjev {
        height: auto; /* Change from percentage to auto */
        min-height: 100px; /* Add minimum height */
        padding: 1rem;
        margin-bottom: 0; /* Remove bottom margin */
    }

    #slikePartnerjev img {
        width: 75%;
        min-width: 70px;
    }

    #HormannSVG img{
        width:82% !important;
    }

    #Hisa {
        flex-direction: column;
        height: auto; /* Change from fixed height */
        gap: 1rem; /* Reduce gap between elements */
        margin-bottom: 2rem; /* Reduce bottom margin */
    }

    #HisaGrafika {
        display: none;
    }

    #HisaLevo {
        width: 100%;
        height: auto; /* Remove fixed height */
        gap: 1rem; /* Add consistent gap */
    }

    #HisaDesno {
        width: 100%;
        height: auto; /* Remove fixed height */
    }

    #HisaIzdelki {
        height: auto; /* Change from fixed height */
        min-height: 400px; /* Add minimum height */
    }

    .IzdelekLogo img {
        width: 30%;
        min-width: 150px !important;
    }

    .IzdelekOpis p{
        font-size: 1.4rem;
        padding: 0.5rem 0;
    }
    
    /* Adjust product grid layout for mobile */
    .IzdelekSlike {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important; /* Change to 2 columns */
        grid-template-rows: auto !important;
        gap: 10px;
        height: auto;
        margin-top: 0.5rem;
    }

    /* Redefine grid areas for mobile */
    #arcont-images {
        grid-template-areas: 
            'slika1 slika2'
            'slika3 slika4' !important;
    }

    #horman-images {
        grid-template-areas: 
            'slika1 slika2'
            'slika3 slika4' !important;
    }

    #inotherm-images {
        grid-template-areas: 
            'slika1 slika2'
            'slika3 slika4' !important;
    }

    /* Adjust image containers */
    

    /* Ensure images maintain aspect ratio */
    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Adjust container spacing */
    #HisaIzdelki {
        padding: 0.8rem;
    }

    #PovzetekIzdelkov {
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .transition-panel {
        position: absolute;
        width: 100%;
        height: auto;
        min-height: 400px;
        transition: 
            transform 0.5s ease,
            opacity 0.3s ease;
    }

    #galerija {
        padding: 0.5rem 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
        grid-template-areas: 
        'one two'
        'three four'
        'five six'
        'seven eight';
        max-height: 800px;
    }

    .gallery-item {
        border-radius: 10px;
    }

    #Socialna {
        margin-bottom: 6rem;
    }

    #socialna-divbtn {
        max-width: 80px;
        max-height: 80px;
    }

    #socialna-divbtn .fa {
        font-size: 3.5rem;
    }

    .productCard {
        height: 25vh;
        width: 40vw;
    }

    .productH3 h3 {
        font-size: 1.4rem !important; 
        font-weight: 400 !important;
    }

    .kontakt-container {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 1rem;
        padding: 1rem;
    }

    .kontakt-data {
        width: 100%; /* Full width in new row */
    }    

    .kontakt-container {
        width:100%;
        gap: 1rem;
        padding: 1rem;
    }

    .kontakt-data td a,
    .kontakt-data p,
    .kontakt-data i,
    .kontakt-data .i-link {
        font-size: 1rem;
    }


    #poslji-divbtn {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .scroll-top-btn {
        width: 60px;
        height: 60px;
    }

    .scroll-top-btn .fa {
        font-size: 1.8rem;
    }

    .fspan {
        align-items: flex-start;
    }

    .fspanspan {
        flex-wrap: wrap;
        gap:1rem;
    }

    #footcontent {
        display: flex;
        padding: 10px 20px;
        font-size: 1rem;
        align-items: flex-start; /* Changed from center */
        justify-content: center;
        margin: 0;
        width: 100%;
        height: 16vh;
        gap: 20px;
    }

    
}


/* Tablet - Landscape (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    :root {
        font-size: 13px;
    }


    .nav-item {
        width: 100%;
        text-align: center;
        font-size: 1.3rem !important; /* Minimum font size */
        padding: 0.5rem;
    }

    .nav-link {
        font-size: 1.5rem !important; /* Minimum font size */
        padding: 0.8rem;
        min-height: 44px; 
    }
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }

    .modal h3 {
        font-size: 1.5rem;
    }
}

/* Tablet - Portrait (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    :root {
        font-size: 13px;
    }

    h1 {
        font-size: 2.6rem !important;
    }

    #o_nas h1::after {
        bottom: 1.6rem;
    }

    #kontakt h1::after, #partnerji h1::after, #galerija h1::after, #ponudba h1::after {
        bottom: 0.3rem;
    }

    .navbar-visible {
        width: 50vw;
        right: -50vw;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        font-size: 1.2rem ; /* Minimum font size */
        padding: 0.5rem;
        margin: 0.2rem 0;
    }

    .nav-link {
        font-size: 1.6rem; /* Minimum font size */
        padding: 0.8rem;
        min-height: 44px; /* Maintain minimum touch target */
    }

    #o_nas div h2 {
        font-size: 1.2rem !important;
    }

    #o_nasContent {
        font-size: 1rem;
    }

    .content-text {
        max-height: 115px;
    }

    .slider-btn {
        display:none;
    }

    #Hisa {
        margin-top: 5rem;
    }

    #galerija {
        padding: 2rem 3.5rem;
    }

    .gridImage {
        height: 150px; /* Fixed height for mobile */
        width: 100%;
    }

    #socialna-divbtn {
        padding: 10px 15px; 
    }

    #socialna-divbtn .fa {
        font-size: 2.6rem;
    }

    .konfig-txt {
        justify-content: center;
    }

    .konfig-txt div {
        padding: 0 2rem;
    }

    .konfig-txt h2{
        font-size: 2.4rem !important;
        text-align: center;
    }

    .konfig-txt h3{
        font-size: 0.8rem;
        text-align: center;
    }

    .konfig-txt i {
        display:none;
    }

    #Socialna {
        margin-bottom: 4.5rem;
    }

    #ponudba {
        height: auto; /* Remove fixed height */
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .productCard:hover .productInner {
        transform: rotateX(180deg) !important; /* Change Y axis to X axis */
    }

    .productBack {
        transform: rotateX(180deg) !important; /* Change Y axis to X axis */
    }

    .productInner {
        transform-style: preserve-3d;
        transition: transform 0.6s ease;
    }

    .productFront, .productBack {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        transform-style: preserve-3d;
    }

    .productBack span {
        font-size:1.3rem;
    }

    #ponudba-content {
        align-items: center;
        gap: 2rem;
        padding: 3rem 2rem;
        height: auto;
    }
    
    .productCard {
        height: 30vh; /* Increase height for better visibility */
        width: 45%;
        perspective: 1500px; /* Adjust perspective for X axis flip */
    }

    .productH3 {
        width: 70%;
    }

    .productH3 h3 {
        font-weight: 400;
        font-size: 1.4rem; 
    }

    #footcontent {
        min-height: 20vh;
        height: auto;
    }

    #footcontent h3 {
        font-size: 1.1rem;
    }

    #footcontent span {
        font-size: 0.9rem;
    }

    .kontakt-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }

    #kontakt-delovni-cas {
        width: calc(50% - 0.5rem);
        height: auto;
    }

    .kontakt-slika {
        width: calc(50% - 0.5rem);
    }

    .kontakt-data {
        width: 100%;
        margin-top: 1rem;
    }

    .kontakt-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .kontakt-column {
        padding: 0.8rem;
    }

    .kontakt-item {
        font-size: 0.9rem;
    }
}

/* Mobile (575px and below) */
@media (max-width: 575px) {
    :root {
        font-size: 12px;
    }

    h1 {
        font-size: 2.6rem !important;
    }

    .menu-toggle {
        top: 20px;
        right: 20px;
        min-height: 44px;
        min-width: 44px;
    }

    .menu-toggle span {
        min-width: 34px;
    }

    #logo {
        left:20px;
        top:-10px;
        z-index: 1;
    }

    #o_nas h1::after {
        bottom: 1.6rem;
    }

    #kontakt h1::after, #partnerji h1::after, #galerija h1::after, #ponudba h1::after {
        bottom: 0.3rem;
    }

    .navbar-visible {
        width: 50vw;
        right: -50vw;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        font-size: 1.2rem ; /* Minimum font size */
        padding: 0.5rem;
        margin: 0.2rem 0;
    }

    .nav-link {
        font-size: 1.6rem; /* Minimum font size */
        padding: 0.8rem;
        min-height: 44px; /* Maintain minimum touch target */
    }

    .slideNovice {
        width: 275px;
    }

    .noviceOpis {
        padding: 10px;
    }

    .noviceOpis h4 {
        font-size: 1rem;
    }

    .noviceOpis span {
        font-size: 0.9rem;
    }

    #o_nas div h2 {
        font-size: 1.2rem !important;
    }

    #o_nasContent {
        font-size: 1rem;
    }

    .content-text {
        max-height: 130px;
    }

    .read-more-btn {
        right: 40px;
        bottom: 10px;
    }

    #partnerji {
        height: auto;
        min-height: 45vh;
        margin-bottom: 10px;
    }

    .slide {
        height: 250px;
        width: 200px;
    }

    .slide img {
        width: 140px;
        height: 70px;
    }

    .slide span {
        font-size: 0.95rem;
    }

    .slider-btn {
        display:none;
    }

    #BeroksLogoDiv {
        height:80px;
    }

    .IzdelekOpis p {
        font-size: 1rem;
    }

    .gridImage {
        height: 150px; /* Fixed height for mobile */
        width: 100%;
    }

    #galerija {
        width: 100%;
        padding: 1rem 0.5rem;
        justify-content: center;
        align-items: center;
    }

    .gallery-grid {
        width: 100%;
        margin:0;
    }

    .gallery-item {
        border-radius: 10px;
    }
    
    #socialna-divbtn {
        padding: 10px 15px !important; 
    }

    #socialna-divbtn .fa {
        font-size: 2.6rem !important;
    }

    .konfig-txt {
        justify-content: center;
    }

    .konfig-txt div {
        padding: 0 2rem;
    }

    .konfig-txt h2{
        font-size: 2.4rem !important;
        text-align: center;
    }

    .konfig-txt h3{
        font-size: 0.8rem;
        text-align: center;
    }

    .konfig-txt i {
        display:none;
    }

    #socialna-div {
        margin-bottom: 3rem;
    }

    .kontakt-data >*{
        font-size: 1rem;
    }

    #ponudba-content {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 3rem 3rem;
        height: auto;
    }
    
    .productCard {
        height: 30vh; /* Increase height for better visibility */
        width: 100%;
        margin: 0 auto;
        perspective: 1500px; /* Adjust perspective for X axis flip */
    }

    ponudba {
        height: auto; /* Remove fixed height */
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .productCard:hover .productInner {
        transform: rotateX(180deg) !important; /* Change Y axis to X axis */
    }

    .productBack {
        transform: rotateX(180deg) !important; /* Change Y axis to X axis */
    }

    .productBack span {
        font-size:1.1rem;
    }

    .productInner {
        transform-style: preserve-3d;
        transition: transform 0.6s ease;
    }

    .productFront, .productBack {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        transform-style: preserve-3d;
    }

    

    .productH3 {
        width: 60%;
    }

    .productH3 h3 {
        font-weight: 400;
        font-size: 1.7rem; 
    }

    #ponudba {
        height: auto; /* Remove fixed height */
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    #footcontent {
        min-height: 20vh;
        height: auto;
    }

    #footcontent h3 {
        font-size: 1.1rem;
    }

    #footcontent span {
        font-size: 0.9rem;
    }

    .kontakt-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    #kontakt-delovni-cas {
        width: 100%;
        height: auto;
    }

    .kontakt-slika {
        width: 100%;
        height: 250px;
    }

    .kontakt-data {
        width: 100%;
    }

    .kontakt-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .kontakt-column {
        padding: 0.5rem;
    }

    #direktKontakt {
        display: none; /* Hide on mobile */
    }

    .kontakt-item, .kontakt-item span {
        font-size: 0.9rem;
    }

    .kontakt-item i {
        width: 15px;
        margin-right: 0.5rem;
    }

    .scroll-top-btn {
        z-index: 9995;
    }
}

@media (max-width: 475px) {

    .nav-item {
        font-size: 1rem ; /* Minimum font size */
        padding: 0.3rem;
        margin: 0.2rem;
    }

    .nav-link {
        font-size: 1.2rem !important; /* Minimum font size */
        padding: 0.6rem;
        min-height: 44px; /* Maintain minimum touch target */
    }

    #HomeBtn {
        display: flex !important; /* Force display */
        min-width: 60px; 
        min-height: 60px; 
        font-size: 1.4rem !important;
    }

    #slika1 {
        height: 75vh;
    }

    .slideNovice {
        height: 200px;
        width: 200px;
    }

    .noviceOpis {
        display: flex;
        align-items: center;
        height: auto;
    }

    .noviceOpis span{
        display: none;
    }

    .Popust {
        height: 60px;
        width: 60px;
        font-size: 1.1rem;
        top: -100px;
        right: 10px;
    }

    #Hisa {
        padding: 1rem;
    }

    .konfig-txt div {
        padding: 0 1.5rem;
    }

    .konfig-txt h2{
        font-size: 2rem !important;
    }

    .konfig-txt h3{
        font-size: 0.7rem;
    }

    #Socialna {
        margin-bottom: 14rem;
    }

    .konfig-txt_H2 {
        padding: 0;
    }

    .konfig-txt_H3 {
        width: 100%;
        text-align: center;
        gap:0;
    }

    .productBack span {
        font: size 0.9rem;
    }

    .kontakt-grid {
        padding-top: 10px;
        padding-left: 10px;
    }

    .kontakt-item {
        font-size: 1.4rem;
    }

    .kontakt-item span {
        font-size: 1.1rem;
    }

    .kontakt-column:not(:last-child):hover {
        background-color: transparent;
    }

    #infoStrani, #kontaktStrani, #slediStrani {
        font-size: 1.1rem !important;
        margin-bottom: 10px;
    }

    #footcopy div{
        font-size: 0.9rem;
    }
}

