/* ============================================
   SKYMAT - Responsive Styles
   ============================================ */

/* ---- Tablet landscape ---- */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        gap: 40px;
    }

    .nav-link {
        padding: 8px 14px;
        font-size: var(--font-size-xs);
    }

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

    .product-listing-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---- Tablet portrait ---- */
@media (max-width: 992px) {
    :root {
        --header-height: 89px;
        --topbar-height: 47px;
    }

    /* Solid red, no blur on mobile */
    .header {
        background: var(--color-primary);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Topbar scrolls away naturally */
    .topbar {
        position: relative;
    }

    /* Sticky — browser handles it natively, zero layout jump */
    .header {
        position: sticky !important;
        top: 0;
        transition: box-shadow 0.4s ease;
    }

    /* Subtle shadow when header locks to top */
    .header.header--scrolled {
        box-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
    }

    .nav-desktop {
        display: none;
    }

    .country-selector {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .logo-img {
        width: 200px;
    }

    .hero-slider {
        height: 81vh;
    }

    .slide-content {
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .slide-text-box {
        width: 92%;
        max-width: none;
        padding: 36px 32px;
    }

    .slide-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .slide-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }

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

    .news-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    /* Footer — centered mobile-style od 992 nižšie (pred to bol 2-col, ale
       Denis chcel mobile-centered layout už pri tomto viewport, nie až pri 768). */
    .footer-main {
        padding: 36px 0 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .footer-col {
        padding: 20px 0;
        text-align: center;
    }

    .footer-col:last-child {
        padding-bottom: 4px;
    }

    .footer-brand {
        grid-column: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding-bottom: 24px;
    }

    .footer-logo-img {
        width: 247px;
    }

    /* Vertical dividers become horizontal separators */
    .footer-divider-v {
        display: block;
        width: calc(100% - 48px);
        height: 1px;
        align-self: auto;
        background: rgba(255, 255, 255, 0.75);
        margin: 0 auto;
    }

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

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

    .footer-bottom-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0;
    }

    .footer-bottom-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
    }

    .company-text strong {
        font-size: var(--font-size-xl);
    }

    /* Company text — na viewport 769-992 musí povoliť wrap (baseline má nowrap
       pre desktop, ale pri úzkom viewporte text prečnieva mimo obrazovky). */
    .company-text-main,
    .company-text-sub {
        white-space: normal;
    }
}

/* ---- Mobile landscape ---- */
@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
    }



    .hero-slider {
        height: 75vh;
    }

    .slide-text-box {
        width: 94%;
        max-width: none;
        padding: 30px 26px;
    }

    .slide-title {
        font-size: 1.55rem;
        line-height: 1.3;
    }

    .slide-subtitle {
        font-size: 1rem;
        line-height: 1.6;
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    .categories-section {
        padding: 43px 0 36px;
    }

    .categories-section .section-title {
        font-size: 1.6rem;
        font-weight: 900;
    }

    .products-section-title {
        font-size: 1.6rem;
        font-weight: 900;
    }

    .product-listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-listing-name {
        font-size: 0.95rem;
    }

    .product-listing-btn {
        font-size: 0.85rem;
        padding: 7px 16px;
    }

    /* Product detail — mobile layout */
    .product-detail-section {
        padding: 32px 0 48px;
        overflow: hidden;
    }

    .product-detail-top {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0;
    }

    .product-images-desktop {
        display: none;
    }

    .product-detail-title {
        font-size: 1.5rem;
    }

    /* Mobile gallery carousel */
    .product-gallery-mobile {
        display: block;
        overflow: hidden;
        margin: 16px calc(-1 * var(--container-padding)) 28px;
    }

    .product-gallery-track {
        display: flex;
        will-change: transform;
    }

    .product-gallery-slide {
        flex: 0 0 calc(50vw - 20px);
        margin-right: 10px;
        aspect-ratio: 1 / 1;
        border-radius: var(--radius-md);
        overflow: hidden;
        background: var(--color-gray-100);
        flex-shrink: 0;
    }

    .product-gallery-slide a {
        display: block;
        width: 100%;
        height: 100%;
    }

    .product-gallery-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Inquiry form — 10% smaller on mobile */
    .inquiry-modal {
        padding: 28px 24px;
        max-width: 100%;
    }
    .inquiry-title { font-size: 1.3rem; }
    .inquiry-label { font-size: 0.8rem; }
    .inquiry-input { font-size: 0.85rem; padding: 8px 12px; }
    .inquiry-row { margin-bottom: 12px; }
    .btn-inquiry-submit { font-size: 0.9rem; padding: 12px 24px; }
    .inquiry-gdpr { font-size: 0.78rem; }

    .product-cat-footer {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 12px;
        min-height: 148px;
    }

    .product-cat-card:hover {
        transform: none;
    }

    .product-cat-name {
        font-size: 1.2rem;
    }

    /* Break carousel out of container — buttons go edge-to-edge */
    .categories-carousel-wrap {
        margin-left: calc(-1 * var(--container-padding));
        margin-right: calc(-1 * var(--container-padding));
    }

    .company-section {
        padding: 62px 0;
    }

    .company-text {
        text-align: center;
        margin: 0 auto;
    }

    .company-text-main,
    .company-text-sub {
        font-size: 2.8rem;
        /* Na mobile prepnúť späť na wrap — inak text prečnieva mimo obrazovky.
           Nowrap je nastavený v baseline pre desktop kde sa text musí zmestiť do 1 riadku. */
        white-space: normal;
    }

    .company-text p {
        font-size: var(--font-size-base);
    }

    .company-text strong {
        font-size: var(--font-size-lg);
    }

    .news-section {
        padding: 40px 0 60px;
    }

    /* No hover lift on touch */
    .news-card:hover {
        transform: none;
    }

    /* Filter -15% */
    .news-filter-toggle {
        padding: 14px 26px;
        font-size: 1.19rem;
    }

    .news-filter-menu {
        min-width: 238px;
    }

    .news-filter-option {
        padding: 14px 20px;
        font-size: 0.98rem;
    }

    /* News header: title centered, filter below */
    .news-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        margin-bottom: 32px;
    }

    .news-section-title {
        font-size: 1.6rem;
    }

    /* Filter menu centered under button */
    .news-filter-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-4px);
    }

    .news-filter-dropdown.open .news-filter-menu {
        transform: translateX(-50%) translateY(0);
    }

    /* Carousel: one full-width card with side inset */
    .news-carousel-wrap {
        padding-top: 24px;
        overflow: hidden;
        margin: 0 20px;
    }

    .news-card {
        flex: 0 0 100%;
    }

    .news-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }

    .news-filters::-webkit-scrollbar {
        display: none;
    }

    /* ---- Footer mobile ---- */
    .footer-main {
        padding: 36px 0 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .footer-col {
        padding: 20px 0;
        text-align: center;
    }

    .footer-col:last-child {
        padding-bottom: 4px;
    }

    .footer-brand {
        grid-column: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding-bottom: 24px;
    }

    .footer-logo-img {
        width: 247px;
    }

    /* Vertical dividers become horizontal separators (override the display:none from 992px) */
    .footer-divider-v {
        display: block;
    }

    .footer-divider-v {
        width: calc(100% - 48px);
        height: 1px;
        align-self: auto;
        background: rgba(255, 255, 255, 0.75);
        margin: 0 auto;
    }

    /* Third separator matching upper two */
    .footer-bottom {
        border-top: none;
        position: relative;
    }

    .footer-bottom::before {
        content: '';
        display: block;
        width: calc(100% - 80px);
        height: 1px;
        background: rgba(255, 255, 255, 0.75);
        margin: 0 auto 16px;
    }

    .footer-heading {
        font-size: 1.72rem;
        font-weight: 900;
        margin-bottom: 16px;
        text-align: center;
    }

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

    .footer-nav a {
        font-size: 1rem;
    }

    .footer-address {
        font-size: 1rem;
        text-align: center;
    }

    .footer-bottom {
        padding: 16px 0 20px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0;
    }

    .footer-bottom-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
    }

    .footer-bottom-links a {
        font-size: 0.9rem;
    }

    .footer-copyright {
        font-size: 0.71rem;
        padding: 10px 0;
    }
}

