img { display: block; }

/* Gallery behaviour is unchanged; the main design stylesheet is preserved. */
.work-card[hidden] { display: none !important; }
.work-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-price { color: var(--berry); font-weight: 700; }
.work-weight { color: var(--ink-soft); }
.work-meta { overflow-wrap: anywhere; white-space: pre-line; }
.catalog-state { color: var(--ink-soft); padding: 16px 0; }
.catalog-retry { margin-left: 14px; border: 1px solid var(--line); border-radius: 24px; padding: 8px 18px; background: var(--paper); cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--berry); outline-offset: 5px; }

/* Open product: warm paper, balanced columns, a complete photograph. */
.lightbox {
  background: rgba(48, 33, 37, .6);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  padding: 32px 24px;
}
.lightbox-card {
  width: min(100%, 1100px);
  height: min(760px, calc(100vh - 64px));
  height: min(760px, calc(100dvh - 64px));
  max-height: none;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--background);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 22px;
  box-shadow: 0 24px 90px rgba(43, 24, 31, .2);
}
.lightbox-image {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 28px;
  background: #f3ede6;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
}
.lightbox-image img {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
}
.lightbox-card > .lightbox-copy {
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  padding: 44px 42px 36px;
  border-left: 1px solid rgba(83, 39, 52, .08);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #ccb9bb transparent;
  overflow-wrap: anywhere;
}
.lightbox-copy::-webkit-scrollbar { width: 5px; }
.lightbox-copy::-webkit-scrollbar-track { background: transparent; }
.lightbox-copy::-webkit-scrollbar-thumb { background: #ccb9bb; border-radius: 8px; }
.lightbox-copy:focus-visible { outline: 2px solid var(--berry); outline-offset: -5px; }
.lightbox-copy .eyebrow { font-size: 10px; letter-spacing: .17em; margin: 0 36px 16px 0; }
.lightbox-copy h3 { font-size: clamp(25px, 2.35vw, 34px); line-height: 1.16; letter-spacing: -.025em; }
.lightbox-copy .product-facts {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 0 26px;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}
.product-facts p { margin: 0; }
.lightbox-copy .work-price { font-family: Georgia, 'Times New Roman', serif; font-size: 24px; line-height: 1.2; font-weight: 400; color: var(--berry); }
.lightbox-copy .work-weight { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.lightbox-copy .detail-label { font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: 700; line-height: 1.4; letter-spacing: .15em; text-transform: uppercase; color: var(--berry); margin: 28px 0 10px; }
.lightbox-copy .work-description, .lightbox-copy .work-ingredients { font-size: 14px; line-height: 1.85; color: #6b5c60; white-space: pre-line; margin: 0; }
.lightbox-copy .detail-label + p { margin-top: 0; }
.lightbox-close {
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
  background: rgba(255, 250, 246, .96);
  border: 1px solid rgba(83, 39, 52, .16);
  color: var(--foreground);
  top: 46px;
  top: calc(max(32px, calc((100dvh - 760px) / 2)) + 14px);
  right: max(38px, calc((100vw - 1100px) / 2 + 14px));
  z-index: 1;
}
.lightbox-close:hover { background: #fff; color: var(--berry); }
.lightbox .photo-controls { position: static; width: 100%; display: flex; gap: 14px; justify-content: center; align-items: center; }
.photo-controls[hidden] { display: none !important; }
.photo-controls button { cursor: pointer; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(83, 39, 52, .18); border-radius: 50%; color: var(--berry); background: var(--background); font-size: 24px; line-height: 1; }
.photo-controls button:hover { background: #fff; border-color: var(--berry); }
.photo-controls span { font-size: 11px; letter-spacing: .1em; font-variant-numeric: tabular-nums; color: var(--ink-soft); background: none; padding: 0; }
.lightbox button:focus-visible { outline-color: var(--berry); }

@media (max-width: 800px) {
  .lightbox { padding: 14px; }
  .lightbox-card {
    height: calc(100vh - 28px);
    height: calc(100dvh - 28px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
  }
  .lightbox-image { flex: 0 0 42%; height: 42%; min-height: 0; padding: 18px; gap: 10px; }
  .lightbox-card > .lightbox-copy { flex: 1 1 0; height: auto; padding: 26px 24px 30px; border-left: 0; border-top: 1px solid rgba(83, 39, 52, .08); }
  .lightbox-copy h3 { font-size: 27px; }
  .lightbox-copy .product-facts { padding: 16px 0 20px; margin-bottom: 22px; }
  .lightbox-close { top: 26px; right: 26px; }
}
