/* IMAGE */

.col-1 .main-image-wrapper img.is-active {
  outline: 2px solid var(--middleRose);
  outline-offset: 2px;
  border-radius: 4px;
}

.thumb, #main-image {
    max-width: 100%;
}

@media (max-width: 880px) {
  .thumb {
    display: none;
  }
}

#add-to-cart {
    margin-bottom: 0px;
}

/* VIDEO */

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Verhältnis (9 / 16 = 0.5625) */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 90%;
  height: 90%;
  border: 0;
}

/* Thumbs-Markierung */
.col-1 .main-image-wrapper img.is-active {
  outline: 2px solid var(--middleRose);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Größenanpassung */
.thumb, #main-image { max-width: 100%; }

/* Main-Image: Fade über Klasse is-fading */
#main-image {
  opacity: 1;
  transition: opacity .25s ease;
}
#main-image.is-fading {
  opacity: 0.001;
}


/* Lightbox Overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  display: none;                 /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}

/* zentrierter Bereich */
.lightbox-center {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 6px;
  opacity: 0;                    /* Fade-In jedes Bilds */
  transition: opacity .25s ease;
}
#lightbox-image.is-visible {
  opacity: 1;
}

/* Buttons */
.lb-btn {
  position: absolute;
  background: rgba(255,255,255,.85);
  border: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  display: flex;                /* neu */
  align-items: center;          /* vertikal zentriert */
  justify-content: center;      /* horizontal zentriert */
  cursor: pointer;
  user-select: none;
  padding: 0;                   /* Sicherheit */
  display:flex;
  cursor:pointer;
  user-select:none;
}
.lb-close { top: 18px; right: 18px; font-size: 32px; }
.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);   /* schiebt das Element um die eigene Höhe nach oben → exakt mittig */
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-btn:focus { outline: 2px solid var(--middleRose); }


.lightbox-counter{
  position:absolute;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  color:#fff;
  font:14px/1 OpenSansRegular, sans-serif;
  background:rgba(0,0,0,.5);
  padding:4px 10px;
  border-radius:12px;
  z-index:1;             /* über dem Bild */
  pointer-events:none;   /* nicht anklickbar */
}

/* INPUT */

/* SELECT */
select, textarea, input {
    font-family: OpenSansLight, serif;
    padding: 7px;
    border-color: var(--lightGray);
    border-radius: 5px;
    font-size: 1.025rem;
}

select:focus, textarea:focus, input:focus {
    outline-color: var(--blackRose) !important;
}

/* Um Label und Select in unterschiedliche Zeilen zu bringen */
form p {
    display: grid;
    padding-bottom: 10px;
}

form label {
    padding-bottom: 12px;
}

/* COMMENT */

.comment-form > p  {
    width: 100%;
}

.comment-form input  {
    font-family: OpenSansLight, serif;
    padding: 7px;
    border-color: var(--lightGray);
    border-radius: 5px;
    font-size: 1.025rem;
    border-width: 1px;
    border-style: solid;
    text-transform: none;
    font-family: OpenSansLight, serif !important;
    letter-spacing: unset;
}

.download {
width: 100%;
}

.width-100 {
    width: 100%;
}

.measurement-table div:nth-child(odd) {
    background: var(--middleRose);
}

.measurement-table div:nth-child(even) {
    background: var(--lightRose);
}

.measurement-table div {
    padding: 5px;
}

@media only screen and (max-width: 880px) {
    .font-table, font-table * {
        font-size: 0.8rem !important;
    }
    .font-table table,
    .font-table th,
    .font-table td {
        font-size: 0.8rem !important;
    }

    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* smooth scrolling auf iOS */
    }

    .table-wrapper table {
        min-width: max-content; /* verhindert das Zusammenquetschen */
    }

}

.image-caption {
    font-size: 0.8rem;
}

.material-annotation {
    font-size: 0.8rem;
}



/* TOGGLE FOR IMPERIAL */

.unit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.unit-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--blackRose);
    border-radius: 999px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked + .slider {
    background-color: var(--middleRose);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}
