/* Tablet (max 991px) */
@media (max-width: 991px) {
    .carousel-slide {
        min-width: 33.333%;
        flex: 0 0 33.333%;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    .newsletter-section h2 {
        font-size: 2.2rem;
    }
}

/* Mobile grande (max 767px) */
@media (max-width: 767px) {
    .carousel-slide {
        min-width: 50%;
        flex: 0 0 50%;
    }

    .hero-section {
        height: 55vh;
        min-height: 380px;
        max-height: 520px;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-overlay {
        padding: 30px 15px;
    }

    .btn-primary-custom,
    .btn-outline-custom {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .btn-outline-custom {
        margin-left: 0;
        margin-top: 10px;
    }

    .products-section {
        padding: 50px 0;
    }

    .categories-section {
        padding: 50px 0;
    }

    .features-section {
        padding: 40px 0;
    }

    .newsletter-section {
        padding: 50px 0;
    }

    .newsletter-section h2 {
        font-size: 1.9rem;
    }

    .newsletter-form {
        flex-direction: column;
        padding: 0 15px;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }

    .section-header h2 {
        font-size: 1.9rem;
    }

    .section-header {
        margin-bottom: 30px;
    }

    .header-actions {
        gap: 15px;
    }

    .header-actions a {
        font-size: 1.15rem;
    }

    .logo img {
        max-height: 48px;
    }

    .cart-offcanvas {
        max-width: 100%;
        right: -100%;
    }

    .main-footer {
        padding: 50px 0 25px;
    }

    .footer-bottom {
        margin-top: 40px;
    }

    .category-card {
        aspect-ratio: 4 / 5;
    }

    .carousel-container {
        padding: 0 40px;
    }

    .carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

/* Mobile pequeno (max 575px) */
@media (max-width: 575px) {
    .carousel-slide {
        min-width: 100%;
        flex: 0 0 100%;
    }

    .hero-section {
        height: 50vh;
        min-height: 350px;
        max-height: 480px;
    }

    .hero-content h1 {
        font-size: 1.6rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .hero-overlay {
        padding: 25px 15px;
    }

    .btn-primary-custom,
    .btn-outline-custom {
        width: 100%;
        text-align: center;
    }

    .top-bar {
        font-size: 0.75rem;
        text-align: center;
    }

    .top-bar .row > div {
        width: 100%;
    }

    .product-info {
        padding: 18px;
    }

    .product-title {
        font-size: 1rem;
    }

    .price-current {
        font-size: 1.15rem;
    }

    .feature-box {
        padding: 20px 10px;
    }

    .feature-box h3 {
        font-size: 1rem;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .cart-header h3 {
        font-size: 1.25rem;
    }

    .cart-total span:last-child {
        font-size: 1.2rem;
    }

    .btn-checkout {
        font-size: 1rem;
        padding: 12px;
    }

    .section-header h2 {
        font-size: 1.7rem;
    }

    .newsletter-section h2 {
        font-size: 1.7rem;
    }

    .toast-notification {
        white-space: normal;
        padding: 12px 20px;
        font-size: 0.9rem;
        bottom: 15px;
    }

    .carousel-container {
        padding: 0 35px;
    }

    .category-card {
        aspect-ratio: 1 / 1;
    }

    .category-overlay {
        padding: 25px 20px;
    }

    .category-overlay h3 {
        font-size: 1.4rem;
    }

    .main-nav .nav-link {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
}

/* Ajuste para telas muito pequenas (max 400px) */
@media (max-width: 400px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

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

    .header-actions a {
        font-size: 1rem;
    }

    .badge-count {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
        top: -6px;
        right: -6px;
    }

    .product-image {
        aspect-ratio: 4 / 5;
    }
}

/* ==========================================================
   Página de Produto — Mobile
   ========================================================== */
@media (max-width: 767px) {
    #product-name {
        font-size: 1.8rem !important;
    }
    #product-price {
        font-size: 1.5rem !important;
    }

    .product-detail-section {
        padding-top: 24px;
    }

    /* Botões "Adicionar ao Carrinho" / "Adicionar aos Favoritos" — diminuir bastante.
       Usa grid para garantir mesma altura/largura nas duas colunas. */
    .product-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .product-buttons .btn-primary-solid,
    .product-buttons .btn-outline-custom {
        padding: 13px 12px;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        line-height: 1.3;
        text-align: center;
        width: 100%;
        height: 100%;
    }

    /* Galeria — thumbs menores */
    .gallery-thumb {
        flex: 0 0 64px;
        width: 64px;
        height: 80px;
    }

    /* Product features icons */
    .product-features {
        margin-top: 24px;
        padding-top: 20px;
    }
    .feature-title {
        font-size: 0.88rem;
    }
    .feature-desc {
        font-size: 0.78rem;
    }
}

@media (max-width: 575px) {
    #product-name {
        font-size: 1.5rem !important;
    }
    #product-price {
        font-size: 1.3rem !important;
    }

    /* Botões — ainda menores, mas mantém lado a lado (grid 2 colunas iguais) */
    .product-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .product-buttons .btn-primary-solid,
    .product-buttons .btn-outline-custom {
        padding: 12px 8px;
        font-size: 0.72rem;
        letter-spacing: 0.3px;
        line-height: 1.3;
        text-align: center;
        width: 100%;
        height: 100%;
    }
    .product-buttons .btn-primary-solid i,
    .product-buttons .btn-outline-custom i {
        margin-right: 0.35rem !important;
    }

    /* Thumbs ainda menores */
    .gallery-thumb {
        flex: 0 0 56px;
        width: 56px;
        height: 70px;
    }

    /* Color/size options menos espaçados */
    .color-option {
        width: 32px;
        height: 32px;
    }
    .size-option {
        min-width: 44px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Product options dividers — menos margem */
    .product-options {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }
}

/* Telas pequenas: botões viram uma coluna */
@media (max-width: 380px) {
    .product-buttons {
        grid-template-columns: 1fr !important;
    }
    .product-buttons .btn-primary-solid,
    .product-buttons .btn-outline-custom {
        padding: 12px 16px !important;
        font-size: 0.78rem !important;
    }
}

/* ==========================================================
   Newsletter — mobile (era grid 1fr 1fr)
   ========================================================== */
@media (max-width: 767px) {
    .newsletter-section .container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-left: 20px;
        padding-right: 20px;
    }
    .newsletter-section h2 {
        text-align: left;
    }
    .newsletter-section p {
        text-align: left;
        max-width: 100%;
    }
}

/* ==========================================================
   Top-bar / Header — telas pequenas
   ========================================================== */
@media (max-width: 575px) {
    .top-bar {
        padding: 6px 0;
        font-size: 0.7rem;
    }
    .top-bar .me-3 {
        margin-right: 0.5rem !important;
    }

    .header-actions {
        gap: 12px;
    }
}

/* ==========================================================
   Features Section (home) — ajustes mobile
   ========================================================== */
@media (max-width: 575px) {
    .feature-box {
        padding: 22px 8px;
        gap: 6px;
    }
    .feature-box h3 {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
    .feature-box p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    .feature-icon {
        font-size: 1.7rem;
        margin-bottom: 2px;
    }
}

@media (max-width: 400px) {
    .feature-box {
        padding: 18px 6px;
    }
    .feature-box p {
        display: none;
    }
}

/* ==========================================================
   Página de Usuário (Perfil)
   ========================================================== */
@media (max-width: 767px) {
    .profile-card {
        padding: 26px 20px;
    }
    .profile-section {
        padding-top: 24px;
    }
    #profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    #profile-name {
        font-size: 1.3rem;
    }
    .profile-tab {
        padding: 10px 14px;
        font-size: 0.82rem;
    }
}

@media (max-width: 575px) {
    .profile-card {
        padding: 20px 14px;
    }
    .logout-section {
        margin-top: 26px;
        padding-top: 22px;
    }
}

/* ==========================================================
   Categoria — filtros topbar
   ========================================================== */
@media (max-width: 575px) {
    .filter-page {
        padding: 18px 0 50px;
    }
    .page-header {
        padding: 28px 0 20px;
    }
    .filter-page-topbar {
        gap: 10px;
        margin-bottom: 18px;
    }
    .filter-open-btn {
        padding: 9px 16px;
        font-size: 0.72rem;
        letter-spacing: 1.5px;
    }
    .filter-sort label {
        display: none;
    }
    .filter-sort select {
        padding: 7px 10px;
        font-size: 0.82rem;
    }
    .filter-results-count {
        font-size: 0.72rem;
        letter-spacing: 1.5px;
    }
}

/* ==========================================================
   Favoritos / Section header em mobile
   ========================================================== */
@media (max-width: 575px) {
    .section-header {
        margin-bottom: 22px;
        padding-bottom: 16px;
        gap: 12px;
    }
    .section-link {
        font-size: 0.68rem;
        letter-spacing: 1.5px;
    }
    .section-header-side {
        font-size: 0.68rem;
        letter-spacing: 1.5px;
    }
    .section-number {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }
    .products-section {
        padding: 36px 0;
    }
}
