:root{
  --bg: #0b1020;
  --card: rgba(255,255,255,0.06);
  --stroke: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --brand: #7c5cff;
  --brand2: #2fe0b1;
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(124,92,255,0.28), transparent 55%),
    radial-gradient(700px 500px at 80% 10%, rgba(47,224,177,0.18), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(255,255,255,0.07), transparent 55%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

.container{
  width:min(1150px, 92vw);
  margin:0 auto;
  padding: 28px 0 64px;
}

/* ===== Top bar ===== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 14px 16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  flex-wrap: wrap; /* IMPORTANT pentru mobil */
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:700;
  letter-spacing:0.2px;
}
.logo{
  width:38px; height:38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 30px rgba(124,92,255,0.25);
}

/* Search */
.search{
  flex: 1 1 420px; /* important: să se micșoreze corect */
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,0.15);
  min-width: 260px;
}
.search input{
  width:100%;
  border:none;
  outline:none;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  min-width: 0; /* important pentru flex */
}
.search .hint{
  font-size:12px;
  color: var(--muted);
  white-space:nowrap;
}

/* Actions */
.actions{
  display:flex;
  gap:10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Buttons */
.btn{
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight:600;
  font-size: 14px;
  cursor:pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}

/* ===== Hero ===== */
.hero{
  margin-top: 18px;
  border-radius: calc(var(--radius) + 8px);
  padding: 28px;
  border:1px solid var(--stroke);
  background:
    linear-gradient(135deg, rgba(124,92,255,0.18), rgba(47,224,177,0.10)),
    rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}
.hero:before{
  content:"";
  position:absolute;
  inset:-120px -120px auto auto;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 60%);
  filter: blur(2px);
  opacity: 0.35;
}
.hero h1{
  margin:0 0 8px;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height:1.15;
}
.hero p{
  margin:0;
  color: var(--muted);
  max-width: 68ch;
}

/* ===== Filters ===== */
.filters{
  margin-top: 16px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.pill{
  padding: 10px 12px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  cursor:pointer;
  transition: .15s ease;
}
.pill:hover{ background: rgba(255,255,255,0.07); }
.pill.active{
  color: var(--text);
  border-color: rgba(124,92,255,0.6);
  background: rgba(124,92,255,0.16);
}

/* ===== Grid cards ===== */
.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.card{
  grid-column: span 4;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 12px 35px rgba(0,0,0,0.30);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  position:relative;
}
.card:hover{
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}
.card .cover{
  aspect-ratio: 16 / 10;
  background: rgba(0,0,0,0.2);
  overflow:hidden;
}
.card .cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  transform: scale(1.02);
}
.card .body{
  padding: 14px 14px 16px;
}
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.title{
  font-weight:800;
  letter-spacing:0.2px;
}
.meta{
  margin-top: 6px;
  display:flex;
  gap:10px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap; /* important pe mobil */
}
.badge{
  font-size:12px;
  font-weight:700;
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
}
.price{
  font-weight:900;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}

/* ===== Details page ===== */
.breadcrumb{
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}
.details{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 7fr 5fr;
  gap: 16px;
}
.panel{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.gallery{ padding: 14px; }

.big{
  border-radius: 16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.10);
  aspect-ratio: 16/10;
  background: rgba(0,0,0,0.20);
}
.big img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.thumbs{
  margin-top: 12px;
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.thumb{
  width: 92px;
  height: 62px;
  border-radius: 14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.12);
  cursor:pointer;
  flex: 0 0 auto;
  opacity: 0.85;
  transition: .15s ease;
  background: transparent;
}
.thumb:hover{ opacity:1; transform: translateY(-1px); }
.thumb.active{
  border-color: rgba(124,92,255,0.7);
  box-shadow: 0 12px 30px rgba(124,92,255,0.18);
  opacity:1;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.info{ padding: 16px; }
.info h2{
  margin: 0 0 6px;
  font-size: 22px;
}
.info .sub{
  color: var(--muted);
  margin: 0 0 14px;
}
.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kv .item{
  padding: 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.16);
}
.kv .item .k{
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.kv .item .v{ font-weight:800; }

.desc{
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word; /* text lung ok pe mobil */
}

/* ===== Footer ===== */
.footer{
  margin-top: 22px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.footer strong{ color: var(--text); }

/* Inputs */
.input{
  width:100%;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:14px;
  padding:12px;
  background: rgba(0,0,0,0.16);
  color: rgba(255,255,255,0.92);
  outline:none;
  font-size:14px;
}
.input:focus{
  border-color: rgba(124,92,255,0.7);
}

/* ===== RESPONSIVE (cheia pentru telefon) ===== */

/* Tablet */
@media (max-width: 980px){
  .card{ grid-column: span 6; }
  .details{ grid-template-columns: 1fr; }
  .search{ flex: 1 1 320px; }
}

/* Telefon: topbar în coloană + search full width + butoane ok */
@media (max-width: 720px){
  .container{ padding: 18px 0 48px; }

  .topbar{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  /* brand sus, acțiuni sub el, search jos */
  .brand{ justify-content: space-between; }
  .actions{
    width: 100%;
    justify-content: flex-end;
  }
  .search{
    width: 100%;
    min-width: 0;
  }

  .hero{ padding: 18px; }
}

/* Telefon mic: butoanele se pun 2 pe rând */
@media (max-width: 420px){
  .actions{
    justify-content: space-between;
  }
  .actions .btn{
    flex: 1 1 48%;
    text-align: center;
  }
  .search .hint{ display:none; }
}

/* Form/kv pe telefon: 1 coloană */
@media (max-width: 560px){
  .card{ grid-column: span 12; }
  .kv{ grid-template-columns: 1fr; }
}
/* ===== FIX TOPBAR PE TELEFON (pune la final) ===== */

@media (max-width: 720px){
  .topbar{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand{
    width: 100%;
    justify-content: space-between;
  }

  .search{
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .actions{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

/* Telefon mic: butonul să nu iasă din ecran */
@media (max-width: 420px){
  .actions{
    justify-content: stretch;
  }
  .actions .btn{
    width: 100%;
    text-align: center;
  }
  .search .hint{
    display:none;
  }
}