/* ---- Mobile portrait ---- */
@media (max-width: 768px) {
    .career-section {
        padding: calc((var(--topbar-height) + var(--header-height)) * 0.7) 0 48px;
    }
}

@media (max-width: 768px) {
    /* Na tablete skry GDPR */
    .topbar-link-secondary {
        display: none;
    }

    /* Career cards — stacked layout */
    .career-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 24px 24px 20px;
    }

    .career-card-num {
        font-size: 5rem;
        right: 16px;
        top: 16px;
        transform: none;
    }

    .career-card-footer {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .career-header-title {
        font-size: 2rem;
    }

    .job-modal {
        padding: 32px 24px;
    }

    .job-modal-title {
        font-size: 1.4rem;
    }

    /* Floating button — menší padding, ale text zostáva */
    .contact-float {
        padding: 12px 18px 12px 14px;
        font-size: 0.82rem;
        bottom: 24px;
        right: 20px;
    }
}

@media (max-width: 576px) {
    .topbar-links a {
        padding: 0 10px;
        font-size: 0.78rem;
    }

    /* Telefónne číslo — zobraz aj text aj ikonku */
    .topbar-phone span {
        display: inline;
        font-size: 0.82rem;
    }

    .topbar-phone svg {
        width: 16px;
        height: 16px;
    }

    .hero-slider {
        height: 69vh;
    }

    .slide-text-box {
        width: 96%;
        max-width: none;
        padding: 26px 22px;
    }

    .slide-title {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .slide-subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .news-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .news-card-title {
        font-size: 28px;
        padding: 0 0 4px;
        line-height: 1.25;
    }

    .news-card-subtitle {
        font-size: var(--font-size-xs);
    }

    .news-card-body {
        padding: 16px 14px;
    }

    /* Show dot indicators on small mobile */
    .news-dots {
        display: flex;
    }

    .category-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ---- Very small screens ---- */
@media (max-width: 380px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}
