/* v1164: phone photo gallery (loaded only up to 900 px wide; everything is under html.ys1164, which the script sets
   only when the new gallery is ready - so a failed script leaves the old gallery as it was). */

/* ---------- strip: every photo, a clean photo (name and rating move just below it) ---------- */
html.ys1164 body.pdp16 .pdp9-main .pdp9-gallery { height: 340px !important; }
html.ys1164 body.pdp16 .pdp9-gallery > button { height: 100% !important; }
html.ys1164 body.pdp16 .pdp9-gallery .ys1164-s img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.ys1164 body.pdp16 .ys896-count {
  top: 300px !important; bottom: auto !important; left: auto !important; right: 14px !important; transform: none !important;
  padding: 5px 11px !important; border-radius: 12px !important; background: rgba(10, 18, 30, .62) !important;
  font: 600 12px/1.3 Inter, system-ui, sans-serif !important; color: #fff !important;
}

/* name, rating and place below the photo (was a dark band over the photo) */
html.ys1164.ys76 body.pdp16 .ys75-over {
  height: auto !important; margin: 0 calc(50% - 50vw) !important; padding: 12px 20px 0 !important;
  background: #fff !important; color: #0F1B2D !important; justify-content: flex-start !important;
}
html.ys1164.ys76 body.pdp16 .ys75-pill {
  background: #F2F4F7 !important; border-color: #E3E8EF !important; color: #344054 !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html.ys1164.ys76 body.pdp16 .ys75-name { margin: 8px 0 6px !important; font-size: 24px !important; color: #0F1B2D !important; text-shadow: none !important; }
html.ys1164.ys76 body.pdp16 .ys75-sub { color: #475467 !important; }
html.ys1164.ys76 body.pdp16 .ys75-sub a.ys75-star { background: #0F1B2D !important; color: #fff !important; }
html.ys1164.ys76 body.pdp16 .ys75-float { margin-top: 14px !important; }

/* category chips under the photo */
html.ys1164 body.pdp16 .ys1164-chips {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(50% - 50vw); padding: 12px 16px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
html.ys1164 body.pdp16 .ys1164-chips::-webkit-scrollbar { display: none; }
.ys1164-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 5px 11px 5px 5px;
  border: 1px solid #E3E8EF; border-radius: 10px; background: #fff; color: #0F1B2D;
  font: 600 13px/1 Inter, system-ui, sans-serif; cursor: pointer;
}
.ys1164-chip img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; background: #E4EAF1; }
.ys1164-chip small { color: #667085; font-weight: 500; }
.ys1164-chip:focus-visible, .ys1164-tab:focus-visible, .ys1164-gi:focus-visible { outline: 2px solid #2F6FDB; outline-offset: 2px; }

/* ---------- viewer ---------- */
.ys1164-v {
  position: fixed; inset: 0; z-index: 1400; display: flex; flex-direction: column; background: #000; color: #fff;
  overscroll-behavior: contain; touch-action: none;
}
.ys1164-v[hidden] { display: none !important; }
html.ys1164-open, html.ys1164-open body { overflow: hidden !important; }
.ys1164-vh { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 8px 8px; }
.ys1164-x, .ys1164-all {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0;
  border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
}
.ys1164-vt { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.ys1164-vt b { display: block; font: 600 15px/1.25 Inter, system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys1164-vt span { font: 500 13px/1.25 Inter, system-ui, sans-serif; opacity: .8; }
.ys1164-track {
  flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; touch-action: pan-x pinch-zoom; transition: none;
}
.ys1164-track::-webkit-scrollbar { display: none; }
.ys1164-vs { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; }
.ys1164-vs img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.ys1164-hint { flex: 0 0 auto; margin: 6px 0 0; text-align: center; font: 500 12px/1.3 Inter, system-ui, sans-serif; opacity: .6; }
.ys1164-th { flex: 0 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); scrollbar-width: none; }
.ys1164-th::-webkit-scrollbar { display: none; }
.ys1164-t { flex: 0 0 56px; height: 56px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #222; opacity: .5; cursor: pointer; }
.ys1164-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ys1164-t.on { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; }

/* ---------- "All photos" grouped ---------- */
html.ys1164 #galleryModalOverlay .gm-photo-grid { display: none !important; }
html.ys1164 #galleryModalOverlay .ys906-gbar { position: sticky; top: 0; z-index: 2; background: #fff; flex-wrap: wrap; }
.ys1164-tabs { flex: 1 0 100%; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.ys1164-tabs::-webkit-scrollbar { display: none; }
.ys1164-tab {
  flex: 0 0 auto; height: 34px; padding: 0 12px; border: 0; border-radius: 17px; background: #F2F4F7; color: #344054;
  font: 600 13px/1 Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.ys1164-tab small { font-weight: 500; opacity: .75; }
.ys1164-tab.on { background: #0F1B2D; color: #fff; }
.ys1164-groups { padding-bottom: 30px; }
.ys1164-sec { padding: 14px 0 4px; }
.ys1164-sec h3 { margin: 0 0 8px; font: 700 15px/1.3 Inter, system-ui, sans-serif; color: #0F1B2D; }
.ys1164-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ys1164-gi { display: block; height: 124px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #E4EAF1; cursor: pointer; }
.ys1164-gi.wide { grid-column: 1 / -1; height: 210px; }
.ys1164-gi img { width: 100%; height: 100%; object-fit: cover; display: block; }
