/**
 * ZIMB.eu Responsive Media Queries
 * A comprehensive set of responsive styles for all page layouts
 */

/* Base responsive layout adjustments */
@media screen and (max-width: 1800px) {


    body .catalogs-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    html body .nav-menu-top-inside-right a {
        margin: 7px -4px 0 0;
    }

    .video-bg, .no-video {
        height: 70vh;
    }

    .video-wrapper::before {
        height: 70vh;
    }

    .shop-card {
        padding: 1.5rem 1rem .75rem 2rem;
    }

    .product-container {
        max-width: 100%;
        margin: 96px auto;
        padding: 0 2rem;
    }
    
    .shop-list.grid-view {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Base responsive layout adjustments */
@media screen and (max-width: 1200px) {
    .product-container {
        max-width: 95%;
    }
    
    .shop-list.grid-view {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tablet and smaller laptop screens */
@media screen and (max-width: 992px) {
    .product-header {
        grid-template-columns: 1fr 2fr;
        gap: 1rem;
    }
    
    .product-image {
        width: 220px;
        height: 220px;
    }
    
    .view-controls {
        position: relative;
        width: 100%;
        text-align: left;
        height: auto;
        margin-bottom: 1rem;
    }
    
    .price-comparison h2 {
        font-size: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .shop-card {
        padding: 1rem;
    }
    
    /* Search responsiveness */
    .search-container {
        width: 280px;
    }
    
    .search-input {
        width: 100%;
    }
    
    /* Map page adjustments */
    html body .leaflet-left {
        right: 10px;
    }
    
    /* Video page adjustments */
    .left, .right {
        padding: 1rem;
    }
    
    .productsContainer {
        padding: 0;
    }
}

/* Larger mobile devices and small tablets */
@media screen and (max-width: 768px) {

    html body .dynamic-section.active {
        border-radius: 0!important;
    }

    html body .left, html body .right {
        position: relative!important;
        height: 50%!important;
    }

    html body .nav-menu a.izaberiGrad {
        min-width: 160px;
        font-size: 14px;
        margin: 4px 8px 0 0;
    }

    .hide-on-mobile {
        display: none!important;
    }

    html body .nav-menu-top {
        height: 44px!important;
    }

    html body .dynamic-section {
        width: 100%;
        height: calc(100vh - 104px)!important;
    }

    html body .next-image {
        margin: 7px 0 0 32px!important;
    }

    html body .labelTextleft {
        padding: 8px 32px 0 52px!important;
        text-align: left;
        display: block;
        line-height: 1.1!important;
    }

    html body .labelTextright {
        display: none!important;
    }

    html body #videoTimerContainer {
        display: none;
        opacity: 0;
    }

    html body .search-input {
        min-width: 100px;
        font-size: 12px;
        font-weight: 700;
        max-width: 250px;
    }

    html body .search-container {
        float: none;
        display: none!important;
    }

    #nextSectionName p span {
        font-size: 12px;

    }

    html body .autoplay-button {
        bottom: 48px;
        margin-right: -20px;
        width: 40px;
        height: 40px;
        box-shadow: none;
        border: none;
    }

    html body .autoplay-progress {
        top: 0;
        left: 0;
        width: 40px;
        height: 40px;
    }

    html body #nextSectionName {
        width: 100%;
        left: 0;
        margin-left: 0;
        height: 50px!important;
        bottom: 44px!important;
    }

    html body #nextSectionName p {
        box-shadow: none;
        border-radius: 0;
    }

    html body .city-selector {
        display: block;
        margin: 0 auto;
        text-align: center;
    }

    /* Navigation adjustments */
    .nav-menu-top-inside-right > a,
    .nav-menu-top-inside-right > button {
        padding: 0 6px;
        font-size: 12px;
    }
    
    /* Header & product page adjustments */
    .product-container {
        margin: 60px auto;
    }
    
    .product-header {
        grid-template-columns: 1fr;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .product-image-container {
        margin: 0 auto;
    }
    
    .product-details {
        padding: 0 1rem;
    }
    
    .shop-list.grid-view {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .thumbs-up {
        right: 0;
    }
    
    /* Search adjustments */
    .search-container {
        width: 200px;
        margin: 0 5px;
    }
    
    .search-input {
        font-size: 12px;
        height: 34px;
        line-height: 34px;
    }
    
    /* Swiper adjustments */
    .swiper-container {
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Layout fixes */
    html body .catalogs-wrapper {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .nav-menu a {
        padding: 0 10px;
    }
}

/* Mobile portrait - iPhone sizes */
@media screen and (max-width: 576px) {

    html body #navMenu.nav-menu.show.fadeOut .copyRight {
        right: 24px;
        bottom: 8px;
    }

    /* Navigation */
    .nav-menu-top {
        height: auto;
        min-height: 44px;
    }
    
    .nav-menu-top-inside-left {
        float: left;
        width: 25%;
        text-align: center;
    }

    html body .nav-menu-top-inside-right {
        float: right;
        width: 75%;
        text-align: right;
    }
    
    .nav-menu-top-inside-right {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }
    
    .zimbLogoXS {
        height: 30px;
        margin: 7px 0;
    }
    
    /* Search optimizations */
    .search-container {
        width: 100%;
        margin: 5px 0;
        float: none;
    }
    
    .search-input {
        width: 100%;
        font-size: 14px;
    }
    
    /* Product layout optimizations */
    .product-image {
        width: 180px;
        height: 180px;
        border-width: 10px;
    }

    .lowest-price {
        height: 60px;
        width: 60px;
        font-size: 18px;
        line-height: 50px;
    }
    
    .currency {
        bottom: 8px;
        font-size: 10px;
    }
    
    .best-price-info {
        border-width: 8px;
        padding: 1rem;
    }
    
    html body .best-price-info h3 {
        font-size: 1rem;
    }
    
    .shop-card {
        padding: 1rem;
    }
    
    .shop-name {
        font-size: 16px;
    }
    
    .shop-address, .shop-phone, .shop-email {
        font-size: 12px;
    }
    
    .view-on-map {
        font-size: 12px;
        padding: 6px 16px 8px 36px;
        background-size: 18px;
        background-position: left 10px center;
    }
    
    .price {
        font-size: 18px;
    }
    
    /* Video page specific layouts */
    html body #zimbIntro {
        width: 180px;
        height: 90px;
        margin: -45px 0 0 -90px;
    }
    
    html body #hours-wrapper {
        justify-content: center;
        margin: 0 auto 10px;
    }
    
    .featuredHeadline {
        font-size: 16px !important;
        padding: 10px !important;
    }
    
    /* Map page adjustments */
    #map {
        height: calc(100vh - 44px);
    }
    
    .leaflet-container {
        font-size: 12px;
    }
    
    html body .swal2-container.swal2-center > .swal2-popup {
        padding-top: 60px;
    }
    
    html body .left,
    html body .right {
        position: relative;
        width: 100%;
        top: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        overflow: auto;
    }
    
    /* Fix star ratings on small screens */
    .stars-container {
        width: 100%;
    }
    
    .star {
        font-size: 24px;
    }
}

/* Very small devices - mini phones */
@media screen and (max-width: 375px) {
    .product-image {
        width: 150px;
        height: 150px;
    }
    
    .nav-menu-top-inside-right > a,
    .nav-menu-top-inside-right > button {
        padding: 0 4px;
        font-size: 11px;
    }
    
    .search-input {
        height: 32px;
        line-height: 32px;
        padding: 0 12px;
    }
    
    .view-btn {
        padding: 6px 12px 6px 30px;
        font-size: 12px;
    }
    
    .view-btn svg {
        width: 12px;
        height: 12px;
        left: 12px;
    }
    
    /* Fix popup display */
    .shopMainLogo {
        max-width: 150px;
        height: 40px;
    }
}

/* Extra small mobile devices - adjust text sizes for better fit */
@media screen and (max-width: 480px) {

    html body #verified-shops-label {
        position: relative;
        height: 44px;
    }

    html body #price-trend-bar {
        height: 110px;
    }

    html body #ticker-clock {
        position: relative;
        height: 44px;
    }

    html body .price-trend-content {
        padding-left: 0;
        display: block;
        position: relative;
    }

    /* Make "SLJEDEĆE" text smaller */
    #nextSectionName p span {
        font-size: 10px !important;
    }
    
    #nextSectionName p {
        font-size: 14px !important;
    }
    
    /* Make address, phone, email text smaller */
    html body .left p,
    html body .right p {
        font-size: 14px !important;
        margin-bottom: 12px !important;
        margin-top: 20px !important;
    }
    
    html body .left p .zimbYellow,
    html body .right p .zimbYellow {
        font-size: 16px !important;
    }
    
    /* Reduce SVG icon sizes */
    html body .left p svg,
    html body .right p svg {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Even smaller devices - further reduce text sizes */
@media screen and (max-width: 360px) {
    /* Further reduce "SLJEDEĆE" text */
    #nextSectionName p span {
        font-size: 9px !important;
    }
    
    #nextSectionName p {
        font-size: 12px !important;
    }
    
    /* Further reduce address, phone, email text */
    html body .left p,
    html body .right p {
        font-size: 12px !important;
        margin-bottom: 10px !important;
        margin-top: 16px !important;
    }
    
    html body .left p .zimbYellow,
    html body .right p .zimbYellow {
        font-size: 14px !important;
    }
    
    /* Further reduce SVG icon sizes */
    html body .left p svg,
    html body .right p svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Reduce featured headline size */
    .featuredHeadline {
        font-size: 14px !important;
        padding: 8px !important;
    }
    
    /* Make shop logo smaller */
    .shopMainLogo {
        max-width: 120px !important;
        height: 32px !important;
    }
    
    /* Reorganize price trend bar for mobile - put price-trend-text on its own line */
    #price-trend-bar,
    #price-trends-bar {
        height: 88px !important; /* Fixed height for two lines */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Hide clock completely on mobile */
    #ticker-clock {
        display: none !important;
    }
    
    #verified-shops-label {
        position: relative !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        height: 44px !important;
        text-align: center !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 10px !important;
        order: 1 !important;
        background-color: #ffcc29 !important;
        color: #000 !important;
    }
    
    #ticker-time-only {
        margin-left: 8px !important;
        padding: 2px 6px !important;
        background-color: rgba(255,255,255,0.9) !important;
        color: #000 !important;
        display: inline-block !important;
        font-weight: bold !important;
        border-radius: 3px !important;
        font-size: 9px !important;
        white-space: nowrap !important;
    }
    
    .price-trend-content {
        width: 100% !important;
        height: 44px !important;
        background-color: #fff !important;
        display: block !important;
        position: relative !important;
        order: 2 !important;
        overflow: hidden !important;
    }
    
    #price-trend-text {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        transform: translateX(100%) !important;
        animation: scrollPriceTrendMobile 60s linear infinite !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        height: 44px !important;
        line-height: 44px !important;
        display: block !important;
        padding: 0 !important;
    }
    
    @keyframes scrollPriceTrendMobile {
        0% { transform: translateX(100%); }
        100% { transform: translateX(-100%); }
    }
}

/* Print styles */
@media print {
    .nav-menu-top,
    .nav-menu,
    .view-controls,
    .video-bg,
    .play-button,
    .search-container {
        display: none !important;
    }
    
    .product-container {
        max-width: 100%;
        margin: 0;
    }
    
    .product-header {
        grid-template-columns: 1fr 2fr;
        page-break-after: avoid;
    }
    
    .shop-list {
        page-break-before: auto;
    }
    
    .shop-card {
        page-break-inside: avoid;
        border: 1px solid #999;
    }
    
    body {
        font-size: 12pt;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Only apply if the site wants to support dark mode */
    .search-input {
        background-color: #333;
        color: #fff;
        border-color: #555;
    }
    
    .search-suggestions {
        background-color: #333;
        border-color: #555;
    }
    
    .search-suggestion:hover {
        background-color: #444;
    }
    
    .suggestion-name {
        color: #eee;
    }
    
    .suggestion-type {
        color: #aaa;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    #map {
        height: -webkit-fill-available;
    }
    
    .video-bg {
        height: 50vh; /* Fallback */
        height: -webkit-fill-available;
    }
}
