:root {
    --accent: #1DB954;
    --black: #000000;
    --card-bg: #121212;
    --text-white: #ffffff;
    --text-dim: #b3b3b3;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }
body { background: var(--black); color: var(--text-white); padding-top: 90px; padding-bottom: 160px; }

/* Navbar */
.navbar { position: fixed; top: 0; width: 100%; height: 70px; background: rgba(0,0,0,0.95); display: flex; align-items: center; justify-content: center; z-index: 1000; border-bottom: 1px solid #1a1a1a; backdrop-filter: blur(10px); }
.logo { font-size: 1.5rem; font-weight: 800; }
.logo b { color: var(--accent); }

/* Filtros */
.filter-wrapper { display: flex; justify-content: center; margin-bottom: 30px; }
.tabs { background: #1a1a1a; padding: 5px; border-radius: 50px; display: flex; gap: 5px; }
.tab-btn { background: transparent; border: none; color: var(--text-dim); padding: 10px 18px; border-radius: 50px; cursor: pointer; font-weight: bold; font-size: 0.75rem; transition: 0.3s; }
.tab-btn.active { background: var(--text-white); color: #000; }

/* Beat Grid */
.beat-grid { display: grid; gap: 15px; padding: 0 15px; max-width: 1100px; margin: 0 auto; }

/* MOBILE: Layout Lista (Corrigido para não comer o botão) */
@media (max-width: 767px) {
    .card { display: flex; align-items: center; background: var(--card-bg); padding: 10px; border-radius: 12px; gap: 12px; }
    .cover-box { width: 70px; height: 70px; min-width: 70px; position: relative; }
    .card-info { flex: 1; min-width: 0; } /* min-width 0 evita que o texto empurre o botão */
    .card-info h3 { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .card-info p { font-size: 0.7rem; color: var(--text-dim); }
    
    .card-right { 
        display: flex; 
        flex-direction: column; 
        align-items: flex-end; 
        gap: 5px;
        min-width: 90px;
    }
    .price { font-size: 0.85rem; font-weight: bold; color: var(--accent); }
    .buy-link { padding: 6px 12px; font-size: 0.65rem; width: auto; text-align: center; }
}

/* DESKTOP: Layout Grade */
@media (min-width: 768px) {
    .beat-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; }
    .card { background: var(--card-bg); padding: 18px; border-radius: 15px; text-align: center; border: 1px solid #1a1a1a; transition: 0.3s; }
    .card:hover { transform: translateY(-5px); border-color: #333; }
    .cover-box { width: 100%; aspect-ratio: 1/1; position: relative; margin-bottom: 15px; }
    .price { font-size: 1.25rem; font-weight: 800; color: var(--accent); display: block; margin: 15px 0; }
    .buy-link { width: 100%; padding: 12px; font-size: 0.8rem; }
}

.cover-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.play-btn { position: absolute; bottom: 5px; right: 5px; width: 32px; height: 32px; background: var(--accent); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.buy-link { 
    background: #fff; color: #000; text-decoration: none; border-radius: 50px; 
    font-weight: 900; text-transform: uppercase; transition: 0.2s;
}
.buy-link:hover { background: var(--accent); color: white; }

/* PLAYER CENTRALIZADO (PC E MOBILE) */
.player { 
    position: fixed; bottom: 0; width: 100%; background: #080808; 
    border-top: 1px solid #222; padding: 15px 20px; z-index: 1001;
    display: flex; flex-direction: column; align-items: center; /* Centraliza no mobile */
}

.now-playing { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; margin-bottom: 10px; }
.now-playing img { width: 45px; height: 45px; border-radius: 4px; }
.p-info strong { display: block; font-size: 0.9rem; }
.p-info small { color: var(--accent); font-size: 0.75rem; }

.p-controls { width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; }
.p-progress-container { display: flex; align-items: center; gap: 10px; width: 100%; }
#progress-bar { flex: 1; accent-color: var(--accent); cursor: pointer; height: 4px; }
.p-progress-container span { font-size: 0.7rem; color: var(--text-dim); min-width: 30px; }

.p-btns-wrapper { display: flex; justify-content: center; align-items: center; gap: 30px; margin-top: 10px; }
.btn-ctrl { background: none; border: none; color: #fff; cursor: pointer; }
.play-main-wrapper { width: 45px; height: 45px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* AJUSTE PC: Player em linha, mas centralizado */
@media (min-width: 768px) {
    .player { 
        flex-direction: row; 
        justify-content: space-between; 
        height: 100px; 
        padding: 0 50px; 
    }
    .now-playing { width: 250px; justify-content: flex-start; margin-bottom: 0; }
    .p-controls { 
        position: absolute; 
        left: 50%; 
        transform: translateX(-50%); /* Centraliza absolutamente no meio da tela */
    }
}