:root{
  --bg:#0b1220;
  --card:#0f1a2f;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --line:rgba(148,163,184,.18);
  --brand:#60a5fa;
  --brand2:#34d399;
  --danger:#fb7185;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(96,165,250,.25), transparent 60%),
    radial-gradient(700px 450px at 90% 10%, rgba(52,211,153,.18), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(251,113,133,.12), transparent 60%),
    var(--bg);
}

.header{
  position:sticky;
  top:0;
  z-index:40;
  background: rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

.brand{
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--text);
  text-decoration:none;
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
}
.brand__dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 0 4px rgba(96,165,250,.18);
}

.search{
  flex: 1;
  max-width: 520px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}
.search__input{
  width:100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15,26,47,.7);
  color: var(--text);
  outline: none;
}
.search__input::placeholder{color:rgba(148,163,184,.9)}
.search__input:focus{border-color: rgba(96,165,250,.55); box-shadow: 0 0 0 4px rgba(96,165,250,.12)}

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

.toolbar{
  display:flex;
  gap:18px;
  align-items:flex-end;
  justify-content:space-between;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(15,26,47,.55);
  border-radius: 18px;
}
.title{margin:0; font-size:1.6rem}
.subtitle{margin:6px 0 0; color:var(--muted); font-size:.95rem}

.toolbar__right{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:flex-end;
}

.field{display:flex; flex-direction:column; gap:8px; min-width:190px}
.field__label{color:var(--muted); font-size:.82rem; font-weight:700}
.field__control{
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15,26,47,.7);
  color: var(--text);
  outline:none;
}
.field__control:focus{border-color: rgba(52,211,153,.55); box-shadow: 0 0 0 4px rgba(52,211,153,.12)}

.btn{
  border:1px solid var(--line);
  background: rgba(15,26,47,.7);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{transform: translateY(-1px)}
.btn:active{transform: translateY(0)}
.btn--primary{
  border-color: rgba(96,165,250,.45);
  background: linear-gradient(135deg, rgba(96,165,250,.95), rgba(52,211,153,.85));
  color:#07101f;
}
.btn--ghost{background: rgba(15,26,47,.35)}
.btn--full{width:100%}

.badge{
  margin-left:10px;
  background: rgba(7,16,31,.75);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .8rem;
  font-weight: 900;
}

.grid{margin-top:16px}
.grid__items{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.product{
  grid-column: span 12;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow:hidden;
  background: rgba(15,26,47,.55);
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
}

@media (min-width: 640px){
  .product{grid-column: span 6}
}
@media (min-width: 980px){
  .product{grid-column: span 4}
}

.product__img{
  height: 150px;
  background-color: rgba(7,16,31,.55);
  border-bottom: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.product__body{padding:14px}
.product__top{display:flex; gap:10px; justify-content:space-between; align-items:flex-start}
.product__title{margin:0; font-size:1.05rem}
.pill{
  display:inline-flex;
  align-items:center;
  border: 1px solid rgba(96,165,250,.35);
  background: rgba(96,165,250,.12);
  color: #cfe6ff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 900;
}
.product__desc{margin:10px 0 0; color: var(--muted); font-size:.9rem; line-height:1.35}
.product__meta{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:space-between;
}
.price{font-weight: 900}
.rating{color: #fde68a; font-weight: 900}
.product__actions{margin-top:12px; display:flex; gap:10px}

.empty{
  margin-top: 14px;
  padding: 28px 18px;
  border: 1px dashed rgba(148,163,184,.35);
  border-radius: 18px;
  color: var(--muted);
  text-align:center;
  background: rgba(15,26,47,.35);
}
.empty h2{margin:0; color: var(--text)}

/* Modal */
.modal::backdrop{background: rgba(0,0,0,.55)}
.modal{
  border: 0;
  padding: 0;
  background: transparent;
  width: min(820px, calc(100% - 28px));
}
.modal__card{
  position:relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15,26,47,.92);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow:hidden;
}

/* Force readable text inside dialogs (some browsers default to black) */
.modal,
.modal__card,
.modal__card *{
  color: var(--text);
}
.modal input,
.modal textarea,
.modal select{
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  background: rgba(7,16,31,.45);
  border: 1px solid var(--line);
}
.modal input::placeholder,
.modal textarea::placeholder{
  color: rgba(148,163,184,.9);
}
.modal__card--wide{width: min(980px, calc(100% - 28px))}
.modal__close{
  position:absolute;
  top:12px; right:12px;
  width:40px; height:40px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(15,26,47,.5);
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
}
.modal__body{display:grid; gap:14px; grid-template-columns: 1fr}
.modal__image{
  height: 180px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background-color: rgba(7,16,31,.55);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.modal__title{margin:10px 0 0}
.modal__desc{margin:10px 0 0; color: var(--muted); line-height:1.4}
.modal__actions{margin-top:14px; display:flex; gap:10px; flex-wrap:wrap}
.meta{margin-top:12px; display:flex; gap:14px; flex-wrap:wrap}
.meta__item{display:flex; flex-direction:column; gap:4px}
.meta__label{color: var(--muted); font-size:.82rem; font-weight:800}
.meta__value{font-weight:900}
@media (min-width: 820px){
  .modal__body{grid-template-columns: 1.1fr 1.4fr}
  .modal__image{height: 100%}
}

/* Drawer */
.drawer{
  position:fixed;
  inset:0;
  display:none;
  z-index:60;
}
.drawer.is-open{display:block}
.drawer__overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}
.drawer__panel{
  position:absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  border-left: 1px solid var(--line);
  background: rgba(15,26,47,.95);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
}
.drawer__header{
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.drawer__title{margin:0}
.drawer__sub{margin:4px 0 0; color: var(--muted); font-size:.9rem}
.drawer__items{padding: 12px 16px; overflow:auto; flex:1; display:grid; gap:10px}
.drawer__footer{padding: 14px 16px; border-top: 1px solid var(--line); display:grid; gap:10px}
.total{display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,16,31,.45)}

.cart-item{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(7,16,31,.35);
  display:grid;
  gap: 10px;
}
.cart-item__top{display:flex; gap:10px; align-items:flex-start; justify-content:space-between}
.cart-item__name{margin:0; font-weight: 900}
.cart-item__meta{color: var(--muted); font-size:.9rem; margin-top:4px}
.qty{
  display:flex; gap:8px; align-items:center; justify-content:space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}
.qty__btn{
  width:34px;
  height:34px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15,26,47,.5);
  color: var(--text);
  cursor:pointer;
  font-weight: 900;
}
.qty__value{font-weight: 900; min-width: 22px; text-align:center}
.link-danger{
  color: var(--danger);
  background: transparent;
  border: 0;
  cursor:pointer;
  font-weight: 900;
}

/* Checkout */
.modal__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.checkout{
  padding-top: 12px;
  display:grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.hint{margin:10px 0 0; color: var(--muted); font-size:.85rem}
.summary{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(7,16,31,.35);
}
.summary h3{margin:0 0 10px}
.summary__items{display:grid; gap:8px; margin-bottom: 12px}
.summary__row{
  display:flex; justify-content:space-between; align-items:center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.summary__row--total{font-size: 1.05rem}
.summary-item{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  color: var(--muted);
  font-size:.92rem;
}

.receipt{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7,16,31,.45);
  color: var(--text);
  overflow:auto;
}

@media (min-width: 920px){
  .checkout{grid-template-columns: 1.2fr .9fr}
}

