.osg-products,.osg-product-detail-wrap{max-width:1120px;margin:0 auto;padding:32px 16px}.osg-products{--osg-card-min-width:180px;--osg-card-gap:16px;--osg-list-image-height:150px}.osg-product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--osg-card-min-width),1fr));gap:var(--osg-card-gap);align-items:stretch}.osg-card{background:#fff;border:1px solid #e1e1e1;border-radius:14px;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,.05);display:flex;flex-direction:column}.osg-card-image{display:grid;place-items:center;min-height:var(--osg-list-image-height);background:#f7f7f7}.osg-card-image img{width:100%;height:var(--osg-list-image-height);object-fit:cover}.osg-card-body{padding:14px;display:flex;flex-direction:column;gap:6px;flex:1}.osg-card-body h3{font-size:1.05rem;line-height:1.35;margin:.2em 0}.osg-card-body p{margin:.2em 0}.osg-card-body .osg-button{margin-top:auto;align-self:flex-start}.osg-code{font-size:13px;color:#555;font-weight:bold}.osg-price{font-weight:bold}.osg-stock{display:inline-block;padding:4px 10px;border-radius:999px;background:#eef6ea}.osg-stock-sold,.osg-stock-out_of_stock{background:#eee;color:#555}.osg-stock-negotiating{background:#fff8e6}.osg-button{display:inline-block;background:#5c9f45;color:#fff!important;text-decoration:none;padding:10px 16px;border-radius:999px}.osg-notice{margin-top:20px;padding:16px;background:#fff8e6;border-left:6px solid #d8a927}.osg-product-detail{background:#fff}.osg-detail-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(280px,1fr);gap:32px}.osg-main-image img{max-width:100%;height:auto;border-radius:12px}.osg-thumbs{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.osg-thumb{border:1px solid #ddd;background:#fff;padding:4px;cursor:pointer}.osg-thumb img{width:72px;height:72px;object-fit:cover}.osg-specs table{width:100%;border-collapse:collapse}.osg-specs th,.osg-specs td{border:1px solid #ddd;padding:10px}.osg-specs th{width:30%;background:#f4f7f4;text-align:left}@media(max-width:720px){.osg-detail-grid{grid-template-columns:1fr}}

/* v1.2.0 product detail gallery */
.osg-gallery{display:grid;grid-template-columns:92px minmax(0,1fr);gap:16px;align-items:start}.osg-main-image{order:2;background:#fafafa;border:1px solid #e5e5e5;border-radius:14px;padding:12px;display:grid;place-items:center;min-height:360px}.osg-main-image img{max-width:100%;max-height:560px;object-fit:cover}.osg-thumbs{order:1;display:flex;flex-direction:column;gap:10px;margin-top:0}.osg-thumb{width:82px;height:82px;border:1px solid #ddd;background:#fff;padding:4px;border-radius:10px;cursor:pointer}.osg-thumb.is-active{border:2px solid #5c9f45}.osg-thumb img{width:100%;height:100%;object-fit:cover;border-radius:7px}@media(max-width:720px){.osg-gallery{grid-template-columns:1fr}.osg-main-image{order:1;min-height:240px}.osg-thumbs{order:2;flex-direction:row;overflow-x:auto}.osg-thumb{flex:0 0 auto}}


/* v1.0.1: single image detail layout fix */
.osg-gallery.osg-gallery-single{display:block;width:100%;}
.osg-gallery.osg-gallery-single .osg-main-image{order:initial;min-height:360px;width:100%;box-sizing:border-box;}
.osg-gallery.osg-gallery-single .osg-main-image img{display:block;width:100%;max-width:720px;max-height:620px;height:auto;object-fit:cover;margin:0 auto;}
@media(max-width:720px){.osg-gallery.osg-gallery-single .osg-main-image{min-height:240px}.osg-gallery.osg-gallery-single .osg-main-image img{max-height:480px}}


/* v1.0.3: responsive product list */
@media(max-width:720px){.osg-products{padding:20px 12px}.osg-product-grid{display:block}.osg-card{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;margin-bottom:14px;border-radius:12px}.osg-card-image{min-height:112px;height:112px}.osg-card-image img{height:112px}.osg-card-body{padding:12px 12px 12px 0;gap:4px}.osg-card-body h3{font-size:1rem;margin:0}.osg-card-body p{font-size:.9rem}.osg-card-body .osg-button{padding:7px 12px;font-size:.9rem}.osg-code{font-size:12px}}


/* v1.0.5: horizontal stock list layout */
.osg-product-list{display:flex;flex-direction:column;gap:var(--osg-card-gap);}
.osg-list-row{display:grid;grid-template-columns:minmax(50px,var(--osg-card-min-width)) minmax(220px,1fr) minmax(170px,auto) auto;gap:16px;align-items:center;background:#fff;border:1px solid #e1e1e1;border-radius:14px;padding:12px;box-shadow:0 4px 14px rgba(0,0,0,.05);}
.osg-list-image{display:grid;place-items:center;width:100%;height:var(--osg-list-image-height);min-height:64px;background:#f7f7f7;border-radius:10px;overflow:hidden;text-decoration:none;}
.osg-list-image img{display:block;width:100%;height:100%;object-fit:cover;}
.osg-no-image{font-size:12px;color:#777;}
.osg-list-info{min-width:0;}
.osg-list-info h3{font-size:1.05rem;line-height:1.35;margin:.2em 0;}
.osg-list-info h3 a{text-decoration:none;}
.osg-list-summary{margin:.35em 0 0;color:#555;font-size:.92rem;line-height:1.55;}
.osg-list-meta{min-width:170px;}
.osg-list-meta p{margin:.25em 0;}
.osg-list-action{text-align:right;white-space:nowrap;}
.osg-list-action .osg-button{padding:9px 16px;}

@media(max-width:900px){.osg-list-row{grid-template-columns:minmax(90px,130px) minmax(0,1fr);grid-template-areas:'image info' 'image meta' 'image action';align-items:start}.osg-list-image{grid-area:image;height:120px}.osg-list-info{grid-area:info}.osg-list-meta{grid-area:meta;min-width:0}.osg-list-action{grid-area:action;text-align:left}}
@media(max-width:720px){.osg-products{padding:20px 12px}.osg-product-list{gap:12px}.osg-list-row{grid-template-columns:96px minmax(0,1fr);gap:12px;padding:10px;border-radius:12px}.osg-list-image{height:96px}.osg-list-info h3{font-size:1rem;margin:0}.osg-list-summary{display:none}.osg-list-meta{font-size:.9rem}.osg-list-action .osg-button{padding:7px 12px;font-size:.9rem}.osg-code{font-size:12px}}


/* v1.0.6: image stretch-to-frame while keeping aspect ratio */
.osg-card-image img,
.osg-list-image img,
.osg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.osg-main-image {
  overflow: hidden;
}
.osg-main-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}
.osg-gallery:not(.osg-gallery-single) .osg-main-image {
  height: 420px;
}
.osg-gallery.osg-gallery-single .osg-main-image {
  height: 420px;
}
.osg-gallery.osg-gallery-single .osg-main-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}
@media(max-width:720px){
  .osg-gallery:not(.osg-gallery-single) .osg-main-image,
  .osg-gallery.osg-gallery-single .osg-main-image {
    height: 280px;
  }
}


/* v1.0.7: show whole image inside frame, keep aspect ratio, fill empty area with white */
.osg-card-image,
.osg-list-image,
.osg-main-image,
.osg-thumb {
  background: #ffffff;
}
.osg-card-image img,
.osg-list-image img,
.osg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}
.osg-main-image {
  overflow: hidden;
  background: #ffffff;
}
.osg-main-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #ffffff;
}
.osg-gallery.osg-gallery-single .osg-main-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #ffffff;
}

/* v1.0.8: product tag and public search UI */
.osg-search-form{
  margin:0 0 18px;
  padding:16px;
  background:#f8fbf7;
  border:1px solid #d8e8d2;
  border-radius:14px;
}
.osg-search-row{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(160px,240px) auto;
  gap:12px;
  align-items:end;
}
.osg-search-field span{
  display:block;
  font-weight:bold;
  margin-bottom:5px;
  font-size:.92rem;
}
.osg-search-field input,
.osg-search-field select{
  width:100%;
  min-height:38px;
  box-sizing:border-box;
}
.osg-search-actions{
  display:flex;
  gap:8px;
  align-items:center;
  white-space:nowrap;
}
.osg-search-actions .osg-button{
  border:0;
  cursor:pointer;
}
.osg-button-secondary{
  background:#777;
}
.osg-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:.35em 0;
}
.osg-tag{
  display:inline-block;
  padding:3px 8px;
  border-radius:999px;
  background:#eef6ea;
  color:#2f6b2b;
  font-size:12px;
  text-decoration:none;
  border:1px solid #d8e8d2;
}
.osg-detail-tags{
  margin-top:8px;
}
@media(max-width:720px){
  .osg-search-row{
    grid-template-columns:1fr;
  }
  .osg-search-actions{
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}

/* v1.0.11: stable same-page filter UI */

.osg-search-actions .osg-button,
.osg-search-actions .osg-button:link,
.osg-search-actions .osg-button:visited{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:86px;
  min-height:40px;
  padding:0 16px;
  line-height:1;
  box-sizing:border-box;
  text-decoration:none;
  font-size:14px;
  border-radius:8px;
}
.osg-search-status{
  margin:0 0 14px;
  padding:10px 12px;
  background:#eef6ff;
  border:1px solid #d4e6ff;
  border-radius:10px;
  font-size:.94rem;
}


/* v1.0.13: keep the entire product detail photo visible on all viewport sizes.
   Override the earlier fixed-size and cover rules without changing list thumbnails. */
.osg-product-detail-wrap,
.osg-product-detail,
.osg-detail-grid,
.osg-gallery,
.osg-main-image {
  min-width: 0;
  box-sizing: border-box;
}
.osg-product-detail-wrap .osg-detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.osg-product-detail-wrap .osg-gallery {
  min-width: 0;
  max-width: 100%;
}
.osg-product-detail-wrap .osg-gallery .osg-main-image {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: min(420px, 60vh);
  height: min(420px, 60dvh);
  min-height: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.osg-product-detail-wrap .osg-gallery .osg-main-image img,
.osg-product-detail-wrap .osg-gallery.osg-gallery-single .osg-main-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  margin: auto;
}
@media (max-width: 720px) {
  .osg-product-detail-wrap {
    padding: 20px 12px;
  }
  .osg-product-detail-wrap .osg-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .osg-product-detail-wrap .osg-gallery .osg-main-image {
    height: min(340px, 48vh);
    height: min(340px, 48dvh);
    padding: 8px;
  }
}
@media (max-width: 380px) {
  .osg-product-detail-wrap .osg-gallery .osg-main-image {
    height: min(280px, 44vh);
    height: min(280px, 44dvh);
  }
}
