/* ==========================================================================
   VientoMosse — Responsive Breakpoints
   Mobile-first approach
   ========================================================================== */

/* ==========================================================================
   Max 1200px — Large tablets / small desktops
   ========================================================================== */

@media (max-width: 1200px) {
    .shop-preview__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .footer-widgets {
        gap: var(--vm-space-xl);
    }
}

/* ==========================================================================
   Max 992px — Tablets
   ========================================================================== */

@media (max-width: 992px) {
    :root {
        --vm-header-height: 70px;
    }

    /* Header — show hamburger */
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--vm-space-3xl) var(--vm-space-xl) var(--vm-space-xl);
        box-shadow: -4px 0 30px var(--vm-shadow-lg);
        transition: right var(--vm-transition);
        overflow-y: auto;
    }

    .main-navigation.toggled {
        right: 0;
    }

    .primary-menu {
        flex-direction: column;
        gap: 0;
    }

    .primary-menu li a {
        padding: 0.85rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--vm-border);
    }

    .primary-menu li a::after {
        display: none;
    }

    .primary-menu .sub-menu {
        position: static;
        box-shadow: none;
        padding: 0 0 0 var(--vm-space-lg);
        display: block;
    }

    /* Mobile menu overlay */
    .main-navigation::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(26, 35, 50, 0.5);
        z-index: -1;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--vm-transition);
    }

    .main-navigation.toggled::before {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hamburger animation */
    .menu-toggle[aria-expanded="true"] .hamburger__line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle[aria-expanded="true"] .hamburger__line:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] .hamburger__line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Featured grid */
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card--1 {
        grid-row: auto;
    }

    .featured-card__image-wrap {
        min-height: 250px;
    }

    /* About teaser */
    .about-teaser__grid {
        grid-template-columns: 1fr;
        gap: var(--vm-space-xl);
    }

    .about-teaser__image-col {
        order: -1;
    }

    /* Shop preview */
    .shop-preview__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Product layout */
    .vm-product-single__layout {
        grid-template-columns: 1fr;
    }

    .vm-product-single__gallery {
        position: static;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery masonry */
    .gallery-masonry {
        columns: 2;
    }

    /* Footer */
    .footer-widgets {
        grid-template-columns: 1fr 1fr;
    }

    .footer-widgets > :first-child {
        grid-column: span 2;
    }

    /* Post navigation */
    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-navigation .nav-next {
        text-align: left;
    }

    /* WooCommerce grid */
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================================================
   Max 768px — Large phones / small tablets
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --vm-space-2xl: 3rem;
        --vm-space-3xl: 5rem;
    }

    .vm-container {
        padding: 0 var(--vm-space-md);
    }

    /* Hero */
    .hero {
        min-height: 70vh;
    }

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

    .hero__actions .vm-btn {
        width: 100%;
        max-width: 280px;
    }

    /* Section titles */
    .vm-section-title {
        margin-bottom: var(--vm-space-lg);
    }

    /* Timeline — single column */
    .timeline::before {
        left: 20px;
    }

    .timeline__item,
    .timeline__item--left,
    .timeline__item--right {
        width: 100%;
        margin-left: 0;
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
    }

    .timeline__item--left .timeline__marker,
    .timeline__item--right .timeline__marker {
        left: 13px;
        right: auto;
    }

    /* World map */
    .world-map-section__iframe {
        height: 350px;
    }

    /* Search */
    .search-header__form {
        margin-top: var(--vm-space-lg);
    }

    /* Error 404 */
    .error-404__title {
        font-size: 5rem;
    }

    .error-404__actions {
        flex-direction: column;
        align-items: center;
    }

    /* Footer */
    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .footer-widgets > :first-child {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Gallery filters */
    .gallery-filters__bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--vm-space-md);
        -webkit-overflow-scrolling: touch;
    }

    .gallery-filter {
        flex-shrink: 0;
    }
}

/* ==========================================================================
   Max 576px — Small phones
   ========================================================================== */

@media (max-width: 576px) {
    html {
        font-size: 15px;
    }

    .site-title {
        font-size: 1.4rem;
    }

    .site-description {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 60vh;
    }

    .hero__content {
        padding: var(--vm-space-xl) var(--vm-space-md);
    }

    /* Shop grid — single column */
    .shop-preview__grid {
        grid-template-columns: 1fr;
    }

    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }

    /* Post cards — single column */
    .vm-posts-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery — single column */
    .gallery-masonry {
        columns: 1;
    }

    /* Buttons full-width */
    .vm-btn {
        width: 100%;
        text-align: center;
    }

    /* Lightbox nav */
    .lightbox__nav--prev {
        left: var(--vm-space-sm);
    }

    .lightbox__nav--next {
        right: var(--vm-space-sm);
    }

    /* Shop controls stack */
    .shop-controls {
        flex-direction: column;
        gap: var(--vm-space-md);
        align-items: flex-start;
    }

    /* WooCommerce single product details */
    .vm-product-single__details-inner {
        padding: var(--vm-space-lg);
    }

    .vm-product-single__details .product_title {
        font-size: 1.5rem;
    }

    /* Cart table responsive */
    .woocommerce-cart .woocommerce table.shop_table {
        display: block;
        overflow-x: auto;
    }
}

/* ==========================================================================
   Max 400px — Extra small
   ========================================================================== */

@media (max-width: 400px) {
    .site-header__inner {
        gap: var(--vm-space-sm);
    }

    .site-logo img {
        max-height: 40px;
    }

    .error-404__title {
        font-size: 4rem;
    }
}

/* ==========================================================================
   High-DPI / Retina
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Canvas texture can be swapped for @2x version here */
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .menu-toggle,
    .header-actions,
    .hero__edge,
    .gallery-filters,
    .lightbox,
    .vm-btn,
    .shop-controls,
    .post-navigation,
    .pagination {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

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

    img {
        max-width: 100% !important;
    }

    .vm-container {
        max-width: 100%;
        padding: 0;
    }
}
