:root {
  --gap: 1rem;
  --grand-gap: 2rem;
}

body {
  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--md-sys-color-surface, #fff);
  color: var(--md-sys-color-on-surface, #000);
  font-family: "Noto Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

main {
  flex: 1;
}

a {
  color: inherit;
}

[hidden],
.hidden {
  display: none !important;
}

button {
  cursor: pointer;
  width: fit-content;
  border: none;
  background: transparent;
  color: inherit;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 1.5rem;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  font-size: 1.5rem;
  color: inherit;
}
#open-menu,
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--md-sys-color-surface);
  flex-direction: column;
}

.lightbox.is-open {
  display: flex;
}

body.lightbox-open {
  overflow: hidden;
}

#lightbox-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem 0;
  position: relative;
  z-index: 3;
}

#lightbox-toggle-panel.is-active {
  font-variation-settings: "FILL" 1, "wght" 800, "GRAD" 0, "opsz" 0;
  border-radius: 999px;
}

#lightbox-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
  box-sizing: border-box;
}

#lightbox-stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#lightbox-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

#lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4rem 1.5rem 1.25rem;
  background: linear-gradient(to top, var(--md-sys-color-surface), transparent);
  color: var(--md-sys-color-on-surface);
  pointer-events: none;
}

#lightbox-caption-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

#lightbox-panel {
  flex: 0 0 clamp(18rem, 28vw, 26rem);
  max-width: clamp(18rem, 28vw, 26rem);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: 1.25rem 0 0 1.25rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

#lightbox-panel-handle {
  display: none;
}

#lightbox-img-title {
  margin: 0;
  color: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

#lightbox-img-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  opacity: 0.98;
}

.lightbox-fact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.lightbox-fact-row .material-symbols-outlined {
  margin-top: 0.05rem;
  flex: 0 0 auto;
}

.lightbox-fact-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lightbox-fact-label {
  font-size: 0.82rem;
  opacity: 0.75;
}

.lightbox-fact-value {
  font-size: 1rem;
  line-height: 1.35;
}

.lightbox-price {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--md-sys-color-on-primary);
  color: var(--md-sys-color-primary);
  font-size: 1.35rem;
  font-weight: 700;
}

.lightbox-price .material-symbols-outlined {
  font-size: 1.8rem;
}

.lightbox-contact {
  gap: 0.75rem;
  padding: 0 1rem;
  border-radius: 1rem;
  width: 100%;
  font-weight: 400;
  text-decoration: none;
}

.lightbox-contact .material-symbols-outlined {
  font-size: 1.3rem;
}

.lightbox-chip-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lightbox-chip-title {
  font-size: 0.82rem;
  opacity: 0.8;
}

.lightbox-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lightbox-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 0.9rem;
}

.lightbox-empty {
  opacity: 0.9;
  font-style: italic;
}

.lightbox-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.lightbox-actions button {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: inherit;
  background: transparent;
  width: fit-content;
}

.lightbox-option-label {
  font-size: 1rem;
  font-weight: 400;
  color: inherit;
}

@media (max-width: 50rem) {
  #lightbox-body {
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 0.5rem 0;
  }

  #lightbox-panel {
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-height: 50%;
    border-radius: 2rem 2rem 0 0;
    padding-top: 0.25rem;
  }

  #lightbox-panel-handle {
    display: block;
    width: 8rem;
    max-width: 50%;
    min-height: 0.3rem;
    border-radius: 999px;
    background: var(--md-sys-color-on-primary);
    margin: 0 auto 0.75rem;
  }

  .lightbox-option-label {
    display: none;
  }

  #lightbox-image {
    max-height: 55vh;
  }
}