/* ==========================================================================
   ACHEI E POSTEI - style.css (Base + Design System)
   Mobile-first, réplica fiel do layout de referência (app-like storefront)
   ========================================================================== */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* ===== VARIÁVEIS DE DESIGN SYSTEM ===== */
:root {
    /* Cores de marca */
    --brand-blue: #2947E0;
    --brand-blue-dark: #1B32AD;
    --brand-orange: #FF7A1A;
    --brand-orange-dark: #E8650A;

    /* Cores de texto */
    --text-primary: #17182B;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Cores de fundo */
    --bg-page: #FFFFFF;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-icon-box: #F4F5F8;

    /* Bordas */
    --border-color: #ECEDF1;
    --border-color-light: #F0F0F0;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.05), 0 1px 2px rgba(17, 24, 39, 0.03);
    --shadow-md: 0 4px 14px rgba(17, 24, 39, 0.08), 0 2px 4px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 10px 28px rgba(17, 24, 39, 0.10);
    --shadow-nav: 0 -2px 12px rgba(17, 24, 39, 0.06);

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transições */
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TIPOGRAFIA ===== */
h1 {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

h2, .section-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.1px;
    color: var(--text-primary);
}

h3, .product-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

/* ===== HEADER (hambúrguer / logo / notificações) ===== */
.header {
    background: #FFFFFF;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-icon-box);
}

.icon-btn:active {
    transform: scale(0.94);
}

.notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--brand-orange);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.logo {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ===== BUSCA (compartilhado entre páginas) ===== */
.search-section {
    padding: 4px 16px 18px;
    background: #FFFFFF;
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-fast);
    background: #fff;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(41, 71, 224, 0.10);
}

.search-button {
    width: 52px;
    height: 52px;
    background: var(--brand-orange);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 122, 26, 0.30);
}

.search-button:hover {
    background: var(--brand-orange-dark);
    transform: translateY(-1px);
}

.search-button:active {
    transform: scale(0.96);
}

/* ===== SEÇÕES ===== */
.section {
    padding: 20px 16px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.see-all-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-orange);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.see-all-link:hover {
    color: var(--brand-orange-dark);
    gap: 4px;
}

/* ===== BANNER HERO ===== */
.hero-banner {
    max-width: 480px;
    margin: 4px auto 0;
    padding: 0 16px;
}

.hero-banner-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #3357EC 55%, var(--brand-blue-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 26px 18px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(41, 71, 224, 0.28);
}

.hero-text h1 {
    color: #fff;
    max-width: 210px;
}

.hero-text .accent {
    color: var(--brand-orange);
}

.hero-illustration {
    flex-shrink: 0;
    width: 42%;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-illustration svg {
    width: 100%;
    height: auto;
}

/* ===== CATEGORIAS (linha de ícones) ===== */
.categories-row {
    max-width: 480px;
    margin: 0 auto;
    padding: 22px 12px 6px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 2px;
}

.category-icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--bg-icon-box);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-blue);
    transition: var(--transition-base);
}

.category-item:hover .category-icon-box {
    transform: translateY(-3px);
    background: #ECEFFB;
}

.category-item:nth-child(1) .category-icon-box,
.category-item:nth-child(3) .category-icon-box {
    color: var(--brand-orange);
}

.category-icon-box svg {
    width: 26px;
    height: 26px;
}

.category-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

/* ===== CARD DE PRODUTO ===== */
.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color-light);
    transition: var(--transition-base);
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.45s var(--ease-out) forwards;
    position: relative;
    display: flex;
    flex-direction: column;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(n + 7) { animation-delay: 0.3s; }

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--brand-orange);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: var(--radius-full);
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.product-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 0.85;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--ease-out);
}

.product-card:hover .product-image {
    transform: scale(1.04);
}

.product-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    display: none;
}

.product-title {
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0 0 10px;
}

.price-current {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-old {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-old:empty {
    display: none;
}

/* ===== BOTÃO "IR PARA A LOJA" ===== */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-base);
    line-height: 1.3;
    color: inherit;
    margin-top: auto;
}

.cta-button.primary {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(41, 71, 224, 0.28);
}

.cta-button.primary:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(41, 71, 224, 0.36);
}

.cta-button.primary:active {
    transform: translateY(0) scale(0.98);
}

/* ===== NAVEGAÇÃO INFERIOR (bottom nav fixo) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-nav);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    flex: 1;
    padding: 4px 2px;
    transition: var(--transition-fast);
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item.active {
    color: var(--brand-orange);
}

.nav-item:not(.active):hover {
    color: var(--text-secondary);
}

/* ===== TRUST SECTION ===== */
.trust-section {
    text-align: center;
    padding: 4px 16px 8px;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--brand-blue);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
    box-shadow: 0 3px 10px rgba(41, 71, 224, 0.25);
}

.trust-stars {
    display: flex;
    gap: 1px;
}

.trust-stars::before {
    content: "★★★★★";
    font-size: 0.8rem;
    color: var(--brand-orange);
}

.trust-rating {
    font-weight: 700;
    color: #fff;
}

.trust-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 20px 16px 28px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color-light);
}

.footer-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.footer-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ===== ÍCONES SVG ===== */
.icon-svg {
    flex-shrink: 0;
}

/* ===== ESTADO VAZIO ===== */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state .empty-icon {
    margin: 0 auto 12px;
    opacity: 0.35;
}

.empty-state p {
    font-size: 0.9rem;
    font-weight: 400;
}

/* ===== RESPONSIVO ===== */
@media (min-width: 600px) {
    .header-content,
    .search-container,
    .section,
    .hero-banner,
    .categories-row {
        max-width: 560px;
    }
}

@media (max-width: 380px) {
    .section {
        padding: 16px 12px;
    }

    h1 {
        font-size: 1.45rem;
    }

    .category-icon-box {
        width: 48px;
        height: 48px;
    }

    .category-label {
        font-size: 0.62rem;
    }
}
