*{box-sizing:border-box}
:root{
  --bg:#f6f6f4;
  --card:#fff;
  --text:#111;
  --muted:#777;
  --line:#d7d7d2;
  --good:#147a3f;
  --bad:#a32626;
  --gold:#9a792d;
}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
  color:var(--text);
  background:var(--bg);
}
.site-header{
  background:#111;
  color:#fff;
  border-bottom:1px solid #2c2c2c;
}
.header-inner{
  max-width:1440px;
  margin:auto;
  padding:30px 32px;
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:24px;
}
.eyebrow{
  margin:0 0 6px;
  font-size:12px;
  letter-spacing:.22em;
  color:#c7b26b;
}
h1{margin:0;font-size:34px;letter-spacing:.04em}
.subtitle{margin:8px 0 0;color:#bbb}
.updated-box{text-align:right;color:#aaa;font-size:12px}
.updated-box strong{display:block;margin-top:5px;color:#fff;font-size:16px}
main{max-width:1440px;margin:auto;padding:24px 28px 50px}
.toolbar{
  background:#fff;
  border:1px solid var(--line);
  padding:18px;
  margin-bottom:18px;
}
.stats{display:flex;gap:28px;flex-wrap:wrap;margin-bottom:16px}
.stat{min-width:120px}
.stat span{display:block;color:var(--muted);font-size:12px}
.stat strong{font-size:22px}
.controls{display:grid;grid-template-columns:1fr 220px 220px;gap:10px}
input,select{
  width:100%;
  padding:12px 14px;
  border:1px solid #cfcfc9;
  background:#fff;
  font-size:14px;
  border-radius:4px;
}
.product-list{
  background:#fff;
  border-top:1px solid #bbb;
}
.product-card{
  position:relative;
  display:grid;
  grid-template-columns:300px minmax(370px,1fr) 390px;
  min-height:315px;
  border-bottom:1px solid #bbb;
  background:#fff;
}
.rank{
  position:absolute;
  top:16px;
  left:16px;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:50%;
  background:#111;
  color:#fff;
  font-weight:700;
}
.product-image{
  min-height:315px;
  padding:22px 24px 20px 30px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.product-image img{
  width:100%;
  max-width:235px;
  height:235px;
  object-fit:contain;
}
.no-image{
  width:210px;
  height:210px;
  background:#f3f3f1;
  border:1px solid #ddd;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#999;
  font-size:13px;
}
.product-info{
  padding:34px 28px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.info-row{
  display:grid;
  grid-template-columns:145px 1fr;
  gap:12px;
  margin:7px 0;
  font-size:20px;
  line-height:1.45;
}
.info-row .label{font-weight:700}
.info-row .value{font-weight:650}
.price-panel{
  border-left:1px solid #e0e0dc;
  padding:30px 34px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.price-row{
  display:grid;
  grid-template-columns:145px 1fr;
  align-items:baseline;
  gap:12px;
  padding:8px 0;
}
.price-label{color:#555;font-size:14px}
.price-value{text-align:right;font-size:20px;font-weight:700}
.price-row.main .price-value{font-size:27px}
.price-row.best{
  margin-top:7px;
  padding-top:15px;
  border-top:1px solid #deded8;
}
.price-row.best .price-value{color:var(--gold)}
.profit-box{
  margin-top:12px;
  display:flex;
  justify-content:space-between;
  align-items:end;
  padding:14px 0 0;
  border-top:1px solid #deded8;
}
.profit-label{font-size:13px;color:#666}
.profit{
  font-size:30px;
  font-weight:800;
}
.profit.positive{color:var(--good)}
.profit.negative{color:var(--bad)}
.profit-rate{text-align:right;color:#666;font-size:13px;margin-top:2px}
.store-links{
  display:flex;
  gap:8px;
  margin-top:14px;
}
.store-links a{
  text-decoration:none;
  color:#111;
  border:1px solid #bbb;
  padding:7px 10px;
  border-radius:3px;
  font-size:12px;
}
.store-links a:hover{background:#f2f2ef}
.badge{
  display:inline-block;
  margin-left:8px;
  padding:3px 7px;
  border-radius:999px;
  font-size:11px;
  background:#efe8d4;
  color:#725817;
  vertical-align:middle;
}
.empty{
  text-align:center;
  padding:70px 20px;
  background:#fff;
  color:#777;
}
footer{
  color:#888;
  text-align:center;
  font-size:12px;
  padding:28px;
}
@media(max-width:1000px){
  .product-card{grid-template-columns:220px 1fr}
  .price-panel{grid-column:1/-1;border-left:0;border-top:1px solid #eee}
  .product-image{min-height:220px}
  .product-image img{height:190px;max-width:190px}
  .info-row{font-size:17px}
}
@media(max-width:680px){
  .header-inner{padding:22px 18px;display:block}
  .updated-box{text-align:left;margin-top:15px}
  h1{font-size:26px}
  main{padding:14px 10px 35px}
  .controls{grid-template-columns:1fr}
  .product-card{display:block}
  .rank{top:10px;left:10px;width:36px;height:36px}
  .product-image{min-height:210px;padding:20px}
  .product-image img{height:190px}
  .product-info{padding:18px 18px 22px}
  .info-row{grid-template-columns:90px 1fr;font-size:15px;margin:5px 0}
  .price-panel{padding:20px 18px}
  .price-row{grid-template-columns:115px 1fr}
  .price-row.main .price-value{font-size:22px}
  .profit{font-size:26px}
}


/* =========================================================
   v6: iPhone / mobile optimized layout
   ========================================================= */

.product-card{
  grid-template-columns:280px minmax(360px,1fr) 390px;
  min-height:300px;
}

.product-image-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
}

.product-main{
  display:flex;
  align-items:center;
}

.price-label small{
  display:inline-block;
  margin-left:5px;
  color:#999;
  font-size:10px;
  font-weight:500;
}

.best-box{
  margin-top:10px;
  padding:15px 0;
  border-top:1px solid #deded8;
  border-bottom:1px solid #deded8;
}

.best-label{
  font-size:13px;
  color:#666;
  margin-bottom:4px;
}

.best-price{
  font-size:29px;
  font-weight:800;
  color:var(--gold);
  line-height:1.15;
}

.best-store{
  display:inline-block;
  margin-top:7px;
  padding:4px 10px;
  border-radius:999px;
  background:#efe8d4;
  color:#725817;
  font-size:12px;
  font-weight:700;
}

/* Tablet */
@media(max-width:1000px){
  .product-card{
    grid-template-columns:220px 1fr;
  }
  .product-image-wrap{
    align-items:flex-start;
  }
  .product-main{
    align-items:flex-start;
  }
  .price-panel{
    grid-column:1/-1;
  }
}

/* iPhone / narrow mobile */
@media(max-width:680px){
  body{
    background:#f3f3f1;
  }

  .site-header{
    position:sticky;
    top:0;
    z-index:20;
  }

  .header-inner{
    padding:14px 14px 12px;
  }

  .eyebrow{
    font-size:9px;
    letter-spacing:.16em;
    margin-bottom:4px;
  }

  h1{
    font-size:20px;
    letter-spacing:.02em;
  }

  .subtitle{
    font-size:11px;
    margin-top:4px;
  }

  .updated-box{
    margin-top:8px;
    font-size:10px;
  }

  .updated-box strong{
    font-size:12px;
    margin-top:2px;
  }

  main{
    padding:8px 0 28px;
  }

  .toolbar{
    margin:0 8px 8px;
    padding:10px;
    border-radius:8px;
  }

  .stats{
    gap:8px;
    margin-bottom:10px;
    display:grid;
    grid-template-columns:repeat(3,1fr);
  }

  .stat{
    min-width:0;
    background:#f7f7f5;
    border-radius:7px;
    padding:8px;
  }

  .stat span{
    font-size:10px;
  }

  .stat strong{
    font-size:16px;
    line-height:1.25;
  }

  .controls{
    gap:7px;
  }

  input,select{
    padding:10px 11px;
    font-size:13px;
    border-radius:7px;
  }

  .product-list{
    border-top:0;
    background:transparent;
  }

  .product-card{
    display:block;
    margin:0 8px 10px;
    border:1px solid #d8d8d3;
    border-radius:10px;
    overflow:hidden;
    min-height:0;
    box-shadow:0 1px 2px rgba(0,0,0,.03);
  }

  .rank{
    top:9px;
    left:9px;
    width:34px;
    height:34px;
    font-size:14px;
    box-shadow:0 1px 3px rgba(0,0,0,.15);
  }

  .product-image-wrap{
    display:block;
  }

  .product-image{
    min-height:0;
    height:auto;
    padding:18px 18px 8px;
    background:#fff;
  }

  .product-image img{
    width:auto;
    max-width:88%;
    height:220px;
    object-fit:contain;
  }

  .no-image{
    width:190px;
    height:190px;
    margin:8px auto 4px;
  }

  .product-main{
    display:block;
  }

  .product-info{
    padding:8px 16px 14px;
    border-bottom:1px solid #e5e5e0;
  }

  .info-row{
    grid-template-columns:78px 1fr;
    gap:8px;
    margin:5px 0;
    font-size:14px;
    line-height:1.45;
  }

  .info-row .label{
    color:#333;
    font-size:12px;
    font-weight:700;
  }

  .info-row .value{
    font-size:15px;
    font-weight:700;
  }

  .price-panel{
    padding:12px 16px 16px;
    border:0;
    background:#fff;
  }

  .price-grid{
    display:block;
  }

  .price-row{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    padding:7px 0;
    border-bottom:1px solid #f0f0ed;
  }

  .price-row:last-child{
    border-bottom:0;
  }

  .price-label{
    font-size:12px;
    color:#555;
  }

  .price-label small{
    display:block;
    margin-left:0;
    margin-top:1px;
    font-size:9px;
  }

  .price-value{
    font-size:18px;
    line-height:1.2;
  }

  .price-row.main .price-value{
    font-size:19px;
  }

  .best-box{
    margin-top:8px;
    padding:11px 0 10px;
  }

  .best-label{
    font-size:11px;
  }

  .best-price{
    font-size:24px;
  }

  .best-store{
    font-size:10px;
    padding:3px 8px;
  }

  .profit-box{
    margin-top:10px;
    padding-top:11px;
  }

  .profit-label{
    font-size:11px;
  }

  .profit{
    font-size:24px;
    line-height:1.15;
  }

  .profit-rate{
    font-size:11px;
  }

  .store-links{
    margin-top:11px;
    gap:6px;
  }

  .store-links a{
    flex:1;
    text-align:center;
    padding:9px 8px;
    font-size:11px;
    border-radius:6px;
  }

  footer{
    font-size:10px;
    padding:20px 14px;
  }
}

/* very small iPhone widths */
@media(max-width:390px){
  .product-image img{
    height:200px;
  }

  .info-row{
    grid-template-columns:70px 1fr;
  }

  .best-price{
    font-size:22px;
  }

  .profit{
    font-size:22px;
  }
}
