/* R2 – MicroCement farvevælger (porteret fra urbanhald.dk main.v23.css, namespaced mc-) */

:root {
  --mc-accent: #375442;
}

/* Knap på produktsiden */
.mc-colorpickerbutton {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  border-radius: 25px;
  background-color: var(--mc-accent);
  color: #fff;
  cursor: pointer;
  user-select: none;
  line-height: normal;
}
.mc-colorpickerbutton.dark { color: #fff; }
.mc-colorpickerbutton.light { color: #000; }

/* Overlay */
.mc-colorpicker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(73, 73, 73, 0.6);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.mc-colorpicker.active { display: flex; }

.mc-colorpicker > section {
  box-sizing: border-box;
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(100% - 60px);
  max-width: 1800px;
  max-height: calc(100% - 60px);
  padding: 30px;
  background-color: #fff;
  box-shadow: rgba(0, 0, 0, 0.2) 0 0 50px;
}

.mc-header {
  flex: 0 0 auto;
  margin-bottom: 15px;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
}

.mc-popupclose {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d2d2d;
  cursor: pointer;
}
.mc-popupclose svg { display: block; width: 60%; height: auto; }

/* Kolonner: farveliste + showroom */
.mc-columns {
  display: flex;
  flex: 1 1 auto;
  margin: 0 -1%;
  min-height: 0;
}
.mc-columns > * { margin: 0 1%; flex: 1 1 auto; }

.mc-colors { display: flex; flex-direction: column; }
.mc-colors > * { flex: 0 0 auto; }

.mc-typepicker { display: flex; margin: 8px 0; }
.mc-typepicker > div {
  flex: 1 1 auto;
  margin: 0 2%;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  line-height: normal;
}
.mc-typepicker > div input { margin: 0 10px 0 0; flex: 0 0 auto; }

.mc-search { margin: 0 0 20px; }

.mc-colorsul {
  height: calc(80vh - 200px);
  margin: 0;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}
.mc-colorsul > li {
  margin: 0 1% 1%;
  flex: 0 0 auto;
  width: 22.33%;
  border-radius: 25px;
  padding: 10px 15px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  line-height: normal;
  box-sizing: border-box;
}
.mc-colorsul > li:not(.visible) { display: none; }
.mc-colorsul > li.dark { color: #fff; }
.mc-colorsul > li.light { color: #000; }
.mc-colorsul > li.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  border: 5px solid var(--mc-accent);
  box-sizing: border-box;
}
.mc-colorsul > li > .mc-colorprice {
  position: absolute;
  top: 0;
  right: 8px;
  padding: 1px 10px;
  border-radius: 2px;
  font-size: 8px;
  line-height: normal;
  white-space: nowrap;
  background-color: #000;
  color: #fff;
  transform: rotate(5deg);
  z-index: 5;
}

/* Showroom-visning */
.mc-colorview {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  width: 44.9%;
  flex: 0 0 auto !important;
  align-self: flex-start;
}
.mc-colorview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.mc-viewlarge {
  flex: 0 0 auto;
  width: calc(100% - 90px);
  max-height: calc(95vh - 100px);
  margin-right: 10px;
  overflow: hidden;
  position: relative;
  align-self: flex-start;
}
.mc-viewlarge img { height: auto; max-height: calc(95vh - 100px); }
.mc-viewthumbs { flex: 0 0 auto; width: 80px; }
.mc-viewthumbs img {
  cursor: pointer;
  background-color: #fff;
  height: auto;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}
.mc-viewthumbs img.active { border: 4px solid var(--mc-accent); }
.mc-viewthumbs > img:not(:last-child) { margin-bottom: 10px; }

.mc-saveclose {
  position: absolute;
  bottom: 3%;
  right: 3%;
  z-index: 10;
  padding: 10px 25px;
  border-radius: 25px;
  background-color: var(--mc-accent);
  color: #fff;
  cursor: pointer;
  user-select: none;
}

@media (min-width: 1100px) {
  .mc-colorview { position: sticky; top: 0; }
}

@media (max-width: 1099px) {
  .mc-colorpicker > section {
    padding: 0 7px 30px;
    height: 97vh;
    width: 95vw;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll;
  }
  .mc-header { display: none; }

  .mc-columns { flex-direction: column; margin: 0; justify-content: flex-end; }
  .mc-columns.initialized { flex-direction: column-reverse; }
  .mc-columns > * { margin: 0 0 5px; flex: 0 0 auto; width: 100%; }

  .mc-colorview {
    width: 100%;
    margin-left: 0;
    position: sticky;
    top: 0;
    z-index: 30;
    flex-wrap: nowrap;
    background-color: #fff;
    box-shadow: rgba(0, 0, 0, 0.3) 0 0 30px;
  }
  .mc-viewlarge { width: calc(100% - 90px); margin: 0 5px 0 0; }
  .mc-viewlarge img { max-height: 100%; }
  .mc-viewthumbs { width: 70px; display: flex; flex-direction: column; }
  .mc-viewthumbs img { flex: 0 0 auto; aspect-ratio: 1 / 1; }
  .mc-saveclose { font-size: 11px; padding: 5px 20px; }

  .mc-typepicker {
    gap: 5px;
    padding: 0 15px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .mc-typepicker > div { font-size: 11px; margin: 0; }
  .mc-typepicker > div input { margin-right: 7px; }
  .mc-typepicker > div label { white-space: nowrap; text-transform: capitalize; }

  .mc-colorsul { overflow: visible; height: auto; max-height: none; }
  .mc-colorsul > li { margin: 0 1% 2%; width: 31.33%; }
  .mc-colorsul > li > .mc-colorprice { right: 1px; top: -2px; padding: 2px 4px; }
}
