/* Shopping — หน้าร้าน /shopping (ระบบ affiliate)
   หน้าตาใช้ component เดิมของ ZEEDTOPUP ทั้งหมด (account-shop-hero · home-kpi-grid/prem-kpi · shop-cat-tabs ·
   shop-grid/shop-card/shop-card-icon · card · btn btn-red/btn-outline · render_pagination)
   ไฟล์นี้มีแค่ layout/ระยะห่างของส่วนที่ component เดิมไม่มี — ห้ามเพิ่มสี/ธีมใหม่ ใช้ตัวแปรของ app.css เท่านั้น */

/* KPI 3 ช่อง (แบบเดียวกับ /shop) */
.aff-kpi{grid-template-columns:repeat(3,minmax(0,1fr));margin:14px 16px 18px;gap:12px}

/* กรอบเนื้อหา (ระยะขอบเท่าหน้า /shop) */
.aff-wrap{padding:0 16px 28px}
.aff-panel{padding:16px 18px;margin-bottom:14px;display:flex;flex-direction:column;gap:12px}
.aff-panel-title{font-size:1.05rem;margin:0}

/* แท็บ */
.aff-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;width:100%}
.aff-tabs::-webkit-scrollbar{display:none}
.aff-tab-empty{opacity:.5}
.aff-subcats{display:flex;flex-wrap:wrap;gap:8px}
.aff-subcat{display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border-radius:999px;border:1px solid var(--bd);background:var(--sf);color:var(--ts);font-size:.85rem;font-weight:600;text-decoration:none;transition:all .2s}
.aff-subcat b{font-size:.72rem;color:var(--tm)}
.aff-subcat:hover{color:var(--tx);border-color:var(--bh)}
.aff-subcat.active{color:#fff;background:rgba(227,24,55,.18);border-color:rgba(227,24,55,.32)}
.aff-subcat.active b{color:#fff}

/* ค้นหา */
.aff-filter{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch}
.aff-field-search{flex:1 1 260px;position:relative;margin:0}
.aff-field-search>i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--tm);pointer-events:none}
.aff-field-search .input{padding-left:40px}
.aff-field-sort{flex:0 1 200px;width:auto}
.aff-filter .btn{min-height:46px}
.aff-hint{font-size:13px;color:var(--tm)}
.aff-hint:empty{display:none}

