/* Product multiple-image gallery: isolated styles to preserve the existing site design. */
.product-detail-media.product-detail-gallery-shell{display:grid;grid-template-columns:78px minmax(0,1fr);gap:15px;align-items:stretch;min-height:520px;padding:20px}
.product-gallery-thumbnails{display:flex;flex-direction:column;gap:10px;max-height:500px;overflow-y:auto;padding:2px 4px 2px 2px;scrollbar-width:thin}
.product-gallery-thumbnail{flex:0 0 72px;width:68px;height:76px;padding:5px;border:2px solid #e2e4e7;border-radius:6px;background:#fff;cursor:pointer;transition:border-color .2s,box-shadow .2s,transform .2s}
.product-gallery-thumbnail:hover{border-color:#8e959b;transform:translateY(-1px)}
.product-gallery-thumbnail.active{border-color:#e4a62b;box-shadow:0 0 0 2px rgba(228,166,43,.17)}
.product-gallery-thumbnail img{display:block;width:100%!important;height:100%!important;object-fit:contain}
.product-gallery-main{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:475px;overflow:hidden;border-radius:6px;background:#fff}
.product-gallery-main>img{display:block;width:100%!important;height:100%!important;max-height:500px!important;object-fit:contain;transition:opacity .15s ease}
.product-gallery-main>img.changing{opacity:.45}
.product-gallery-counter{position:absolute;right:10px;bottom:10px;padding:5px 9px;border-radius:15px;background:rgba(32,37,42,.82);color:#fff;font-size:11px;font-weight:700}

.admin-gallery-notice{margin:0 0 16px;padding:12px 15px;border:1px solid #b7e4c7;border-radius:5px;background:#e7f7ed;color:#166534}
.product-gallery-admin-heading h2{margin:0 0 5px}
.product-gallery-admin-heading p{margin:0 0 18px;color:#6b7176}
.admin-product-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px}
.admin-product-image-card{min-width:0;padding:10px;border:1px solid #e1e4e7;border-radius:7px;background:#fff}
.admin-product-image-card.is-primary{border-color:#e4a62b;box-shadow:0 0 0 2px rgba(228,166,43,.16)}
.admin-product-image-frame{position:relative;display:grid;height:170px;place-items:center;overflow:hidden;border-radius:5px;background:#f6f7f8}
.admin-product-image-frame img{display:block;width:100%;height:100%;object-fit:contain}
.admin-product-image-frame span{position:absolute;top:8px;left:8px;padding:5px 8px;border-radius:4px;background:#e4a62b;color:#171717;font-size:11px;font-weight:800;text-transform:uppercase}
.admin-product-image-card>p{margin:9px 0;overflow:hidden;color:#555;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.admin-product-image-actions{display:flex;gap:7px;flex-wrap:wrap}
.admin-product-image-actions form{flex:1;margin:0}
.admin-product-image-actions .btn{width:100%;padding:8px 9px;font-size:12px}
.admin-product-gallery-empty{padding:24px;border:1px dashed #c8cdd2;border-radius:6px;background:#fafafa;color:#6b7176;text-align:center}
.new-product-image-preview{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px}
.new-product-image-item{width:100px;height:118px;padding:5px;border:1px solid #dde1e4;border-radius:6px;background:#fff}
.new-product-image-item img{display:block;width:100%;height:84px;object-fit:contain}
.new-product-image-item span{display:block;margin-top:4px;overflow:hidden;font-size:11px;font-weight:700;text-align:center;text-overflow:ellipsis;white-space:nowrap}
.product-image-upload-error{width:100%;margin:0;padding:10px 12px;border-radius:4px;background:#fff0ee;color:#a52218}
.product-description-editor{min-height:340px;line-height:1.65;white-space:pre-wrap}
.product-video-code-input{min-height:125px;font-family:Consolas,Monaco,monospace;font-size:12px;line-height:1.5}
.product-description-title{margin:24px 0 10px;font-size:20px}
.product-description{max-height:210px;overflow-x:hidden;overflow-y:auto;padding-right:12px;overflow-wrap:anywhere;scrollbar-width:thin;scrollbar-color:#c8c8c8 #f2f2f2}
.product-description::-webkit-scrollbar{width:7px}
.product-description::-webkit-scrollbar-track{background:#f2f2f2;border-radius:8px}
.product-description::-webkit-scrollbar-thumb{background:#c8c8c8;border-radius:8px}
.product-description table{display:block;max-width:100%;overflow-x:auto;white-space:normal}
.product-video-section{margin-top:38px;padding:28px;border:1px solid #ececec;border-radius:8px;background:#fff}
.product-video-section h2{margin:0 0 18px;font-size:25px}
.product-video-frame{position:relative;width:100%;max-width:920px;margin:0 auto;overflow:hidden;border-radius:8px;background:#111;aspect-ratio:16/9}
.product-video-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

@media(max-width:768px){
  .product-detail-media.product-detail-gallery-shell{grid-template-columns:1fr;min-height:380px;padding:16px}
  .product-gallery-main{order:1;min-height:330px}
  .product-gallery-thumbnails{order:2;flex-direction:row;max-height:none;overflow-x:auto;overflow-y:hidden;padding:4px 2px}
  .product-gallery-thumbnail{flex:0 0 66px;width:66px;height:70px}
  .admin-product-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:480px){
  .product-detail-media.product-detail-gallery-shell{min-height:320px;padding:12px}
  .product-gallery-main{min-height:285px}
  .admin-product-image-grid{grid-template-columns:1fr}
  .product-description{max-height:160px}
  .product-video-section{margin-top:25px;padding:16px}
  .product-video-section h2{font-size:21px}
}
