/* Variáveis Responsivas */
:root {
    --h1-size-mobile: clamp(2rem, 5vw, 2.5rem);
    --h1-size-desktop: clamp(2.5rem, 5vw, 3.5rem);
    --body-size-mobile: clamp(0.875rem, 2vw, 1rem);
    --body-size-desktop: clamp(1rem, 2vw, 1.125rem);
    
    --spacing-xs: clamp(0.5rem, 1vw, 0.75rem);
    --spacing-sm: clamp(0.75rem, 1.5vw, 1rem);
    --spacing-md: clamp(1rem, 2vw, 1.5rem);
    --spacing-lg: clamp(1.5rem, 3vw, 2rem);
    --spacing-xl: clamp(2rem, 4vw, 3rem);
}

/* Container Base */
.container {
    width: min(100% - 2rem, 1280px);
    margin-inline: auto;
    padding-inline: var(--spacing-sm);
}

/* Imagens Responsivas */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* Mobile First - Base Styles */
body {
    font-size: var(--body-size-mobile);
    line-height: 1.6;
}

h1 {
    font-size: var(--h1-size-mobile);
    line-height: 1.2;
}

/* Tablet (640px) */
@media (min-width: 640px) {
    body {
        font-size: var(--body-size-desktop);
    }

    h1 {
        font-size: var(--h1-size-desktop);
    }

    .hero-content {
        text-align: left;
    }

    .countdown {
        justify-content: flex-start;
    }
}

/* Desktop (768px) */
@media (min-width: 768px) {
    .hero-bg {
        min-height: 100vh;
    }

    .hero-content {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-xl);
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    button, 
    .nav-link,
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        padding: 0.75rem;
    }

    .hero-image {
        width: min(100%, 500px);
        margin-inline: auto;
    }

    #mobile-menu {
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform: translateY(-100%);
        opacity: 0;
    }

    #mobile-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Small Mobile Optimizations */
@media (max-width: 480px) {
    .container {
        padding-inline: var(--spacing-xs);
    }

    .hero-content {
        padding-block: var(--spacing-lg);
    }

    .product-card {
        padding: var(--spacing-sm);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #ffffff;
        --card-bg: #1e1e1e;
        --border-color: #333333;
    }

    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    .card,
    .product-card {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* Menu Mobile Otimizado */
#mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--secondary-dark);
    transition: all 0.3s ease;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 40;
    padding: 0.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

#mobile-menu a {
    padding: 1rem var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

#mobile-menu a::after {
    content: '';
    position: absolute;
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    bottom: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

#mobile-menu a:last-child::after {
    display: none;
}

#mobile-menu a:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Ajustes específicos para diferentes tamanhos de tela */
@media (max-width: 480px) {
    #mobile-menu {
        top: 56px;
        max-height: calc(100vh - 56px);
    }
}

@media (min-width: 768px) {
    #mobile-menu {
        display: none;
    }
}

/* Ajuste para dispositivos iOS */
@supports (-webkit-touch-callout: none) {
    #mobile-menu {
        max-height: -webkit-fill-available;
    }
}

/* Home Section Responsivo */
.hero-bg {
    min-height: 100svh;
    position: relative;
    padding-top: max(4rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.hero-content {
    gap: var(--spacing-lg);
    padding: var(--spacing-xl) 0;
}

/* WhatsApp Button Otimizado */
.whatsapp-btn {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.whatsapp-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25D366;
    animation: pulse 2s infinite;
    z-index: -1;
}

.whatsapp-btn:active {
    transform: scale(0.95);
}

.whatsapp-btn i {
    position: relative;
    z-index: 1;
    color: white;
}

/* Ajustes específicos para diferentes tamanhos de tela */
@media (max-width: 480px) {
    .whatsapp-btn {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .whatsapp-btn.hidden-mobile {
        transform: translateY(100px);
        opacity: 0;
        visibility: hidden;
    }
}

/* Ajuste para telas muito pequenas */
@media (max-width: 320px) {
    .whatsapp-btn {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
        right: 0.5rem;
        bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Ajuste para dispositivos com notch */
@supports (padding: max(0px)) {
    .whatsapp-btn {
        padding: env(safe-area-inset-top) env(safe-area-inset-right)
                env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

/* Ajuste para quando o CTA flutuante estiver visível */
@media (max-width: 768px) {
    .whatsapp-btn.with-cta {
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Animação de pulse otimizada */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Ajuste para dispositivos com tela de toque */
@media (hover: none) {
    .whatsapp-btn:active {
        background-color: #1da851;
    }
}

/* Ajuste para dispositivos que suportam hover */
@media (hover: hover) {
    .whatsapp-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
        background-color: #1da851;
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-btn {
        transition: none;
    }

    .whatsapp-btn::before {
        animation: none;
    }
}

/* Modo de alto contraste */
@media (prefers-contrast: more) {
    .whatsapp-btn {
        border: 2px solid white;
        box-shadow: none;
    }
}

/* Responsividade Específica */
@media (max-width: 640px) {
    .hero-content {
        text-align: center;
        padding: var(--spacing-md) 0;
    }

    .hero-image {
        width: 90%;
        max-width: 300px;
        margin: 0 auto;
    }

    .countdown {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .countdown-item {
        min-width: 70px;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .btn-hero {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    :root {
        --h1-size-mobile: clamp(1.75rem, 4vw, 2rem);
    }

    .hero-content {
        gap: var(--spacing-md);
    }

    .mobile-logo {
        font-size: 1rem;
    }

    .mobile-logo i {
        font-size: 1.25rem;
    }

    #mobile-menu {
        top: 56px;
    }

    .whatsapp-btn {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

/* Landscape Mode */
@media (max-height: 480px) and (orientation: landscape) {
    .hero-bg {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }

    .hero-content {
        flex-direction: row !important;
        align-items: center;
        gap: var(--spacing-lg);
    }

    .hero-image {
        max-width: 250px;
    }

    #mobile-menu {
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Tablets */
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-content {
        gap: var(--spacing-xl);
    }

    .hero-image {
        max-width: 400px;
    }

    .countdown {
        gap: 1rem;
    }

    .countdown-item {
        min-width: 80px;
    }
}

/* Safe Area Support */
@supports (padding: max(0px)) {
    .hero-bg,
    .whatsapp-btn,
    #mobile-menu {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    .hero-bg::before {
        opacity: 0.8;
    }

    .whatsapp-btn {
        border: 2px solid white;
    }

    #mobile-menu {
        background-color: rgba(44, 62, 80, 0.98);
        backdrop-filter: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-btn::before {
        animation: none;
    }

    #mobile-menu,
    .hero-image,
    .countdown-item {
        transition: none;
    }
} 