.inspect-container {
  margin: 0 auto 70px;
  padding-top: 40px;
}

html:has(.product-detail),
body:has(.product-detail),
.main-content:has(.product-detail) {
  overflow-x: hidden;
  overflow-x: clip;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  grid-template-areas:
    "title ."
    "media info";
  column-gap: clamp(28px, 5vw, 72px);
  row-gap: 0;
  align-items: start;
  width: min(1360px, calc(100% - 40px));
  animation: product-detail-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (min-width: 861px) {
  .js-fx .inspect-container.jimmy-product-detail {
    padding-top: 72px !important;
  }
}

.product-media {
  grid-area: media;
  min-width: 0;
  max-width: 100%;
}

.product-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

@keyframes product-detail-in {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: none; }
}

.product-image-open {
  display: inline-block;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-width: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='white' stroke='%23111' stroke-width='1.5'/%3E%3Cpath d='M10 7v6M7 10h6' stroke='%23111' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M15.5 15.5L21 21' stroke='%23111' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, zoom-in;
  position: relative;
  overflow: hidden;
  line-height: 0 !important;
  font-size: 0 !important;
  vertical-align: top;
  appearance: none;
  -webkit-appearance: none;
}

.product-image-open.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(100deg, rgba(210,210,210,0.55) 20%, rgba(245,245,245,0.85) 40%, rgba(210,210,210,0.55) 60%);
  background-size: 220% 100%;
  animation: inspect-skeleton 1.15s ease-in-out infinite;
}

.product-image-open.is-loading img {
  opacity: 0;
}

.product-image-open.is-loaded img {
  opacity: 1;
  transition: opacity 0.22s ease;
}

@keyframes inspect-skeleton {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.product-image-frame img {
  display: block;
  max-width: 100%;
  max-height: 125vh;
  height: auto;
  object-fit: contain;
  border: 0;
  border-radius: 0 !important;
  box-sizing: border-box;
  filter: var(--product-image-filter-shadow, none);
}

.product-image-open {
  box-shadow: var(--product-image-shadow, 10px 14px 36px rgba(0, 0, 0, 0.38));
}

.product-image-open:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.35);
  outline-offset: 6px;
}

.product-detail.landscape .product-image-frame img {
  max-height: 112vh;
}

.product-detail:not(.jimmy-product-detail) .product-image-open {
  border: 14px solid #111 !important;
  box-shadow: var(--ketty-product-frame-effect, 0 12px 34px rgba(0, 0, 0, 0.28)) !important;
}

.product-detail:not(.jimmy-product-detail) .product-caption {
  width: min(100%, 720px);
  margin: 22px auto 0;
  text-align: center;
}

.product-detail:not(.jimmy-product-detail) .product-caption .product-description {
  margin: 0 auto;
  color: var(--page-text, #111);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.55;
  text-align: center;
}

.product-info {
  grid-area: info;
  align-self: start;
  min-width: 0;
  max-width: 100%;
  padding-top: 0;
}

.product-info .customer-view {
  margin-top: 0;
}

.product-title {
  grid-area: title;
  margin: 0 0 32px;
  width: 100%;
  text-align: center;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.product-detail.jimmy-product-detail .product-title {
  font-size: clamp(2.35rem, 4.35vw, 4.15rem);
}

.inspect-image {
  padding: 32px;
  width: 50vw;
  margin: 0 auto 30px auto;
  border-radius: var(--site-radius, 8px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  background-color: #fff;
  text-align: center;
  font-size: 32px;
}

.inspect-info {
  width: 90%;
  max-width: 100vw;
  margin: 0 auto;
}

.inspect-info h2 {
  margin-top: 0;
  font-size: 2.5em;
}

.inspect-info label {
  font-size: 0.5em;
  text-align: left;
  margin-bottom: 0;
}

.admin-image-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  width: 100%;
  margin: 0 auto 18px;
  padding: 12px 16px;
  border: 1px solid rgba(190, 154, 40, 0.35);
  border-radius: var(--site-radius, 8px);
  background: #fff6c7;
  box-sizing: border-box;
  color: #4b3b00;
}

.admin-image-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 104px;
  justify-content: center;
  font-size: 0.98rem;
  line-height: 1.25;
}

.admin-image-stat-label {
  font-weight: 600;
}

.admin-image-stat-value {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.72);
  box-sizing: border-box;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='white' stroke='%23111' stroke-width='1.5'/%3E%3Cpath d='M7 10h6' stroke='%23111' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M15.5 15.5L21 21' stroke='%23111' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, zoom-out;
  overflow: hidden;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox:not([hidden]) {
  animation: lightbox-bg-in 0.32s ease both;
}

.image-lightbox:not([hidden]) img {
  animation: lightbox-img-in 0.5s cubic-bezier(0.34, 1.1, 0.64, 1) 0.06s both;
}

@keyframes lightbox-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lightbox-img-in {
  from { opacity: 0; clip-path: inset(6% 6% 6% 6%); }
  to   { opacity: 1; clip-path: none; }
}

.image-lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: none;
  box-shadow: 0 0 60px rgb(255, 255, 255, .4);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='white' stroke='%23111' stroke-width='1.5'/%3E%3Cpath d='M10 7v6M7 10h6' stroke='%23111' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M15.5 15.5L21 21' stroke='%23111' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, zoom-in;
  transform-origin: center center;
  transition: transform 0.18s ease;
}

