:root{
  --ink:#121826; --ink-2:#1B2338; --gold:#E3B23C; --gold-dim:#B98F2C;
  --teal:#4FD1C5; --paper:#FFFFFF; --line:#E4E1D8; --text-dim:#6b6353;
  --bg:#F3F1EC;
  --shadow-sm: 0 2px 8px rgba(18,24,38,0.06);
  --shadow-md: 0 8px 24px rgba(18,24,38,0.10);
  --shadow-lg: 0 16px 40px rgba(18,24,38,0.16);
}
*{box-sizing:border-box;}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink);line-height:1.5;}
a{color:inherit;text-decoration:none;}
.wrap{max-width:1100px;margin:0 auto;padding:0 20px;}

header.site{background:var(--ink);color:#fff;padding:16px 0;}
header.site .wrap{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;}
header.site .logo{font-family:Georgia,serif;font-size:1.4rem;font-weight:700;}
header.site .logo span{color:var(--gold);}
header.site nav a{margin-left:18px;font-size:0.92rem;opacity:0.9;transition:opacity 0.15s ease;}
header.site nav a:hover{opacity:1;color:var(--gold);}

.nav-toggle{display:none;flex-direction:column;justify-content:center;gap:5px;width:32px;height:32px;background:none;border:none;cursor:pointer;padding:0;}
.nav-toggle span{display:block;width:24px;height:2.5px;background:#fff;border-radius:2px;transition:.25s;}
.nav-toggle.active span:nth-child(1){transform:translateY(7.5px) rotate(45deg);}
.nav-toggle.active span:nth-child(2){opacity:0;}
.nav-toggle.active span:nth-child(3){transform:translateY(-7.5px) rotate(-45deg);}

@media (max-width: 640px){
  header.site .wrap{flex-wrap:nowrap;}
  .nav-toggle{display:flex;}
  header.site nav{
    display:none;width:100%;flex-basis:100%;order:3;
    flex-direction:column;padding-top:14px;
  }
  header.site nav.open{display:flex;}
  header.site nav a{margin-left:0;padding:12px 4px;border-top:1px solid rgba(255,255,255,0.1);}
}

.btn{
  display:inline-block;padding:11px 20px;border-radius:6px;border:none;cursor:pointer;
  font-size:0.92rem;font-weight:600;transition:transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn-primary{background:var(--ink);color:#fff;}
.btn-primary:hover{background:var(--ink-2);box-shadow:var(--shadow-sm);}
.btn-gold{background:var(--gold);color:var(--ink);}
.btn-gold:hover{background:#EFC15C;box-shadow:0 6px 18px rgba(227,178,60,0.35);transform:translateY(-1px);}
.btn-outline{background:transparent;border:1px solid var(--line);color:var(--ink);}
.btn-outline:hover{border-color:var(--ink);}

.container{padding:36px 0;}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:22px;}

.card{
  background:var(--paper);border:1px solid var(--line);border-radius:10px;overflow:hidden;
  box-shadow:var(--shadow-sm);transition:transform 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover{transform:translateY(-4px);box-shadow:var(--shadow-md);border-color:transparent;}

.card .img{height:150px;background:#eee;display:flex;align-items:center;justify-content:center;color:#aaa;font-size:0.85rem;}
.card .body{padding:16px;}
.card h3{margin:0 0 4px;font-size:1rem;}
.card .grade{font-size:0.75rem;color:var(--text-dim);margin-bottom:8px;}
.card .price{font-family:Georgia,serif;color:var(--gold-dim);font-size:1.3rem;font-weight:700;}

.form-box{max-width:460px;margin:40px auto;background:var(--paper);padding:32px;border-radius:12px;border:1px solid var(--line);box-shadow:var(--shadow-sm);}
.form-box h2{font-family:Georgia,serif;margin-top:0;}
.field{margin-bottom:16px;}
.field label{display:block;font-size:0.85rem;color:var(--text-dim);margin-bottom:6px;}
.field input, .field select, .field textarea{
  width:100%;padding:11px;border:1px solid var(--line);border-radius:6px;font-size:0.92rem;font-family:inherit;
  transition:border-color 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus{
  outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(227,178,60,0.15);
}

.alert{padding:12px 16px;border-radius:8px;margin-bottom:16px;font-size:0.88rem;}
.alert-error{background:#FBE7E5;color:#9B3A31;}
.alert-success{background:#E3F5EE;color:#1F7A5C;}

table.admin-table{width:100%;border-collapse:collapse;background:#fff;border-radius:8px;overflow:hidden;box-shadow:var(--shadow-sm);}
table.admin-table th, table.admin-table td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;font-size:0.88rem;}
table.admin-table th{background:var(--ink);color:#fff;}

.status-pill{padding:3px 10px;border-radius:12px;font-size:0.75rem;font-weight:600;}
.status-pending{background:#FFF3CD;color:#856404;}
.status-paid,.status-confirmed{background:#D4EDDA;color:#155724;}
.status-shipped{background:#D1ECF1;color:#0C5460;}
.status-delivered{background:#C6E8C0;color:#1F7A5C;}
.status-cancelled,.status-rejected{background:#F8D7DA;color:#721C24;}

footer.site{padding:30px 0;color:var(--text-dim);font-size:0.85rem;border-top:1px solid var(--line);margin-top:40px;}

.cart-row{display:flex;justify-content:space-between;align-items:center;padding:14px 0;border-bottom:1px solid var(--line);}

.trust-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:28px;}
.trust-item{padding:4px 0;}
.trust-item .icon-wrap{
  width:44px;height:44px;border-radius:10px;background:var(--ink);
  display:flex;align-items:center;justify-content:center;margin-bottom:14px;
}
.trust-item h4{margin:0 0 6px;font-size:1.02rem;font-weight:600;}
.trust-item p{margin:0;color:var(--text-dim);font-size:0.9rem;line-height:1.55;}

.admin-sidebar{width:200px;background:var(--ink);color:#fff;min-height:100vh;padding:20px 0;position:fixed;}
.admin-sidebar a{display:block;padding:12px 20px;color:#ccc;font-size:0.9rem;transition:background 0.12s ease;}
.admin-sidebar a:hover, .admin-sidebar a.active{background:var(--ink-2);color:#fff;}
.admin-content{margin-left:220px;padding:30px;}

/* ===== Product page: image left, details right, at every screen width ===== */
.product-layout{display:flex;align-items:flex-start;}
.product-media{flex:0 0 42%;max-width:42%;}
.product-details{flex:1 1 auto;padding:24px;min-width:0;}

@media (max-width: 640px){
  .product-media{flex:0 0 40%;max-width:40%;}
  .product-details{padding:12px;}
  .product-details h1{font-size:1.05rem;margin-bottom:2px;}
  .product-details .price{font-size:1.3rem;margin:8px 0;}
  .product-details p{font-size:0.8rem;}
  .product-details label{font-size:0.72rem;}
  .product-details ul{font-size:0.82rem;padding-left:16px;}
  .product-details ul li{margin-bottom:4px;}
  .product-details a[href^="product.php"]{padding:5px 10px !important;font-size:0.75rem !important;}
  .product-details .btn{padding:9px 16px;font-size:0.85rem;}
}

/* ===== Sell Your Phone: step-by-step wizard ===== */
.sell-wizard{max-width:640px;margin:40px auto;padding:0 20px;}
.sell-progress{display:flex;gap:6px;margin-bottom:28px;}
.sell-progress-step{flex:1;height:6px;border-radius:3px;background:var(--line);transition:background .2s;}
.sell-progress-step.done{background:var(--gold);}
.sell-step{display:none;background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:28px;box-shadow:var(--shadow-sm);}
.sell-step.active{display:block;}
.sell-step h3{font-family:Georgia,serif;margin-top:0;}
.sell-step .step-sub{color:var(--text-dim);font-size:0.9rem;margin-top:-8px;margin-bottom:20px;}
.sell-option-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;margin-bottom:8px;}
.sell-option-card{border:1.5px solid var(--line);border-radius:10px;padding:16px 10px;text-align:center;cursor:pointer;font-weight:600;transition:.15s;background:var(--paper);}
.sell-option-card:hover{border-color:var(--gold);}
.sell-option-card.selected{border-color:var(--gold);background:#FFF8E8;color:var(--gold-dim);}
.sell-condition-list{display:flex;flex-direction:column;gap:10px;margin-bottom:8px;}
.sell-condition-card{border:1.5px solid var(--line);border-radius:10px;padding:14px 16px;cursor:pointer;transition:.15s;}
.sell-condition-card:hover{border-color:var(--gold);}
.sell-condition-card.selected{border-color:var(--gold);background:#FFF8E8;}
.sell-condition-card .cc-title{font-weight:600;}
.sell-nav{display:flex;justify-content:space-between;margin-top:24px;gap:12px;}
.sell-nav button{flex:1;}
.sell-estimate-box{text-align:center;background:var(--ink);color:#fff;border-radius:14px;padding:28px;margin-bottom:24px;}
.sell-estimate-box .se-label{color:var(--teal);font-size:0.85rem;text-transform:uppercase;letter-spacing:1px;margin-bottom:6px;}
.sell-estimate-box .se-amount{font-size:2.6rem;font-weight:700;color:var(--gold);font-family:Georgia,serif;}
.sell-loading{text-align:center;color:var(--text-dim);padding:20px;}

/* ===== Sell page: hero with illustration + boxed brand cards ===== */
.sell-hero{background:var(--ink);color:#fff;overflow:hidden;}
.sell-hero-inner{display:flex;align-items:center;flex-wrap:nowrap;gap:16px;padding:0;max-width:1200px;margin:0 auto;}
.sell-hero-left{flex:1.15;min-width:0;padding:24px 12px 24px 16px;}
.sell-hero-right{flex:0.85;min-width:0;max-width:460px;padding:12px;}
.sell-hero h1{font-family:Georgia,serif;font-weight:700;font-size:2.5rem;line-height:1.15;margin:0 0 8px;}
.sell-hero .sell-hero-sub{color:var(--teal);font-size:1.05rem;margin:0 0 30px;}
.sell-hero label.sh-label{display:block;font-weight:700;margin-bottom:12px;font-size:1.05rem;}
.sell-hero input#brandSearch{width:100%;padding:13px 16px;border:none;border-radius:8px;font-size:0.95rem;margin-bottom:20px;background:#fff;color:var(--ink);}

.sell-brand-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;}
.sell-brand-card{
  background:var(--ink-2);border:1px solid rgba(255,255,255,0.08);border-radius:10px;
  padding:14px 10px;text-align:center;cursor:pointer;transition:.15s;
}
.sell-brand-card:hover{border-color:var(--gold);transform:translateY(-2px);}
.sell-brand-card .sb-icon{
  width:38px;height:38px;margin:0 auto 8px;border-radius:50%;background:rgba(227,178,60,0.12);
  display:flex;align-items:center;justify-content:center;
}
.sell-brand-card .sb-icon svg{width:20px;height:20px;}
.sell-brand-card .sb-name{font-size:0.85rem;font-weight:600;color:#fff;}

@media (max-width: 780px){
  .sell-hero h1{font-size:1.3rem;}
  .sell-hero .sell-hero-sub{font-size:0.8rem;margin-bottom:16px;}
  .sell-hero label.sh-label{font-size:0.8rem;margin-bottom:8px;}
  .sell-hero input#brandSearch{padding:9px 10px;font-size:0.8rem;margin-bottom:12px;}
  .sell-brand-grid{gap:6px;}
  .sell-brand-card{padding:8px 4px;}
  .sell-brand-card .sb-icon{width:26px;height:26px;margin-bottom:4px;}
  .sell-brand-card .sb-icon svg{width:14px;height:14px;}
  .sell-brand-card .sb-name{font-size:0.65rem;}
}

/* ===== Sell page: compact model-selection cards ===== */
.sell-model-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:14px;}
.sell-model-card{
  background:var(--paper);border:1px solid var(--line);border-radius:10px;overflow:hidden;cursor:pointer;
  box-shadow:var(--shadow-sm);transition:transform 0.15s ease, box-shadow 0.15s ease;
}
.sell-model-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);}
.sell-model-card .smc-img{
  aspect-ratio:1/1;background:#F3F1EC;display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.sell-model-card .smc-img img{width:100%;height:100%;object-fit:contain;}
.sell-model-card .smc-icon-bg{background:var(--ink);display:flex;align-items:center;justify-content:center;}
.sell-model-card .smc-icon-bg svg{width:30px;height:30px;}
.sell-model-card .smc-name{padding:10px 8px;text-align:center;font-size:0.85rem;font-weight:600;}

@media (max-width: 640px){
  .sell-model-grid{grid-template-columns:repeat(3,1fr);gap:10px;}
  .sell-model-card .smc-name{font-size:0.75rem;padding:8px 4px;}
}

/* ===== Sell page: variant (storage) selection pills ===== */
.sell-variant-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:12px;}
.sell-variant-card{
  background:var(--paper);border:1.5px solid var(--line);border-radius:10px;padding:18px 10px;
  text-align:center;font-weight:700;font-size:1rem;cursor:pointer;transition:.15s;
}
.sell-variant-card:hover{border-color:var(--gold);}
.sell-variant-card.selected{border-color:var(--gold);background:#FFF8E8;color:var(--gold-dim);}

@media (max-width: 640px){
  .sell-variant-grid{grid-template-columns:repeat(3,1fr);gap:10px;}
}

/* ===== Mobile: compact 2-column product grid, like Cashify's app ===== */
@media (max-width: 640px){
  .wrap{padding:0 14px;}
  .grid{grid-template-columns:repeat(2, 1fr);gap:12px;}
  .card .img{height:130px;}
  .card .body{padding:10px;}
  .card h3{font-size:0.85rem;line-height:1.3;margin:0 0 3px;}
  .card .grade{font-size:0.68rem;margin-bottom:5px;}
  .card .price{font-size:1.05rem;}
  a.card:hover{transform:none;}  /* hover lift doesn't apply on touch anyway, skip to avoid jank */
}
