:root {
    --primary-color: #0B192C;
    --accent-orange: #e67e22;
    --accent-purple: #6366f1;
    --neutral-grey: #6b7280;
    --success-green: #22c55e;
    
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-color: #1f2937;
    --text-light: #4b5563;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #050b14;
        --card-bg: rgba(20, 30, 50, 0.6);
        --card-border: rgba(255, 255, 255, 0.1);
        --text-color: #f3f4f6;
        --text-light: #9ca3af;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(230, 126, 34, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Glassmorphism utils */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    position: sticky;
    top: 1rem;
    z-index: 100;
    height: 70px;
    padding: 0 5%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: calc(100% - 2rem);
    margin: 1rem auto 2rem auto;
    border-radius: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -1px;
}
@media (prefers-color-scheme: dark) {
    .logo { color: white; }
}

.logo span {
    color: var(--accent-orange);
}

@media (max-width: 480px) {
    .logo { font-size: 1.3rem; }
    header { gap: 0.5rem; }
}

.search-bar {
    flex: 1;
    min-width: 120px;
    max-width: 300px;
    display: flex;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    font-size: 0.95rem;
    color: var(--text-color);
    outline: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: #9ca3af; /* Cinza discreto */
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Sombra neutra */
}

.categories {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}
.categories::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid var(--neutral-grey);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn.active, .category-btn:hover {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Grid de Produtos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

/* Product Card */
.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.product-card .thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--card-border);
    transition: transform 0.5s ease;
}

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

.product-card .info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    z-index: 1;
    background: var(--card-bg);
}

.product-card .title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (prefers-color-scheme: dark) {
    .product-card .title { color: white; }
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-orange);
    margin-bottom: 0.5rem;
}

.product-card .category-badge {
    align-self: flex-start;
    font-size: 0.8rem;
    padding: 0.2rem 0.8rem;
    background: rgba(107, 114, 128, 0.2);
    border-radius: 12px;
    color: var(--text-light);
    margin-top: auto;
}

/* Load More Spinner */
.loader {
    text-align: center;
    padding: 2rem 0;
    display: none;
}
.loader.active {
    display: block;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--card-border);
    border-top: 4px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Detail Page */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    padding: 2rem;
}

@media (max-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }
}

.gallery-container img, .gallery-container iframe {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 1px solid var(--card-border);
}

.detail-info h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}
@media (prefers-color-scheme: dark) {
    .detail-info h1 { color: white; }
}

.detail-info .price {
    font-size: 2.5rem;
    color: var(--accent-orange);
    font-weight: 800;
    margin-bottom: 2rem;
}

.detail-info .description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

.btn-buy {
    display: inline-block;
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--accent-orange), #d35400);
    color: white;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.6);
}

/* Admin Styles */
.admin-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
}

.admin-form .form-group {
    margin-bottom: 1.5rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="password"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}

.admin-form input:focus, .admin-form textarea:focus {
    border-color: var(--accent-purple);
}

.btn-primary {
    background: var(--accent-purple);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.3s;
}
.btn-primary:hover {
    background: #4f46e5;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

table.admin-table th, table.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

table.admin-table th {
    background: rgba(0,0,0,0.05);
}
@media (prefers-color-scheme: dark) {
    table.admin-table th { background: rgba(255,255,255,0.05); }
}