.image-lightbox.is-zoomed img {
  cursor: url('/shared-img/pan.svg') 12 12, grab;
}

.image-lightbox.is-dragging img {
  cursor: url('/shared-img/pan_grab.svg') 12 12, grabbing !important;
}


@media (max-width: 860px) {
  .inspect-container {
    margin: 0 auto 48px;
    padding-top: 28px;
  }

  .product-detail {
    animation: product-detail-in-mobile 1.05s cubic-bezier(0.22, 1, 0.36, 1) both !important;
  }

  .product-detail {
    grid-template-columns: 1fr;
    grid-template-areas:
      "back"
      "title"
      "media"
      "info";
    width: 100%;
    max-width: 680px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .product-media,
  .product-info {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .product-info .customer-view {
    margin-top: 22px;
  }

  .product-image-frame {
    min-height: auto;
  }

  .product-image-frame img {
    max-height: 64vh;
  }

  .product-title {
    font-size: 2rem;
    margin-bottom: 22px;
  }

  .product-detail.jimmy-product-detail .product-title {
    font-size: 2.15rem;
  }

  .inspect-container.jimmy-product-detail {
    padding-top: 28px;
  }

  .inspect-image {
    width: 70%;
  }

  .image-lightbox {
    padding: 14px;
  }

}

@keyframes product-detail-in-mobile {
  from { opacity: 0; transform: translateY(220px); }
  to   { opacity: 1; transform: translateY(42px); }
}

@media (hover: none) and (pointer: coarse) {
  .product-image-frame,
  .product-title {
    animation: none;
  }

  .image-lightbox {
    padding: 0;
  }

  .image-lightbox img {
    max-width: 100vw;
    max-height: 100vh;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  .inspect-container {
    margin: 0 auto 12px;
    padding-top: 10px;
  }

  .inspect-container,
  .inspect-container * {
    animation: none !important;
  }

  .product-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "title info"
      "media info";
    row-gap: 0;
    width: calc(100% - 24px);
    padding: 0;
    max-width: 100%;
    align-items: start;
  }

  .product-title {
    font-size: 1.2rem;
    margin: 0;
    text-align: center;
  }

  .product-media {
    margin-top: 0;
    padding-top: 0;
  }

  .product-image-frame {
    margin-top: 0;
    padding-top: 0;
  }

  .product-image-frame img {
    max-height: 80vh;
  }

  .product-info .customer-view {
    margin-top: 0;
  }
}

html.is-landscape-mobile .inspect-container {
  margin: 0 auto 12px;
  padding-top: 28px;
}

html.is-landscape-mobile .product-detail {
  grid-template-rows: auto 1fr;
}

html.is-landscape-mobile .product-info {
  padding-top: 18px;
  align-self: start;
}

html.is-landscape-mobile .product-title {
  line-height: 1.1;
  padding-bottom: 4px;
  padding-top: 18px;
}

html.is-landscape-mobile .inspect-container,
html.is-landscape-mobile .inspect-container * {
  animation: none !important;
  transition: none !important;
}

html.is-landscape-mobile .product-detail {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "title info"
    "media info";
  row-gap: 0;
  width: calc(100% - 24px);
  padding: 0;
  max-width: 100%;
  align-items: start;
}

html.is-landscape-mobile .product-title {
  font-size: 1.2rem;
  margin: 0;
  text-align: center;
}

html.is-landscape-mobile .product-media {
  margin-top: 0;
  padding-top: 18px;
}

html.is-landscape-mobile .product-image-frame {
  margin-top: 0;
  padding-top: 0;
}

html.is-landscape-mobile .product-image-frame img {
  max-height: 80vh;
}

html.is-landscape-mobile .product-info .customer-view {
  margin-top: 0;
}

/* ── Extra produktbild-thumbnails ────────────────────────────────────── */
.product-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.product-file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--element-bg, #f0f0f0);
  border-radius: 6px;
  text-decoration: none;
  color: var(--page-text, #111);
  font-size: 0.9rem;
  transition: opacity 0.15s;
}

.product-file-link:hover {
  opacity: 0.75;
}

.product-file-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.product-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-file-download-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  fill: var(--page-text);
}

.product-extra-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.product-extra-thumb {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: pointer;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  width: 64px;
  height: 64px;
  background: var(--element-bg, #f0f0f0);
  opacity: 0.7;
  transition: opacity 0.15s, border-color 0.15s;
}

.product-extra-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-extra-thumb:hover,
.product-extra-thumb.is-active,
.product-extra-thumb.is-main {
  border-color: var(--page-text, #222);
  opacity: 1;
}

/* Admin: extra bilder-grid */
.gallery-edit-extra-images {
  margin-top: 16px;
}

.extra-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.extra-image-item {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: 92px;
}

.extra-image-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color, #ddd);
}

.extra-image-actions {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.extra-image-actions .extra-img-set-main,
.extra-image-actions .extra-img-delete {
  box-sizing: border-box;
  font-size: 0.75rem;
  line-height: 1;
  min-width: 0 !important;
  padding: 4px 0 !important;
  width: 50%;
  cursor: pointer;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #f0f0f0;
  color: #333;
}
.extra-image-actions .extra-img-set-main:hover {
  background: #e0e8ff;
  border-color: #88a;
}
.extra-image-actions .extra-img-delete:hover {
  background: #ffe0e0;
  border-color: #a88;
}

/* ── Kommentarssektion (kundvy) ─────────────────────────────────────────── */
.product-comments-section {
  max-width: 660px;
  margin: 48px auto 32px;
  padding: 0 16px;
  text-align: center;
}

.product-comments-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.03em;
  color: var(--page-text);
}

.product-comments-list {
  text-align: left;
}

.product-comment {
  padding: 14px 16px;
  background: var(--element-bg, #f5f5f5);
  border-radius: 6px;
  margin-bottom: 8px;
  color: var(--element-text);
}

.product-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.product-comment-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.product-comment-date {
  font-size: 0.78rem;
  opacity: 0.55;
}

.product-comment-message {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.product-comment--hidden { display: none; }

.product-comment-load-more {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none !important;
  border: 1px solid var(--element-border, rgba(0,0,0,0.15)) !important;
  border-radius: var(--site-radius, 6px) !important;
  padding: 8px 12px !important;
  min-height: unset !important;
  min-width: unset !important;
  font-size: 0.85rem !important;
  font-weight: normal !important;
  color: var(--page-text) !important;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.product-comment-load-more:hover { opacity: 1; }

.product-comment-edit-btn {
  background: none !important;
  border: none !important;
  min-height: unset !important;
  min-width: unset !important;
  padding: 2px 6px !important;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: normal !important;
  color: var(--page-text) !important;
  margin-left: auto;
  opacity: 1;
}

.product-comment-edit-form {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-comment-edit-form[hidden] { display: none; }

.product-comment-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 8px;
  border: 1px solid var(--element-border, rgba(0,0,0,0.2));
  border-radius: 4px;
  background: var(--input-bg, #fff);
  color: inherit;
}

.product-comment-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.product-comment-edit-cancel {
  background: none !important;
  border: none !important;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.5;
  min-height: unset !important;
  min-width: unset !important;
  color: var(--page-text) !important;
  font-weight: normal !important;
}

.product-comment-edit-cancel:hover { opacity: 0.9; }

.product-comment-reply {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.04);
  border-left: 2px solid var(--element-border, rgba(0,0,0,0.2));
  border-radius: 0 4px 4px 0;
}

.product-comment-reply-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.55;
  margin-bottom: 4px;
}

.product-comment-reply-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.product-comments-empty {
  font-size: 0.9rem;
  opacity: 0.6;
  color: var(--page-text);
  margin: 0 0 16px;
  text-align: center;
}

.product-comment-toggle {
  display: inline-block;
  margin-top: 20px;
}
.product-comment-toggle[hidden] {
  display: none !important;
}

.product-comment-form {
  margin-top: 20px;
  text-align: left;
  background: var(--element-bg, #f5f5f5);
  border-radius: 6px;
  padding: 16px;
}

.product-comment-honeypot {
  position: absolute;
  left: -9999px;
  visibility: hidden;
}

.product-comment-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.product-comment-field span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--element-text);
}

.product-comment-field input,
.product-comment-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--element-border, #ccc);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.product-comment-field textarea {
  resize: vertical;
  min-height: 90px;
}

.product-comment-submit {
  margin-top: 4px;
}

.product-comment-form-status {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.87rem;
  margin-bottom: 10px;
}

.product-comment-form-status.is-ok {
  background: #eaf7ee;
  color: #2a6e3f;
}

.product-comment-form-status.is-error {
  background: #fdecea;
  color: #9b1c1c;
}

/* ── Kommentarer i adminvy ──────────────────────────────────────────────── */
.admin-comments-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--element-bg, #f5f5f5);
  border-radius: 6px;
  font-size: 0.85rem;
}
.admin-comment-item.is-spam {
  opacity: 0.5;
}

.admin-comment-body {
  flex: 1;
  min-width: 0;
}

.admin-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.admin-comment-name {
  font-weight: 600;
}

.admin-comment-email {
  font-size: 0.82rem;
  color: inherit;
  opacity: 0.7;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-comment-email:hover {
  opacity: 1;
}

.admin-comment-date {
  font-size: 0.78rem;
  opacity: 0.45;
  margin-left: auto;
}

.admin-comment-spam-tag {
  font-size: 0.75rem;
  background: #fde;
  color: #a00;
  border-radius: 3px;
  padding: 1px 5px;
}

.admin-comment-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted, #555);
}
