/* =========================================================
   PAINEL DAS MÚSICAS — style.css
   Organizado por seções, sem regras duplicadas.
========================================================= */

/* ---------- Reset básico ---------- */
*{
  box-sizing: border-box;
}

body{
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f8fafc;
  overflow-x: hidden;
}

/* ---------- Hero ---------- */
.hero{
  background: #0f172a;
  color: #fff;
  padding: 40px;
}

.steps{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Abas ---------- */
.tabs{
  display: flex;
  gap: 10px;
  padding: 20px;
}

.tabs button{
  padding: 16px 34px;
  font-size: 18px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: #e2e8f0;
  color: #0f172a;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.tabs button.active{
  background: #16a34a;
  color: #fff;
}

/* ---------- Layout principal ---------- */
main{
  padding: 20px;
}

/* ---------- Toolbar (busca + filtro + contador) ---------- */
.toolbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f8fafc;
  padding: 14px 0 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  transition: box-shadow .2s, padding .2s;
}

.toolbar.stuck{
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  padding: 14px 20px;
  margin: 0 -20px;
}

.search-input{
  flex: 1 1 320px;
  min-width: 220px;
  padding: 16px 20px;
  font-size: 18px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  outline: none;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  transition: border-color .2s, box-shadow .2s;
}

.search-input:focus{
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22,163,74,.15);
}

.ritmo-select{
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  min-width: 180px;
  cursor: pointer;
}

.counter{
  flex-basis: 100%;
  order: 3;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  background: #e2e8f0;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  width: fit-content;
}

@media (min-width: 640px){
  .counter{
    flex-basis: auto;
    order: 0;
    margin-left: auto;
  }
}

/* ---------- Títulos de seção ---------- */
.section-title{
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.section-block{
  margin-bottom: 10px;
}

.section-block.hidden{
  display: none;
}

.empty-message{
  color: #777;
  padding: 20px 4px;
  font-size: 15px;
}

/* ---------- Grid de cards ---------- */
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, 220px);
  justify-content: center;
  gap: 18px;
}

.card{
  width: 220px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.card img{
  display: block;
  width: 220px;
  height: 150px;
  object-fit: cover;
}

.card strong,
.card p{
  display: block;
  padding: 10px;
  margin: 0;
}

.card button{
  display: block;
  width: calc(100% - 20px);
  margin: 10px;
  background: #16a34a;
  color: #fff;
  border: 0;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
}

.card button:hover{
  background: #15803d;
}

.type-badge{
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #16a34a;
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 10px 10px 0;
}

/* ---------- Carrinho (botão flutuante) ---------- */
#cart{
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #16a34a;
  color: #fff;
  padding: 12px 16px;
  border: 0;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
  transition: transform .2s;
}

#cart small{
  display: block;
  font-size: 12px;
  opacity: .95;
}

#cart.bump{
  transform: scale(1.12);
}

/* ---------- Painel lateral do carrinho ---------- */
.cart-panel{
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  box-shadow: -3px 0 20px rgba(0,0,0,.2);
  transition: right .3s;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.cart-panel.open{
  right: 0;
}

.cart-header,
.cart-footer{
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

.cart-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header button{
  background: none;
  border: 0;
  font-size: 18px;
  cursor: pointer;
}

#cartItems{
  flex: 1;
  padding: 20px;
  overflow: auto;
}

.cart-item{
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.cart-item .top{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.remove{
  background: #ef4444;
  color: #fff;
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.cart-footer{
  border-top: 1px solid #ddd;
  border-bottom: 0;
}

.cart-footer button{
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: #16a34a;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px){
  .grid{
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

@media (max-width: 600px){
  .search-input{
    font-size: 16px;
    padding: 14px 16px;
  }

  .toolbar.stuck{
    margin: 0 -12px;
  }
}
