/* ============================================
   AdCake Marketplace — extends styles.css
   ============================================ */
.mkt-body{background:linear-gradient(180deg,#F8FAFF 0%, #FFFFFF 240px)}

/* ---- HERO ---- */
.mkt-hero{position:relative; overflow:hidden; padding:36px 0 24px}
.mkt-hero::before{
  content:""; position:absolute; inset:-40px -20px auto -20px; height:340px; z-index:0;
  background:
    radial-gradient(600px 320px at 12% 0%, #DBEAFE 0%, transparent 60%),
    radial-gradient(500px 300px at 92% 10%, #FFEDD5 0%, transparent 55%);
  pointer-events:none;
}
.mkt-hero > .container{position:relative; z-index:1}
.mkt-hero-head{display:grid; grid-template-columns:1fr; gap:22px; align-items:end}
.mkt-hero h1{font-size:clamp(28px,4.6vw,44px); line-height:1.1; margin:12px 0 10px}
.mkt-hero h1 .hl{background:var(--grad-brand); -webkit-background-clip:text; background-clip:text; color:transparent}
.mkt-hero .lead{color:var(--muted); font-size:16px; max-width:640px}
.mkt-hero-side{position:relative; min-height:80px; display:none}
.hero-orb{position:absolute; width:220px; height:220px; border-radius:50%; filter:blur(40px); opacity:.55;
  background:radial-gradient(circle,#3B82F6 0%, transparent 70%); right:0; top:-30px}
.hero-orb-2{background:radial-gradient(circle,#F97316 0%, transparent 70%); right:120px; top:60px; width:180px; height:180px; opacity:.45}
@media(min-width:900px){
  .mkt-hero-head{grid-template-columns:1.4fr .8fr}
  .mkt-hero-side{display:block; min-height:160px}
}

/* ---- FEATURE ROW ---- */
.mkt-features{
  margin-top:26px; display:grid; grid-template-columns:1fr 1fr; gap:12px;
}
@media(min-width:720px){ .mkt-features{grid-template-columns:repeat(3,1fr)} }
@media(min-width:1000px){ .mkt-features{grid-template-columns:repeat(5,1fr)} }
.mkt-feat{
  display:flex; gap:12px; align-items:center; padding:14px 10px;
  background:#fff; border:1px solid var(--line-soft); border-radius:var(--r);
  box-shadow:var(--shadow-sm); transition:.2s;
}
.mkt-feat:hover{transform:translateY(-2px); box-shadow:var(--shadow); border-color:transparent}
.mkt-feat b{display:block; font-size:14px; color:var(--ink); font-weight:600}
.mkt-feat span{font-size:12.5px; color:var(--muted)}
.mf-ic{width:38px; height:38px; border-radius:12px; display:grid; place-items:center; font-size:18px; flex:none}
.mf-ic.ic-blue{background:var(--blue-50); color:var(--blue)}
.mf-ic.ic-orange{background:var(--orange-50); color:var(--orange)}
.mf-ic.ic-indigo{background:#EEF2FF; color:var(--indigo)}

/* ---- TOOLBAR ---- */
.mkt-toolbar{padding:24px 0 4px}
.tb-inner{
  display:flex; flex-direction:column; gap:14px; align-items:stretch;
  padding:16px; background:#fff; border:1px solid var(--line-soft);
  border-radius:var(--r-lg); box-shadow:var(--shadow-sm);
}
.tb-title{font-size:18px; display:flex; align-items:baseline; gap:8px}
.tb-title span{font-size:13px; color:var(--muted); font-weight:500}
.tb-right{display:flex; flex-wrap:wrap; gap:10px; align-items:center}
.search{
  flex:1 1 220px; min-width:0; display:flex; align-items:center; gap:8px;
  padding:10px 14px; background:var(--surface-2); border:1px solid transparent;
  border-radius:999px; color:var(--muted); font-size:14px; transition:.15s;
}
.search:focus-within{background:#fff; border-color:var(--blue); box-shadow:0 0 0 4px rgba(37,99,235,.12)}
.search svg{font-size:16px}
.search input{flex:1; border:0; outline:none; background:transparent; font:inherit; color:var(--ink)}
.chips{display:flex; flex-wrap:wrap; gap:6px}
.chip{
  padding:8px 14px; border-radius:999px; font-size:13px; font-weight:600; cursor:pointer;
  border:1px solid var(--line); background:#fff; color:var(--ink-2); transition:.15s;
}
.chip:hover{color:var(--blue); border-color:var(--blue-soft)}
.chip.active{background:var(--grad-blue); color:#fff; border-color:transparent; box-shadow:var(--shadow-blue)}
.viewswitch{display:flex; padding:3px; background:var(--surface-2); border-radius:12px}
.vs{width:34px; height:32px; display:grid; place-items:center; border:0; background:transparent; border-radius:9px; color:var(--muted); cursor:pointer; font-size:16px}
.vs.active{background:#fff; color:var(--blue); box-shadow:var(--shadow-sm)}
.tb-cats{display:flex; gap:8px; overflow-x:auto; padding:16px 20px; margin-top:8px; scrollbar-width:none}
.tb-cats::-webkit-scrollbar{display:none}
.cat{
  flex:none; padding:9px 16px; border-radius:999px; font-size:13.5px; font-weight:600;
  border:1px solid var(--line); background:#fff; color:var(--ink-2); cursor:pointer; transition:.15s;
}
.cat:hover{border-color:var(--orange-soft); color:var(--orange)}
.cat.active{background:var(--grad-warm); border-color:transparent; color:#fff; box-shadow:var(--shadow-orange)}
@media(min-width:820px){
  .tb-inner{flex-direction:row; align-items:center; justify-content:space-between}
  .tb-right{flex:1 1 auto; justify-content:flex-end}
  .search{flex:0 1 260px}
}

/* ---- PRODUCT GRID ---- */
.mkt-list{padding:20px 0 80px}
.pgrid{display:grid; grid-template-columns:repeat(2,1fr); gap:14px}
@media(min-width:640px){ .pgrid{grid-template-columns:repeat(3,1fr); gap:18px} }
@media(min-width:900px){ .pgrid{grid-template-columns:repeat(4,1fr)} }
.pgrid.list-view{grid-template-columns:1fr; gap:12px}
.pgrid.list-view .pcard{display:grid; grid-template-columns:180px 1fr; gap:0}
.pgrid.list-view .pc-img{aspect-ratio:1/1}
.pgrid.list-view .pc-body{padding:16px}

.pcard{
  background:#fff; border:1px solid var(--line-soft); border-radius:var(--r-lg);
  overflow:hidden; display:flex; flex-direction:column;
  transition:.2s; position:relative; cursor:pointer; text-decoration:none; color:inherit;
}
.pcard:hover{transform:translateY(-4px); box-shadow:var(--shadow-lg); border-color:transparent}
.pc-img{position:relative; aspect-ratio:4/3; background:linear-gradient(135deg,#F1F5FB 0%,#E2E8F0 100%); overflow:hidden}
.pc-img img{width:100%; height:100%; object-fit:cover; transition:.4s}
.pcard:hover .pc-img img{transform:scale(1.06)}
.pc-img-empty{width:100%; height:100%; display:grid; place-items:center; color:var(--muted); font-size:13px}
.pc-badges{position:absolute; top:10px; left:10px; display:flex; gap:6px; flex-wrap:wrap}
.pc-badge{
  padding:4px 9px; border-radius:999px; font-size:11px; font-weight:700;
  background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); display:inline-flex; align-items:center; gap:4px;
}
.pc-badge.hot{background:var(--grad-warm); color:#fff}
.pc-badge.new{background:var(--blue); color:#fff}
.pc-badge svg{font-size:11px}

.pc-body{padding:12px 14px 14px; display:flex; flex-direction:column; gap:6px; flex:1}
.pc-cat{font-size:11px; letter-spacing:.1em; color:var(--indigo); font-weight:700}
.pc-name{font-size:14px; font-weight:600; color:var(--ink); line-height:1.4; min-height:2.8em;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.pc-price{color:var(--orange); font-weight:800; font-size:16px; margin-top:2px}
.pc-foot{display:flex; justify-content:space-between; align-items:center; margin-top:auto; padding-top:8px;
  border-top:1px dashed var(--line-soft); font-size:12px; color:var(--muted)}
.pc-rate{display:inline-flex; align-items:center; gap:3px; color:#F59E0B; font-weight:700}
.pc-rate svg{font-size:12px}

.empty{padding:80px 20px; text-align:center; color:var(--muted)}
.empty svg{margin:0 auto 12px; color:var(--line)}

/* ---- BREADCRUMB ---- */
.crumbs{padding:16px 20px; font-size:13px; color:var(--muted); display:flex; gap:8px; flex-wrap:wrap}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--blue)}
.crumbs span{color:var(--line)}
.crumbs span:last-child{color:var(--ink); font-weight:600}

/* ---- PRODUCT DETAIL ---- */
.pd-wrap{padding:8px 0 32px}
.pd-grid{display:grid; grid-template-columns:1fr; gap:24px}
@media(min-width:900px){ .pd-grid{grid-template-columns:0.8fr 1.2fr; gap:32px} }

.pd-media{display:flex; flex-direction:column; gap:12px}
.pd-main{aspect-ratio:1/1; border-radius:var(--r-lg); overflow:hidden; background:linear-gradient(135deg,#F1F5FB,#E2E8F0);
  box-shadow:var(--shadow-sm); border:1px solid var(--line-soft)}
.pd-main img{width:100%; height:100%; object-fit:cover}
.pd-thumbs{display:grid; grid-template-columns:repeat(5,1fr); gap:8px}
.pd-thumbs img{aspect-ratio:1/1; object-fit:cover; border-radius:12px; border:2px solid transparent; cursor:pointer; opacity:.7; transition:.15s}
.pd-thumbs img.active,.pd-thumbs img:hover{opacity:1; border-color:var(--blue)}

.pd-buy{display:flex; flex-direction:column; gap:14px}
.pill{display:inline-block; padding:5px 12px; border-radius:999px; font-size:11px; letter-spacing:.08em; font-weight:800; width:fit-content}
.pill-blue{background:var(--blue-50); color:var(--blue)}
.pd-buy h1{font-size:clamp(20px,3vw,28px); line-height:1.25}
.pd-meta{display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:13px; color:var(--muted)}
.pd-meta b{color:var(--ink)}
.pd-meta .rate{color:#F59E0B; display:inline-flex; align-items:center; gap:5px; font-weight:700}
.dot-sep{color:var(--line)}
.pd-price-box{background:linear-gradient(135deg,#FFF7ED,#FFEDD5); padding:16px 18px; border-radius:var(--r); border:1px solid #FDE4C6}
.pd-price{font-family:"Space Grotesk",sans-serif; color:var(--orange); font-weight:800; font-size:32px; line-height:1}
.pd-old{margin-top:6px; font-size:13px; color:var(--muted); display:flex; gap:8px; align-items:center}
.pd-old .save{background:var(--orange); color:#fff; padding:2px 8px; border-radius:6px; font-weight:700; font-size:11px}
.pd-badges{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:4px 0}
.pd-badges li{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-2); padding:10px 12px; background:var(--surface-2); border-radius:12px}
.pd-badges li svg{color:var(--blue); font-size:15px; flex:none}
.pd-badges li:nth-child(2) svg{color:var(--orange)}
.pd-badges li:nth-child(4) svg{color:var(--success)}
.pd-qty{display:flex; align-items:center; justify-content:space-between; padding:12px 14px; background:var(--surface-2); border-radius:12px; font-size:14px}
.qty{display:flex; align-items:center; gap:6px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:2px}
.qty button{width:32px; height:32px; border:0; background:transparent; border-radius:8px; cursor:pointer; color:var(--ink); display:grid; place-items:center; font-size:14px}
.qty button:hover{background:var(--blue-50); color:var(--blue)}
.qty input{width:44px; text-align:center; border:0; outline:none; background:transparent; font:600 14px inherit; color:var(--ink); -moz-appearance:textfield}
.qty input::-webkit-outer-spin-button,.qty input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0}
.pd-actions{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.pd-seller{display:flex; align-items:center; gap:12px; padding:14px; background:#fff; border:1px solid var(--line-soft); border-radius:var(--r); box-shadow:var(--shadow-sm)}
.pd-seller > div{flex:1; min-width:0}
.ps-ava{width:44px; height:44px; border-radius:12px; background:var(--grad-brand); color:#fff; display:grid; place-items:center; font-weight:800; flex:none}
.ps-name{font-weight:700; display:flex; align-items:center; gap:6px; font-size:14px}
.ic-check{color:var(--blue); font-size:14px}
.ps-line{font-size:12.5px; color:var(--muted)}

/* ---- TABS ---- */
.pd-tabs-wrap{padding:16px 0 40px}
.pd-tabs{display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--line); scrollbar-width:none}
.pd-tabs::-webkit-scrollbar{display:none}
.ptab{flex:none; padding:12px 18px; border:0; background:transparent; font-size: 14px; font-weight: 600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; transition:.15s}
.ptab:hover{color:var(--ink)}
.ptab.active{color:var(--blue); border-bottom-color:var(--blue)}
.ptab-body{padding:22px 0 8px; color:var(--ink-2); line-height:1.75; font-size:15px}
.ptab-body h3{font-size:17px; margin:14px 0 10px; color:var(--ink)}
.ticks{display:grid; gap:8px; margin:6px 0}
.ticks li{display:flex; gap:10px; align-items:flex-start}
.ticks svg{color:var(--success); font-size:16px; flex:none; margin-top:5px}
.spec{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px}
.spec > div{padding:12px 14px; background:var(--surface-2); border-radius:12px; display:flex; justify-content:space-between; font-size:14px}
.spec span{color:var(--muted)}
.steps{padding-left:20px; display:grid; gap:10px}
.steps li{padding-left:6px}
.steps b{color:var(--blue)}
.reviews{display:grid; gap:14px}
.rv{display:flex; gap:12px; padding:16px; background:#fff; border:1px solid var(--line-soft); border-radius:var(--r)}
.rv > div:last-child{flex:1}
.rv-ava{width:42px; height:42px; border-radius:12px; background:var(--grad-warm); color:#fff; display:grid; place-items:center; font-weight:800; flex:none}
.rv-h{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:2px}
.rv-time{font-size:12px; color:var(--muted); font-weight:400}
.rv-stars{color:#F59E0B; display:flex; gap:1px; margin-bottom:6px; font-size:12px}
.rv p{font-size:14px; color:var(--ink-2)}

/* ---- RELATED ---- */
.pd-related{padding:20px 0 60px}
.rel-h{font-size:22px; margin-bottom:18px}

/* ============================================
   MODAL (Payment + Success)
   ============================================ */
/*.modal{position:fixed; inset:0; z-index:100; display:none; align-items:flex-end; justify-content:center; padding:0}*/

@media(min-width:640px){ .modal{padding:20px; align-items:center} }
.modal.open{display:flex; animation:mfade .18s ease}
/*.modal-backdrop{position:absolute; inset:0; background:rgba(15,23,42,.55); backdrop-filter:blur(4px)}*/
.modal-panel{
  position:relative; width:100%; max-width:440px; background:#fff;
  border-radius:22px 22px 0 0; padding:26px 22px 22px;
  box-shadow:0 40px 80px -20px rgba(15,23,42,.4);
  animation:mup .28s cubic-bezier(.2,.9,.3,1);
  max-height:92vh; overflow-y:auto;
}
@media(min-width:640px){ .modal-panel{border-radius:24px} }
@keyframes mfade{ from{opacity:0} to{opacity:1} }
@keyframes mup{ from{transform:translateY(24px); opacity:0} to{transform:none; opacity:1} }
.modal-x{position:absolute; top:14px; right:14px; width:34px; height:34px; border-radius:10px; border:0; background:var(--surface-2); color:var(--ink-2); display:grid; place-items:center; cursor:pointer; font-size:16px; transition:.15s}
.modal-x:hover{background:#FEE2E2; color:#DC2626}

/* payment */
.pay-ic{width:52px; height:52px; border-radius:16px; background:var(--blue-50); color:var(--blue); display:grid; place-items:center; margin-bottom:14px}
.modal-panel h3{font-size:20px; margin-bottom:6px}
.pay-sub{font-size:14px; color:var(--muted); margin-bottom:16px; line-height:1.55}
.pay-box{background:var(--surface-2); border:1px solid var(--line-soft); border-radius:var(--r); padding:16px; margin-bottom:16px}
.pay-name{font-weight:700; color:var(--ink); margin-bottom:10px; font-size:15px}
.pay-row{display:flex; justify-content:space-between; align-items:center; padding:6px 0; font-size:14px; color:var(--ink-2)}
.pay-row b{color:var(--ink)}
.pay-row.big{font-size:16px}
.pay-row.big b{color:var(--orange); font-size:20px; font-weight:800; font-family:"Space Grotesk",sans-serif}
.pay-row.muted span{color:var(--muted); font-size:13px}
.pay-div{height:1px; background:var(--line-soft); margin:8px 0}
.pay-actions{display:grid; grid-template-columns:1fr 1fr; gap:10px}

/* success */
.success-panel{max-width:420px; text-align:center; padding-top:22px}
.succ-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:2px}
.succ-code{font-family:"Space Grotesk",sans-serif; font-weight:700; color:var(--blue); font-size:15px}
.succ-badge{display:inline-flex; align-items:center; gap:5px; padding:4px 12px; border-radius:999px; background:#DCFCE7; color:#15803D; font-size:12px; font-weight:700}
.succ-badge svg{font-size:12px}
.succ-time{font-size:12px; color:var(--muted); text-align:left; margin-bottom:14px}
.succ-thumb{width:70px; height:70px; margin:6px auto 10px; border-radius:14px; overflow:hidden; background:var(--surface-2); border:1px solid var(--line-soft)}
.succ-thumb img{width:100%; height:100%; object-fit:cover}
.succ-cat{font-size:11px; letter-spacing:.14em; font-weight:800; color:var(--indigo); margin-bottom:4px}
.succ-name{font-weight:700; color:var(--ink); font-size:16px; margin-bottom:8px; padding:0 12px}
.succ-qty{font-size:13.5px; color:var(--muted); margin-bottom:14px}
.succ-qty b{color:var(--ink)}
.succ-total-lbl{font-size:13px; color:var(--muted); margin-bottom:4px}
.succ-total{font-family:"Space Grotesk",sans-serif; color:var(--orange); font-weight:800; font-size:28px; margin-bottom:18px}
.succ-info{text-align:left; background:var(--surface-2); border-radius:var(--r); padding:12px; margin-bottom:18px; border:1px solid var(--line-soft)}
.si-head{font-size:11px; letter-spacing:.08em; color:var(--indigo); font-weight:800; display:flex; align-items:center; gap:6px; margin-bottom:8px}
.si-code{position:relative; background:#0F172A; color:#7DD3FC; border-radius:12px; padding:12px 44px 12px 14px; font-family:"JetBrains Mono", ui-monospace, monospace; font-size:13.5px; line-height:1.6}
.si-code pre{margin:0; white-space:pre-wrap; word-break:break-all}
.si-copy{position:absolute; top:8px; right:8px; width:30px; height:30px; border-radius:8px; background:rgba(255,255,255,.08); color:#fff; border:0; cursor:pointer; display:grid; place-items:center; transition:.15s}
.si-copy:hover{background:var(--blue)}

/* toast */
.toast{position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:var(--ink); color:#fff; padding:10px 18px; border-radius:999px; font-size:13.5px; z-index:99999; box-shadow:var(--shadow-lg); animation:tfade .2s}
@keyframes tfade{ from{opacity:0; transform:translate(-50%,10px)} to{opacity:1; transform:translate(-50%,0)} }
@media(max-width:991px){
  .pd-main {
        aspect-ratio: 3 / 2;
  }
}