/* MORASKI — mobile (iOS/Android) + desktop */

/* Áreas seguras (notch, home indicator) */
.header {
    padding-top: env(safe-area-inset-top, 0);
}
.container {
    padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.cart-panel {
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.toast {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
}
.back-top {
    right: calc(1.5rem + env(safe-area-inset-right, 0));
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
}
.nav {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Toque: alvos mínimos ~44px (Apple HIG / Material) */
.btn,
.filter-mobile-toggle,
.filter-chip,
.nav-link,
.nav-dropdown-btn,
.qty-btn,
.size-btn,
.product-thumb {
    touch-action: manipulation;
}
.icon-btn,
.menu-btn {
    min-width: 44px;
    min-height: 44px;
}
.filter-chip {
    min-height: 44px;
    padding: 0.5rem 0;
}
.size-btn {
    min-width: 48px;
    min-height: 48px;
}
.compare-handle {
    width: 56px;
}
.compare-handle i {
    width: 44px;
    height: 44px;
}

/* iOS: evita zoom ao focar inputs */
@media (max-width: 768px) {
    .filter-select,
    .shop-search input,
    .newsletter-form input,
    .auth-form input,
    .contact-form input,
    .contact-form textarea,
    .contact-form select {
        font-size: 16px;
    }
}

/* Sem hover “grudado” em touch */
@media (hover: none) {
    .product-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--line);
    }
    .product-card:hover .product-card-media img {
        transform: none;
    }
    .perk:hover,
    .category-tile:hover .category-tile-img {
        transform: none;
    }
    .btn-primary:hover {
        transform: none;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    }
    .shop-filters {
        padding-top: calc(1.25rem + env(safe-area-inset-top, 0));
    }
    .shop-filters.is-open {
        box-shadow: var(--shadow-md);
    }
    #filtersBackdrop {
        z-index: 1049;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --gutter: clamp(1rem, 4vw, 1.5rem);
        --section-y: clamp(3rem, 8vw, 5rem);
    }

    .grid-bg {
        opacity: 0.12;
        background-size: 48px 48px;
    }

    .hero-home {
        min-height: auto;
        padding-top: calc(var(--header) + env(safe-area-inset-top, 0) + 1.25rem);
        padding-bottom: clamp(2rem, 6vw, 3rem);
    }
    .hero-home h1 {
        font-size: clamp(2.25rem, 10vw, 3.25rem);
    }
    .hero-home-lead {
        font-size: 1rem;
    }
    .hero-home-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-home-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .boarding-pass {
        font-size: 0.65rem;
        gap: 0.35rem 0.75rem;
        padding: 0.55rem 0.85rem;
    }
    .hero-home-aside {
        padding: 1rem;
    }

    .product-grid,
    .product-grid--featured {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .category-tile {
        min-height: 280px;
    }

    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .shop-search {
        max-width: none;
        width: 100%;
    }
    .filter-mobile-toggle {
        min-height: 48px;
    }

    .cart-modal {
        padding: 0;
        align-items: flex-end;
    }
    .cart-panel {
        width: 100%;
        max-width: 100%;
        max-height: min(94vh, 100%);
        border-radius: var(--radius) var(--radius) 0 0;
        transform: translateY(100%);
    }
    .cart-modal.is-open .cart-panel {
        transform: none;
    }
    .cart-body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .cart-summary {
        border-left: none;
        border-top: 1px solid var(--line);
    }
    .cart-header {
        padding: 1.15rem 1.25rem;
    }
    .cart-items {
        padding: 1rem 1.25rem;
    }
    .cart-item {
        grid-template-columns: 56px 1fr;
        grid-template-rows: auto auto;
    }
    .cart-item-media img {
        width: 56px;
        height: 70px;
    }
    .cart-item-price {
        grid-column: 2;
        text-align: left;
        padding-top: 0;
    }

    .product-layout {
        gap: 1.5rem;
    }
    .product-gallery-thumbs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 0.25rem;
    }
    .product-thumb {
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    .product-actions {
        flex-direction: column;
    }
    .product-actions .btn-primary {
        min-width: 0;
        width: 100%;
    }

    .page-hero {
        padding-top: calc(var(--header) + env(safe-area-inset-top, 0) + 1.5rem);
    }
    .page-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-form {
        padding: 1.25rem;
    }
    .gallery-mosaic {
        grid-auto-rows: 140px;
    }
    .compare {
        height: min(360px, 70vw);
    }

    .modal {
        margin: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
        max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .marquee-bar {
        padding: 0.6rem 0;
    }
    .marquee-track {
        font-size: 0.62rem;
    }

    .checkout-pix-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .checkout-pix-content {
        align-items: center;
        width: 100%;
    }
    .checkout-pix-copy {
        flex-direction: column;
    }
    .checkout-pix-copy input {
        font-size: 0.65rem;
    }
    .checkout-pix-generate {
        width: 100%;
        justify-content: center;
    }
}

/* Home header mobile */
@media (max-width: 768px) {
    body[data-page="home"] {
        --logo-display-h: clamp(88px, 22vw, 118px);
        --header-home: calc(var(--logo-display-h) + 2rem);
    }
    .header--home .brand {
        margin-bottom: 0;
    }
    .header--home .brand-logo {
        max-width: min(420px, 92vw);
    }
    .header--home .menu-btn {
        display: flex;
    }
    .header--home .nav--home {
        display: none;
        transform: none !important;
        width: auto;
        height: auto;
        border-left: none;
        right: auto;
        left: 0;
        padding: 0.75rem 1rem 1rem;
    }
    .header--home .nav--home.is-open {
        display: block;
        position: fixed;
        top: var(--header-home);
        left: 0;
        right: 0;
        transform: none !important;
        width: 100%;
        height: auto;
        border-left: none;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        z-index: 999;
    }
    .header--home .nav--home.is-open .nav-list--home {
        flex-direction: column;
        gap: 0;
    }
    .header--home .nav--home.is-open .nav-link--home {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--line);
        font-size: 1.05rem;
    }
    .header--home .nav--home.is-open .nav-list--home li:last-child .nav-link--home {
        border-bottom: none;
    }
    .header-actions--home {
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
    }

    .video-banner {
        padding: 0.75rem 0 1rem;
    }
    .video-banner-frame {
        max-height: min(56vh, 420px);
        border-radius: var(--radius-sm);
    }
    .video-banner-overlay {
        padding: 1.25rem;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 80%);
        justify-content: flex-end;
        text-align: center;
    }
    .video-banner-copy {
        max-width: 100%;
    }
    .video-banner-title {
        font-size: clamp(1.45rem, 6vw, 1.85rem);
    }
    .video-banner-text {
        font-size: 0.82rem;
        margin-bottom: 1rem;
    }
    .btn-video-cta {
        width: 100%;
        max-width: none;
        padding: 0.8rem 1.25rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 380px) {
    :root {
        --header: 76px;
        --logo-h: 52px;
    }
    body[data-page="home"] {
        --logo-display-h: 80px;
        --header-home: calc(var(--logo-display-h) + 1.85rem);
    }
    .header--home .brand {
        margin-bottom: 0;
    }
    .brand-logo {
        max-width: min(240px, 88vw);
    }
    .hero-home h1 {
        font-size: 2rem;
    }
    .section-title {
        font-size: 1.75rem;
    }
}

/* Desktop amplo */
@media (min-width: 1200px) {
    :root {
        --gutter: clamp(2rem, 4vw, 3rem);
        --max: 1400px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    .product-grid--featured {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    .hero-home-wrap {
        gap: 3.5rem;
    }
    .shop-layout {
        gap: 3.5rem;
    }
}

@media (min-width: 1600px) {
    :root {
        --max: 1520px;
    }
}

/* Pointer fino (mouse) — hovers mais evidentes */
@media (hover: hover) and (pointer: fine) {
    .nav-link,
    .filter-chip,
    .footer-links a {
        transition: color 0.2s ease;
    }
    .product-card {
        will-change: transform;
    }
}
