* { box-sizing: border-box; margin: 0; padding: 0 }
:root {
  --brand: #7b2ff7;
  --brand2: #cb11ab;
  --dark: #481173;
  --bg: #f6f6fb;
  --card: #fff;
  --txt: #1c1c1c;
  --muted: #7a7a85;
  --pink: #ff416c;
  --line: #eee;
  --r: 16px;
  --shadow: 0 2px 12px rgba(72, 17, 115, .08);
}
html { scroll-behavior: smooth }
body { font-family: 'Manrope', system-ui, Arial, sans-serif; background: var(--bg); color: var(--txt); }

/* header */
.top { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 18px; padding: 12px 28px; background: #fff; box-shadow: 0 1px 0 var(--line), 0 6px 24px rgba(72,17,115,.06) }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 22px; color: var(--dark); white-space: nowrap }
.logo img { height: 40px; border-radius: 10px }
.logo b { background: linear-gradient(90deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent }
.search { flex: 1; max-width: 620px; display: flex; background: #f2f0f8; border-radius: 24px; padding: 4px; border: 1px solid transparent; transition: .2s }
.search:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(123,47,247,.15) }
.search input { flex: 1; border: none; background: none; outline: none; padding: 10px 18px; font-size: 14px; font-family: inherit }
.search button { border: none; background: var(--brand); color: #fff; border-radius: 20px; padding: 10px 22px; font-weight: 700; cursor: pointer; font-family: inherit }
nav { margin-left: auto; display: flex; align-items: center; gap: 10px }
.hbtn { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: .15s }
.hbtn:hover { border-color: var(--brand); color: var(--brand) }
.badge { position: absolute; top: -6px; right: -4px; background: var(--pink); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: none; align-items: center; justify-content: center; font-weight: 700; padding: 0 5px }

/* hero */
.hero { background: linear-gradient(120deg, var(--dark) 0%, var(--brand) 60%, var(--brand2) 100%); color: #fff; border-radius: 24px; margin: 20px 28px 0; padding: 40px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; position: relative }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; background: rgba(255,255,255,.08); border-radius: 50% }
.hero h1 { font-size: 34px; line-height: 1.2; margin-bottom: 12px; font-weight: 800 }
.hero p { opacity: .9; font-size: 15px; margin-bottom: 22px; max-width: 460px }
.hero .cta { background: #fff; color: var(--dark); border: none; padding: 14px 30px; border-radius: 30px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: inherit }
.hero img { width: 260px; height: 260px; border-radius: 20px; object-fit: cover; box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; z-index: 1 }

main { max-width: 1320px; margin: 0 auto; padding: 24px 28px 60px }

/* category tiles */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 18px 0 24px }
.ctile { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 3/4; border: none; cursor: pointer; padding: 0; background: #fff }
.ctile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s }
.ctile:hover img { transform: scale(1.07) }
.ctile .lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 12px 12px; color: #fff; font-weight: 700; font-size: 14px; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.75)) }
.ctile.on { outline: 3px solid var(--brand) }

/* filters */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; background: var(--card); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow) }
.filters input, .filters select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-family: inherit; outline: none }
.filters input:focus, .filters select:focus { border-color: var(--brand) }
.filters .found { margin-left: auto; color: var(--muted); font-size: 13px }
.filters .found b { color: var(--txt) }

/* grid & cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px }
.card { position: relative; background: var(--card); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column }
.card:hover { transform: translateY(-5px); box-shadow: 0 14px 34px rgba(72,17,115,.16) }
.card .imgwrap { position: relative; overflow: hidden }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .3s }
.card:hover img { transform: scale(1.05) }
.disc { position: absolute; top: 12px; left: 12px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 800; border-radius: 8px; padding: 4px 8px }
.addc { position: absolute; right: 12px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; border: none; background: #fff; color: var(--dark); font-size: 20px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(6px); transition: .2s }
.card:hover .addc { opacity: 1; transform: none }
.addc:active { background: var(--brand); color: #fff }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1 }
.stars { color: #ffb400; font-size: 13px; letter-spacing: 1px }
.stars span { color: var(--muted); letter-spacing: 0; margin-left: 4px; font-size: 12px }
.card .name { font-size: 13px; color: #555; line-height: 1.4; flex: 1 }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap }
.price { font-weight: 800; font-size: 19px }
.old { color: var(--muted); text-decoration: line-through; font-size: 13px }

/* product page */
.pdetail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 32px; background: var(--card); border-radius: 20px; padding: 28px; box-shadow: var(--shadow) }
.pdetail > img { width: 100%; border-radius: 16px; object-fit: cover; align-self: start }
.pinfo h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 14px }
.desc { color: #555; line-height: 1.6; margin: 14px 0 20px; font-size: 14px }
.bigprice { font-size: 34px; font-weight: 800 }
.buy { background: linear-gradient(90deg, var(--brand), var(--brand2)); color: #fff; border: none; padding: 15px 44px; border-radius: 26px; font-weight: 800; font-size: 16px; cursor: pointer; font-family: inherit; margin-top: 18px; transition: filter .15s; box-shadow: 0 8px 24px rgba(203,17,171,.35) }
.buy:hover { filter: brightness(1.08) }
.similar { margin-top: 32px }
.similar h2 { font-size: 20px; margin-bottom: 14px }
.similar .grid { margin-top: 0 }

/* cart */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow) }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle }
th { background: var(--dark); color: #fff; font-size: 13px }
.cartimg { width: 64px; height: 64px; border-radius: 10px; object-fit: cover }
.qty { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 2px 6px }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: none; background: #f2f0f8; cursor: pointer; font-size: 16px; font-weight: 700 }
.tot { font-weight: 800; font-size: 22px }
.btn { background: var(--dark); color: #fff; border: none; padding: 13px 28px; border-radius: 24px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 14px }
.btn:hover { filter: brightness(1.15) }
.btn2 { background: #f2f0f8; color: var(--txt); padding: 10px 16px; border-radius: 20px; border: none; cursor: pointer; font-family: inherit; font-weight: 600 }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; background: var(--card); border-radius: var(--r); padding: 24px; max-width: 460px; box-shadow: var(--shadow) }
.form input { padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-family: inherit; outline: none }
.form input:focus { border-color: var(--brand) }
.ok { color: #0a8f3c; font-weight: 700 }
.err { color: #d00; font-size: 13px }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(30,10,50,.55); display: flex; align-items: center; justify-content: center; z-index: 200; backdrop-filter: blur(4px) }
.modal.hidden { display: none }
.modal-body { background: #fff; border-radius: 20px; padding: 28px; width: 90%; max-width: 400px; box-shadow: 0 30px 80px rgba(0,0,0,.3) }
.modal-body h2 { margin-bottom: 16px; font-size: 20px }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(80px); background: var(--dark); color: #fff; padding: 14px 26px; border-radius: 30px; font-weight: 700; font-size: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.3); opacity: 0; transition: .3s; z-index: 300; display: flex; align-items: center; gap: 10px }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1 }

/* misc */
.empty { text-align: center; color: var(--muted); padding: 70px 0; font-size: 15px }
a { color: var(--brand) }
.foot { margin-top: 40px; background: var(--dark); color: #bbb; padding: 40px 28px; font-size: 13px; line-height: 1.8 }
.foot .inner { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px }
.foot b { color: #fff; display: block; margin-bottom: 8px; font-size: 14px }
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; padding: 32px 24px }
  .hero h1 { font-size: 26px }
  .pdetail { grid-template-columns: 1fr }
  .cats { grid-template-columns: repeat(3, 1fr) }
  .foot .inner { grid-template-columns: 1fr 1fr }
  .top { flex-wrap: wrap; padding: 10px 16px }
  .search { order: 3; flex-basis: 100%; max-width: none }
}
