/* ================================================
   MEDIA QUERIES RESPONSIVAS - ORGANIZADAS
   ================================================

   Breakpoints:
   - Desktop: > 968px (padrão - estilos base)
   - Tablet: 481px - 968px
   - Mobile: ≤ 480px
================================================ */

/* ================================================
   TABLET (481px - 968px)
   ================================================ */
@media (min-width: 481px) and (max-width: 968px) {
    /* Fix overflow */
    html, body {
        overflow-x: hidden !important;
    }

    /* Header e Navegação */
    .navbar {
        padding: 0 1.5rem;
        max-width: none !important;
        margin: 0 !important;
    }

    .logo img {
        width: 100px;
        max-height: 80px;
    }

    /* Menu Mobile Toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        left: -100%;
        right: auto;
        width: 280px;
        height: auto;
        max-height: 100vh;
        background: linear-gradient(180deg, #E91E8C 0%, #D991BA 100%);
        padding: 4rem 1.5rem 1.5rem;
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
        z-index: 999;
        border-radius: 0 0 20px 0;
    }

    nav.active {
        left: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    nav ul li {
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 0.9rem 0;
        text-align: left;
        font-size: 1rem;
    }

    /* Overlay quando menu está aberto */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Container */
    .container {
        padding: 3rem 1.5rem;
    }

    /* Hero Section */
    .hero {
        padding: 5rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-promotions {
        height: 450px;
    }

    .promotion-slide h1 {
        font-size: 2.8rem;
    }

    .promotion-slide p {
        font-size: 1.1rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 2.2rem;
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .product-card {
        max-width: 100%;
    }

    .product-image {
        height: 250px;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    /* Newsletter */
    .newsletter-section {
        padding: 3rem 1.5rem;
    }

    .newsletter-text h2 {
        font-size: 2rem;
    }

    .newsletter-input-group {
        max-width: 500px;
    }

    /* Products Horizontal */
    .products-horizontal {
        gap: 1.2rem;
    }

    .products-horizontal .product-card {
        min-width: 280px;
        max-width: 280px;
    }

    /* Buttons */
    .btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    /* Contact Form */
    .contact-form {
        padding: 1.8rem;
    }

    /* Footer */
    footer {
        padding: 2rem 1.5rem;
    }

    .footer-links {
        gap: 1.5rem;
    }
}

/* ================================================
   MOBILE (≤ 480px)
   ================================================ */
@media (max-width: 480px) {
    /* Fix overflow horizontal */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Header Mobile - full width */
    header {
        position: sticky;
        top: 0;
        left: 0;
        padding: 0.5rem 0;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        background: linear-gradient(135deg, #E91E8C 0%, #D991BA 100%) !important;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    html.dark-mode header {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
    }

    .navbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.8rem !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 0;
        margin-right: auto;
    }

    .logo {
        order: 1;
        z-index: 1001;
    }

    .logo img {
        width: 80px;
        max-height: 65px;
    }

    .header-icons {
        order: 2;
        gap: 0.6rem;
        margin-left: auto;
    }

    .user-icon,
    .cart-icon {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .user-name {
        display: none;
    }

    .cart-badge {
        width: 16px;
        height: 16px;
        font-size: 0.7rem;
        top: -4px;
        right: -6px;
    }

    /* User Menu Dropdown - Mobile Compacto */
    .user-menu-dropdown {
        min-width: 150px;
        top: calc(100% + 3px);
        border-radius: 6px;
    }

    .user-menu-item {
        padding: 0.45rem 0.6rem;
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .user-menu-icon {
        font-size: 0.85rem;
        width: 16px;
    }

    /* Menu Mobile - COMPACTO - ABRE DA ESQUERDA */
    nav {
        order: 4;
        position: fixed;
        top: 0;
        left: -100%;
        right: auto;
        width: 70%;
        max-width: 280px;
        height: auto;
        max-height: 100vh;
        background: linear-gradient(180deg, #E91E8C 0%, #D991BA 100%);
        padding: 4rem 1.2rem 1.5rem;
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
        z-index: 999;
        border-radius: 0 0 20px 0;
    }

    nav.active {
        left: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    nav ul li {
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 0.8rem 0;
        text-align: left;
        font-size: 0.95rem;
    }

    /* Overlay quando menu está aberto */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-promotions {
        height: 300px;
    }

    .promotion-slide h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .promotion-slide p {
        font-size: 0.85rem;
    }

    .promotion-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.8rem;
    }

    .slider-controls {
        padding: 0 0.5rem;
    }

    .slider-btn {
        font-size: 1.2rem;
        padding: 0.5rem 0.8rem;
    }

    .slider-dots {
        bottom: 0.8rem;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    /* Container Mobile */
    .container {
        padding: 2rem 1rem;
    }

    /* Section Titles Mobile */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .section-title::after {
        width: 60px;
        height: 3px;
    }

    /* Products Grid Mobile - 2 COLUNAS */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .product-card {
        max-width: 100%;
        border-radius: 10px;
    }

    .product-image {
        height: 160px;
    }

    .product-info {
        padding: 0.6rem;
    }

    .product-info h3 {
        font-size: 0.85rem;
        line-height: 1.2;
        margin-bottom: 0.3rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .product-footer span {
        font-size: 0.7rem !important;
    }

    /* Categories Mobile */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-card {
        padding: 1.2rem;
    }

    .category-card h3 {
        font-size: 1.2rem;
    }

    /* Newsletter Mobile - SUPER COMPACTO */
    .newsletter-section {
        padding: 1rem;
        margin: 1rem 0 0 0;
    }

    .newsletter-content {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .newsletter-text h2 {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .newsletter-text p {
        display: none; /* Esconder descrição no mobile */
    }

    .newsletter-form {
        margin: 0;
    }

    .newsletter-input-group {
        flex-direction: row;
        gap: 0.5rem;
        margin-bottom: 0;
    }

    .newsletter-input-group input {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 20px;
        flex: 1;
        min-width: 0;
    }

    .btn-newsletter {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
        border-radius: 20px;
    }

    .newsletter-privacy {
        display: none; /* Esconder nota de privacidade no mobile */
    }

    #newsletterAlert {
        margin: 0.5rem 0 0 0;
    }

    /* Products Grid Mobile - Novidades em grelha 2 colunas */
    .products-horizontal {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0.5rem 1rem;
        overflow-x: visible;
    }

    .products-horizontal .product-card {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    .products-horizontal .product-card .product-image {
        height: 160px;
    }

    /* Contact Form Mobile */
    .contact-form {
        padding: 1.2rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    /* Buttons Mobile */
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .btn-add-to-cart {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .btn-submit {
        font-size: 1rem;
        padding: 0.9rem;
    }

    /* Footer Mobile - COMPACTO */
    footer {
        padding: 1rem 1rem 0.8rem;
        margin-top: 2rem;
    }

    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
        margin-bottom: 0.8rem;
    }

    .footer-links a {
        font-size: 0.75rem;
    }

    .footer-social {
        gap: 0.8rem;
        margin: 0.6rem 0;
    }

    .footer-social .social-icon {
        width: 32px;
        height: 32px;
    }

    .footer-social .social-icon svg {
        width: 16px;
        height: 16px;
    }

    .footer-bottom {
        padding-top: 0.6rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .footer-bottom p {
        font-size: 0.7rem;
        margin: 0.2rem 0;
    }

    .footer-bottom p:last-child {
        display: none; /* Esconde "Feito com 🩷" no mobile */
    }

    /* Alerts e Mensagens */
    .alert {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Página de Produto Mobile */
    .produto-main {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .imagem-principal {
        height: 300px !important;
    }

    .miniaturas {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .miniatura {
        height: 70px !important;
    }

    .produto-info h1 {
        font-size: 1.5rem !important;
    }

    .produto-preco {
        font-size: 1.8rem !important;
    }

    .quantidade-selector {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .entrega-urgente-container {
        padding: 0.8rem !important;
    }

    .entrega-urgente-checkbox {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .entrega-urgente-preco {
        align-self: flex-start !important;
        margin-top: 0.5rem !important;
    }

    .produto-tabs {
        margin-top: 2rem !important;
    }

    .tabs-header {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tab-button {
        white-space: nowrap !important;
        padding: 0.7rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .personalizacao-produto {
        padding: 1rem !important;
    }


    /* Hero mais compacto */
    .hero-promotions {
        height: 250px;
        border-radius: 0;
        margin: 0;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }

    /* Garantir que nenhum elemento cause overflow */
    .featured-products,
    .categories,
    .newsletter-section {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Permitir scroll horizontal nos filtros de produtos */
    .products-section .container {
        max-width: 100vw;
    }

    .products-section .filters-wrapper {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        margin-left: -0.8rem;
        margin-right: -0.8rem;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .promotion-content {
        padding: 1rem;
    }

    .promotion-slide .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Badges nos produtos */
    .badge-overlay {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Section titles mais compactos */
    .featured-products .section-title,
    .categories .section-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    /* Avaliações mobile */
    .avaliacoes-resumo {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .media-numero {
        font-size: 2.5rem;
    }

    .avaliacao-item {
        padding: 1rem;
    }

    .avaliacoes-formulario {
        padding: 1rem;
    }

    .rating-selector {
        font-size: 1.8rem;
    }

    /* Carrinho flutuante (opcional) */
    .cart-icon {
        position: relative;
    }

    .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    /* Touch targets mínimos 44px */
    .btn,
    button,
    a.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Scroll suave */
    html {
        scroll-behavior: smooth;
    }

    /* Container sections mais compactos */
    .featured-products,
    .categories {
        padding: 1.5rem 0;
    }

    .featured-products .container,
    .categories .container {
        padding: 0 1rem;
    }
}

/* ================================================
   DESKTOP GRANDE (> 1400px) - OPCIONAL
   ================================================ */
@media (min-width: 1400px) {
    .navbar {
        max-width: 1600px;
    }

    .container {
        max-width: 1600px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .promotion-slide h1 {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }
}
