@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --primary: #FFE600;
    --primary-glow: rgba(255, 230, 0, 0.6);
    --bg: #0a0a0a;
    --card-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.12);
    --chroma-cyan: #00f2ff;
    --chroma-magenta: #ff00c8;
    --text-main: #ffffff;
    --text-mono: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* High-Chroma Background Elements */
.vitreous-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.orb-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: var(--chroma-cyan); bottom: -50px; left: -50px; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: var(--chroma-magenta); top: 40%; left: 20%; animation-delay: -10s; }

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.2); }
}

/* Header / Search Navigation */
header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-logo {
    height: 90px;
    width: auto;
    transition: all 0.3s;
}

.search-container {
    flex-grow: 1;
    max-width: 600px;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .search-container { display: block; }
}

.search-container input {
    width: 100%;
    background: var(--card-glass);
    border: 1px solid var(--border-glass);
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 230, 0, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links {
    display: flex;
    gap: 24px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Dropdown Navigation */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Invisible bridge to prevent hover loss when moving mouse to list */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -50%;
    width: 200%;
    height: 20px;
    background: transparent;
    z-index: 100;
}

.dropbtn {
    cursor: pointer;
    padding-bottom: 5px; /* Increase direct hover area slightly */
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(10, 10, 10, 0.95);
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 101;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    overflow: hidden;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-transform: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--card-glass);
    color: var(--primary);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Main Vitreous Grid */
main {
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: reveal 0.8s forwards;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    justify-content: center;
}

/* User's Request: "evita deixar aqueles espaços absurdos"
   Fixed: We use fit-content heights and strict gap spacing on flex column. */
.card {
    position: relative;
    background: var(--card-glass);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    animation: reveal 0.8s forwards;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 230, 0, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 
                inset 0 0 20px rgba(255, 230, 0, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
    border-radius: inherit;
}

.product-img {
    width: 100%;
    height: 280px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.product-img .visual {
    position: absolute;
    width: 60%;
    height: 60%;
    background: linear-gradient(45deg, var(--primary), var(--chroma-magenta));
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    transition: transform 0.5s ease;
    z-index: 0;
}

.card:hover .visual {
    transform: scale(1.5) rotate(45deg);
    opacity: 0.3;
}

/* Allow the actual product image to render OVER the glowing glass orb */
.product-img img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0px 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.4s ease;
}

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

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: black;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    z-index: 2;
}

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

.product-info h3 {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 1rem;
}

.currency {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary);
}

.price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 500;
    color: white;
}

.installment {
    font-size: 0.8rem;
    color: var(--text-mono);
    margin-top: 4px;
}

.buy-btn {
    margin-top: auto; /* Pushes button to bottom if card stretches, but prevents massive gaps inside flex column */
    padding-top: 1.5rem;
    width: 100%;
}

.buy-btn button {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.buy-btn button:hover {
    background: var(--primary);
    color: black;
    box-shadow: 0 0 25px var(--primary-glow);
}

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

/* Footer Styling */
footer {
    padding: 40px 20px;
    border-top: 1px solid var(--border-glass);
    margin-top: 50px;
    text-align: center;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    header { flex-direction: column; padding: 1.5rem; gap: 1rem; }
    .nav-links { display: none; }
    .section-header h2 { font-size: 2rem; }
}
