/* Reset e base */
:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --bg: #f7f7fa;
    --card-bg: #fff;
    --text: #222;
    --muted: #888;
    --footer-bg: #232136;
    --footer-text: #fff;
    --shadow: 0 4px 24px 0 rgba(0,0,0,0.08);
    --radius: 18px;
    --transition: 0.2s cubic-bezier(.4,0,.2,1);
    --brand-size: 2rem;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.main-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 8px;
    display: block;
    box-shadow: none;
}
.brand {
    font-size: var(--brand-size);
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 1px;
}
.main-nav {
    display: flex;
    gap: 2rem;
}
.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color var(--transition);
}
.nav-link.active, .nav-link:hover {
    color: var(--primary);
}

/* Filtros melhorados */
.filters-section {
    max-width: 1200px;
    margin: 2rem auto 1.5rem auto;
    padding: 0 1rem;
}

.filters-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-input, .category-filter {
    padding: 0.8rem 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    font-size: 1.1rem;
    background: #fff;
    min-width: 180px;
    outline: none;
    transition: border var(--transition);
}

.search-input:focus, .category-filter:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.results-info {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

/* Grid de produtos */
.products-section {
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 2.2rem;
    width: 100%;
}
.products-grid:only-child, .products-grid:has(.product-card:only-child) {
    justify-items: center;
    justify-content: center;
}
.products-grid .product-card:only-child {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Card de produto */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.4s ease-out;
    min-width: 250px !important;
    min-height: 350px !important;
    width: 100%;
    height: auto;
}

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

.product-card:hover {
    transform: translateY(-6px) scale(1.025);
    box-shadow: 0 8px 32px 0 rgba(59,130,246,0.10);
}
.product-image-wrap {
    width: 100%;
    aspect-ratio: 4/3 !important;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    min-height: 200px !important;
    max-height: 250px;
    flex-shrink: 0; /* Não permitir que encolha */
}
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-category {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.product-info {
    padding: 1.3rem 1.2rem 1.2rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}
.product-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.97rem;
    color: var(--muted);
}
.product-description {
    font-size: 1.01rem;
    color: #444;
    flex: 1;
}
.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.product-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.shop-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform var(--transition);
}
.shop-link img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.shop-link:hover {
    transform: scale(1.05);
    color: white;
}

/* Estados de loading e erro */
.loading-container {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.error-container {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
    margin: 2rem auto;
    max-width: 500px;
}

.empty-state {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 2rem auto;
    max-width: 500px;
}

/* Footer */
.main-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: auto;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.footer-copy {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.footer-version {
    opacity: 0.6;
    font-size: 0.8rem;
    color: var(--footer-text);
    font-family: 'Courier New', monospace;
}
.footer-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--footer-text);
}
.footer-socials {
    display: flex;
    gap: 1rem;
}
.footer-social img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity var(--transition);
    filter: brightness(0) invert(1);
}
.footer-social img:hover { opacity: 1; filter: none; }

/* Loading placeholder obsoleto */
.loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: 1.2rem;
}

.footer-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity var(--transition);
    filter: brightness(0) invert(1);
}
.footer-logo:hover {
    opacity: 1;
}

/* Responsividade melhorada */
@media (max-width: 900px) {
    .header-inner, .products-section, .footer-inner { max-width: 98vw; padding: 0 1rem; }
    .products-grid { gap: 1.2rem; }
    .filters-container { 
        flex-direction: column; 
        gap: 1rem; 
        align-items: stretch;
    }
    .search-input, .category-filter { 
        min-width: 100%; 
    }
    .results-info {
        margin-left: 0;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .header-inner, .footer-inner { flex-direction: column; gap: 1rem; padding: 1rem 0.5rem; }
    .logo-img { height: 26px; }
    .footer-logo { height: 20px; }
    .footer-left { 
        flex-direction: column; 
        text-align: center; 
        gap: 0.5rem;
    }
    .footer-copy {
        text-align: center;
    }
    .footer-version {
        font-size: 0.7rem;
    }
    .main-nav { gap: 1rem; }
    .products-grid { 
        grid-template-columns: 1fr; /* 1 coluna em mobile como antes */
        gap: 1rem; 
    }
    .filters-section {
        margin: 1rem auto;
    }
    .filters-container {
        padding: 1rem;
    }
}

/* Mobile muito pequeno - força grid correta */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr !important; /* 1 coluna forçada */
        gap: 0.8rem;
    }
    .product-card {
        min-width: 280px !important; /* Largura maior para 1 coluna */
        min-height: 380px !important; /* Altura mínima maior em mobile */
        max-width: none !important;
        width: 100% !important;
    }
    .product-image-wrap {
        min-height: 210px !important;
        max-height: 210px !important;
        aspect-ratio: 4/3 !important; /* Forçar aspect ratio */
        flex-shrink: 0 !important;
    }
    .product-image-placeholder {
        min-height: 210px !important;
        height: 210px !important;
    }
}

/* Badge de tamanho */
.size-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Placeholder de imagem melhorado */
.product-image-placeholder {
    width: 100% !important;
    height: 100% !important;
    min-height: 200px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
}

/* Botão AR estilo Apple clean */
.ar-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 12px;
    text-decoration: none;
    color: #007AFF !important;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    cursor: pointer;
}

/* Botão 3D para dispositivos não-iOS */
.viewer3d-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 12px;
    text-decoration: none;
    color: #28a745 !important; /* Verde para 3D */
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    cursor: pointer;
}

.ar-icon {
    margin-right: 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #007AFF !important;
}

.viewer3d-icon {
    margin-right: 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #28a745 !important;
}

.ar-icon svg, .viewer3d-icon svg {
    color: currentColor !important;
    width: 14px;
    height: 14px;
}

.ar-button:hover, .viewer3d-button:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px) scale(1.02);
    text-decoration: none;
    border-color: rgba(255, 255, 255, 1) !important;
}

.ar-button:hover {
    color: #007AFF !important;
}

.viewer3d-button:hover {
    color: #28a745 !important;
}

.ar-button:active, .viewer3d-button:active {
    transform: translateY(0) scale(1);
}

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

/* Paginação */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem auto;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination-btn {
    background: white;
    border: 1px solid #e0e0e0;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination-prev, .pagination-next {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.pagination-dots {
    color: var(--muted);
    padding: 0 0.25rem;
    font-weight: bold;
}

/* Mobile pagination */
@media (max-width: 600px) {
    .pagination-container {
        gap: 0.25rem;
        margin: 1.5rem auto;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .pagination-prev, .pagination-next {
        padding: 0.4rem 0.8rem;
    }
    
    .pagination-numbers {
        gap: 0.1rem;
    }
} 