/* ========================================================
   SISTEMA DE DESIGN - VITRINE PREMIUM MOBILE
   ======================================================== */

:root {
    /* Paleta de Cores Premium */
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent-color: #ffe600; /* Amarelo Mercado Livre */
    --btn-text: #2d3277;
    --price-color: #059669; /* Verde padrão preço */
    --free-shipping: #059669;
    --discount-bg: #ef4444;
    
    /* Variáveis base */
    --header-height: 70px;
    --border-radius-sm: 10px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* ========================================================
   HEADER & NAVIGATION
   ======================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    padding: var(--header-height) 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .main-content {
        padding-left: 0 !important; /* Zero margem lateral */
        padding-right: 0 !important;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 28px;
}

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

.icon-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* ========================================================
   HERO BANNER
   ======================================================== */

.hero-banner {
    margin-top: var(--header-height); /* Colado no header */
    margin-left: 20px;
    margin-right: 20px;
    background: linear-gradient(135deg, var(--btn-text) 0%, #43499e 100%);
    border-radius: var(--border-radius-lg);
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: var(--shadow-md);
    max-width: 1160px;
}

@media (max-width: 480px) {
    .hero-banner {
        margin-top: 0 !important; /* Remove o espaço extra no topo */
        margin-left: 0;
        margin-right: 0;
        border-radius: 0; /* Banner ocupa toda a largura no mobile */
        padding: 32px 16px;
    }
}

@media (min-width: 1200px) {
    .hero-banner { margin-left: auto; margin-right: auto; }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-banner h1 {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.hero-banner p {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
    max-width: 280px;
}

.hero-pattern {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 1;
}

/* ========================================================
   MAIN CONTENT & PRODUCTS
   ======================================================== */

.products-section {
    padding: 32px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .products-section {
        padding: 16px 0 !important; /* Zero margem lateral na seção */
    }
}

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

.section-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.results-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.08);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.filter-btn:active {
    transform: scale(0.95);
}

.products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100%;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 24px !important;
    }
}

@media (max-width: 480px) {
    .products-grid {
        gap: 1px !important; /* Quase invisível, estilo app premium */
    }
    
    .product-card {
        padding: 8px !important;
        width: 100%;
    }

    .product-title {
        font-size: 12px;
        height: 34px;
        margin-bottom: 8px;
    }

    .current-price {
        font-size: 16px;
    }
    
    .buy-btn {
        padding: 10px 4px;
        font-size: 11px;
    }
}

.product-card {
    background: var(--card-bg);
    border: 1px solid #eeeeee; /* Borda fininha estilo ML */
    border-radius: 4px; /* Cantos levemente arredondados */
    display: flex;
    flex-direction: column;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease backwards;
}

@media (max-width: 480px) {
    .product-card {
        border-radius: 0; /* No mobile fica mais quadrado e limpo */
        border: 0.5px solid #f0f0f0;
        box-shadow: none !important;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.product-card:active {
    transform: scale(0.96);
}

.product-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius-sm);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
}

.product-img-container img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img-container img {
    transform: scale(1.08);
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--discount-bg);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.pricing {
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

.current-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.shipping {
    font-size: 11px;
    color: var(--free-shipping);
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.shipping i {
    font-size: 14px;
}

.buy-btn {
    background: var(--btn-text);
    color: white;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.buy-btn i {
    font-size: 16px;
}

.product-card:hover .buy-btn {
    background: #1e2259;
}

/* ========================================================
   SKELETON LOADER
   ======================================================== */

.skeleton {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    padding: 12px;
    height: 280px;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius-sm);
    background: #e2e8f0;
    animation: pulse 1.5s infinite ease-in-out;
    margin-bottom: 12px;
}

.skeleton-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.skeleton-text {
    height: 12px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-text.short {
    width: 70%;
    margin-bottom: 16px;
}

.skeleton-price {
    height: 24px;
    width: 50%;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: auto;
    margin-bottom: 12px;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-btn {
    height: 36px;
    width: 100%;
    background: #e2e8f0;
    border-radius: 8px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* ========================================================
   TOAST
   ======================================================== */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-hover);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    bottom: 30px;
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
    background-color: var(--text-main);
    color: #94a3b8;
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
    margin-bottom: 0; /* Garante que não tenha nada abaixo */
    font-size: 14px;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    font-size: 13px;
    opacity: 0.8;
}

/* Botão Carregar Mais */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 30px 20px 50px;
}

.load-more-btn {
    background: white;
    border: 2px solid var(--primary);
    color: var(--text-main);
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.load-more-btn:hover {
    background: var(--primary);
    color: var(--btn-text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .load-more-btn {
        width: 100%;
        justify-content: center;
    }
}