/* แบรนด์ */
.aff-brands{display:flex;gap:10px;overflow-x:auto;scrollbar-width:none}
.aff-brands::-webkit-scrollbar{display:none}
.aff-brand{flex:none;display:flex;flex-direction:column;align-items:center;gap:6px;width:88px;padding:10px 4px;border:1px solid transparent;border-radius:12px;color:var(--tx);text-decoration:none;text-align:center;transition:all .2s}
.aff-brand:hover{background:rgba(255,255,255,.03);border-color:var(--bd)}
.aff-brand.active{background:rgba(227,24,55,.12);border-color:rgba(227,24,55,.32)}
.aff-brand-logo{display:grid;place-items:center;width:56px;height:56px;border-radius:14px;border:1px solid var(--bd);background:#fff;overflow:hidden}
.aff-brand-logo img{width:100%;height:100%;object-fit:contain;padding:6px}
.aff-brand-logo b{font-size:20px;font-weight:700;color:var(--r)}
.aff-brand-name{max-width:100%;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aff-brand small{font-size:11px;color:var(--tm)}

/* การ์ดสินค้า — ต่อยอด .shop-card ของเว็บ */
.aff-grid{padding:0}
.aff-card{display:flex;flex-direction:column;gap:10px}
.aff-card:hover{border-color:var(--bh)}
.aff-card-media{position:relative;display:grid;place-items:center;aspect-ratio:1/1;border-radius:12px;overflow:hidden;background:linear-gradient(135deg,rgba(225,29,72,.08),rgba(225,29,72,.02));border:1px solid rgba(255,255,255,.05)}
.aff-card-media img{width:100%;height:100%;object-fit:cover}
.aff-ph{display:grid;place-items:center;width:100%;height:100%;font-size:42px;color:rgba(225,29,72,.45)}
.aff-badge{position:absolute;top:10px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:600;color:#fff}
.aff-badge-red{right:10px;background:rgba(225,29,72,.9)}
.aff-badge-dark{left:10px;background:rgba(0,0,0,.55);border:1px solid rgba(255,255,255,.15)}
.aff-card-row{display:flex;align-items:flex-start;gap:10px;min-width:0}
.aff-card-store{width:40px;height:40px;font-size:19px;border-radius:10px}
.aff-card-info{flex:1;min-width:0}
.aff-card-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:15px;font-weight:600;line-height:1.4;color:var(--tx);text-decoration:none;word-break:break-word}
.aff-card-title:hover{color:var(--rl)}
.aff-card-meta{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:3px;font-size:12.5px;color:var(--tm)}
.aff-card-foot{display:flex;flex-direction:column;gap:10px;margin-top:auto;padding-top:8px;border-top:1px solid rgba(255,255,255,.04)}
.aff-price{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px}
.aff-price b{font-size:22px;font-weight:700;color:var(--r)}
.aff-price s{font-size:13px;color:var(--tm)}
.aff-noprice{font-size:13px;color:var(--tm)}
.aff-buyrow{display:flex;gap:6px}
.aff-buy{flex:1;min-width:0;justify-content:center}
.aff-buy span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aff-buy-mini{flex:none}

/* ว่าง (แบบเดียวกับ /shop) */
.aff-empty{padding:48px 24px;text-align:center;margin-bottom:14px}
.aff-empty-icon{width:84px;height:84px;margin:0 auto 16px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(135deg,rgba(225,29,72,.18),rgba(225,29,72,.05));border:1px solid rgba(225,29,72,.22)}
.aff-empty-icon i{font-size:34px;color:rgba(225,29,72,.82)}
.aff-empty-title{font-size:22px;font-weight:700;color:var(--tx);margin-bottom:8px}
.aff-empty-text{max-width:560px;margin:0 auto 18px;color:var(--tm);font-size:14px;line-height:1.7}
.aff-empty-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.aff-fine{display:flex;gap:7px;align-items:flex-start;margin:16px 0 0;font-size:12.5px;line-height:1.6;color:var(--tm)}

/* หน้ารายละเอียด (โครงเดียวกับ /shop/product) */
.aff-detail-wrap{max-width:1100px;margin:0 auto;padding:18px 16px 28px}
.aff-crumb{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:14px;font-size:14px;color:var(--tm)}
.aff-crumb a{color:var(--tm);text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.aff-crumb a:hover{color:var(--tx)}
.aff-preview-note{display:flex;gap:10px;align-items:flex-start;padding:12px 16px;margin-bottom:14px;border-color:rgba(245,158,11,.35);color:#fbbf24;font-size:14px;line-height:1.6}
.aff-preview-note a{color:var(--rl)}
.aff-detail-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:22px}
.aff-detail-col{display:flex;flex-direction:column;gap:14px;min-width:0}
.aff-detail-media{position:relative;padding:0;overflow:hidden;border-radius:18px;aspect-ratio:1/1;display:grid;place-items:center;background:linear-gradient(135deg,rgba(225,29,72,.1),rgba(225,29,72,.02))}
.aff-detail-media img{width:100%;height:100%;object-fit:cover}
.aff-detail-media .aff-ph{font-size:80px;color:rgba(225,29,72,.4)}
.aff-desc{padding:18px 20px;display:flex;flex-direction:column;gap:10px}
.aff-desc-body{color:var(--ts);font-size:15px;line-height:1.75;word-break:break-word}
.aff-buybox{padding:20px 22px;display:flex;flex-direction:column;gap:12px}
.aff-buybox .hero-pill{margin-bottom:0}
.aff-detail-title{font-size:1.5rem;font-weight:700;color:var(--tx);margin:0;line-height:1.3;word-break:break-word}
.aff-price-lg b{font-size:28px}
.aff-badge-inline{padding:3px 10px;border-radius:999px;background:rgba(225,29,72,.9);color:#fff;font-size:12px;font-weight:600}
.aff-brand-inline{display:inline-flex;align-items:center;gap:9px;align-self:flex-start;padding:6px 14px 6px 6px;border:1px solid var(--bd);border-radius:999px;background:var(--sf);color:var(--ts);text-decoration:none;font-size:13px}
.aff-brand-inline:hover{border-color:var(--bh);color:var(--tx)}
.aff-brand-inline img{width:28px;height:28px;border-radius:50%;object-fit:contain;background:#fff}
.aff-storeline{display:flex;flex-wrap:wrap;gap:8px}
.aff-storerow{flex:1 1 240px;min-width:0;display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--bd);border-radius:14px;background:var(--sf);color:var(--tx);text-decoration:none;transition:all .2s}
.aff-storerow:hover{border-color:var(--bh);transform:translateY(-1px)}
.aff-storerow.primary{background:linear-gradient(135deg,var(--r),#b3122c);border-color:var(--r);color:#fff;box-shadow:0 10px 24px rgba(227,24,55,.25)}
.aff-storerow.primary .aff-storeicon{background:rgba(255,255,255,.16);color:#fff}
.aff-storerow.primary small{color:rgba(255,255,255,.8)}
.aff-storerow.dead{opacity:.5}
.aff-storeicon{width:40px;height:40px;font-size:19px;border-radius:10px}
.aff-storetxt{flex:1;min-width:0;display:flex;flex-direction:column}
.aff-storetxt b{font-size:15px;font-weight:700}
.aff-storetxt small{font-size:12px;color:var(--tm)}
.aff-storeprice{font-weight:700;white-space:nowrap}
.aff-copy{flex:0 0 auto;min-height:44px}
.aff-copy.done{border-color:rgba(34,197,94,.45);color:#22c55e}
.aff-related{margin-top:26px;display:flex;flex-direction:column;gap:14px}

@media(max-width:900px){
  .aff-detail-grid{grid-template-columns:1fr}
}
@media(max-width:768px){
  .aff-kpi{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 12px 14px}
  .aff-wrap{padding:0 12px 24px}
  .aff-panel{padding:14px}
  .aff-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .aff-card{padding:11px}
  .aff-card-store{display:none}
  .aff-card-title{font-size:14px}
  .aff-price b{font-size:18px}
  .aff-buy-mini{display:none}
  .aff-field-sort{flex:1 1 100%}
  .aff-filter .btn{flex:1 1 100%}
  .aff-field-search .input,.aff-field-sort{font-size:16px}
  .aff-buy,.aff-copy{min-height:44px}
}
@media(max-width:380px){
  .aff-grid{grid-template-columns:1fr}
}

/* หมวดหลัก: หลายบรรทัด (ไม่ลากยาว) · เกิน 8 หมวดพับเก็บ */
.aff-cats{display:flex;flex-wrap:wrap;gap:8px}
.aff-cat{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:0 14px;border-radius:12px;border:1px solid var(--bd);background:var(--sf);color:var(--ts);font:inherit;font-size:.86rem;font-weight:600;text-decoration:none;white-space:nowrap;cursor:pointer;transition:all .2s}
.aff-cat i{color:var(--tm)}
.aff-cat b{min-width:20px;padding:0 6px;border-radius:999px;background:rgba(255,255,255,.07);font-size:.7rem;line-height:18px;text-align:center;color:var(--ts)}
.aff-cat:hover{color:var(--tx);border-color:var(--bh)}
.aff-cat.is-active{color:#fff;background:rgba(227,24,55,.18);border-color:rgba(227,24,55,.35)}
.aff-cat.is-active i{color:#ff5c75}
.aff-cat.is-active b{background:rgba(227,24,55,.35);color:#fff}
.aff-cat.is-extra{display:none}
.aff-cats.is-open .aff-cat.is-extra{display:inline-flex}
.aff-cat--more{border-style:dashed;color:var(--tm)}
.aff-cats.is-open .aff-cat--more i{transform:rotate(180deg)}
@media(max-width:768px){.aff-cats{gap:6px}.aff-cat{min-height:40px;padding:0 12px;font-size:.82rem}}
