/* Redoffice – butikker */

@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #b20e10;
  --grey-text: #616161;
  --grey-dark: #505050;
  --grey-light: #e4e4e4;
  --gutter: 15px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #5a5a5a;
  background-color: var(--grey-light);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--red);
  text-decoration: none;
}

.container {
  width: 100%;
  padding: 0 var(--gutter);
  margin: 0 auto;
}

/* ---------- Header ---------- */

.header {
  position: relative;
  z-index: 1;
  height: 10rem;
  background-color: var(--grey-dark);
}

.header .container {
  position: relative;
  height: 100%;
}

.header__block {
  display: flex;
  align-items: center;
  padding: 10px 10px 10px 0;
  background-color: var(--red);
}

.header__logo {
  display: block;
  margin-left: 10px;
}

.header__logo img {
  width: 170px;
  height: 50px;
}

/* Sits on the bottom edge with a tight line-height, so descenders hang into the map area. */
.header__headline {
  position: absolute;
  bottom: 0;
  left: var(--gutter);
  margin: 0;
  font-size: 1.4375rem;
  font-weight: 400;
  line-height: 0.79;
  color: #fff;
  white-space: nowrap;
}

/* ---------- Map ---------- */

.shops {
  flex: 1;
  padding: 35px 0 130px;
}

.map {
  position: relative;
  aspect-ratio: 1 / 1.1811;
}

.map__land {
  width: 100%;
  height: 100%;
}

.map__dot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--red);
  cursor: pointer;
}

.map__dot:focus {
  outline: none;
}

.map__dot:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ---------- Shop popover ---------- */

.shop {
  position: fixed;
  inset: 0;
  width: min(500px, 100% - 2 * var(--gutter));
  height: fit-content;
  max-height: 90%;
  margin: auto;
  translate: 0 -5%;
  padding: 0;
  border: 0;
  overflow: auto;
  background: transparent;
  color: var(--grey-text);
  font-size: 1rem;
}

.shop::backdrop {
  background-color: rgba(255, 255, 255, 0.9);
}

html:has(.shop:popover-open) {
  overflow: hidden;
}

.shop__header {
  display: flow-root;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--red);
}

.shop__close {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  margin: 10px -6px -3px auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.shop__close::before,
.shop__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  margin-top: -1px;
  background-color: var(--red);
  transform: rotate(45deg);
}

.shop__close::after {
  transform: rotate(-45deg);
}

.shop__close:hover::before,
.shop__close:hover::after {
  background-color: #5a5a5a;
}

.shop__hd {
  display: flex;
  align-items: flex-start;
  padding: 1.5625rem 0;
}

.shop__pin {
  flex: none;
  width: 2.6875rem;
  height: 4.375rem;
  margin-right: 1.25rem;
}

.shop__hd h2 {
  margin: 0 0 0.5rem;
  padding-top: 0.5rem;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

.shop__hd strong {
  font-weight: 700;
}

.shop__bd {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.375rem;
  line-height: 1.2;
}

.shop__address {
  max-width: 55%;
}

.shop__contact {
  max-width: 45%;
  text-align: right;
}

.shop__bd h3,
.shop__bd p {
  margin: 0 0 2px;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.2;
}

.shop__bd h3 strong {
  font-weight: 700;
}

.shop__phone a {
  color: inherit;
}

.shop__web {
  font-weight: 800;
}

.shop__photo {
  padding: 4.375rem 0 1.5625rem;
  border-bottom: 1px solid var(--red);
}

.shop__photo img {
  width: 100%;
  aspect-ratio: 500 / 275;
  object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
  .shop,
  .shop::backdrop {
    transition: opacity 0.3s, transform 0.3s, overlay 0.3s allow-discrete, display 0.3s allow-discrete;
    opacity: 0;
  }

  .shop {
    transform: translateY(-10%);
  }

  .shop:popover-open,
  .shop:popover-open::backdrop {
    opacity: 1;
    transform: none;
  }

  @starting-style {
    .shop:popover-open,
    .shop:popover-open::backdrop {
      opacity: 0;
    }

    .shop:popover-open {
      transform: translateY(-10%);
    }
  }
}

/* ---------- Breakpoints (match the original Bootstrap grid) ---------- */

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }

  /* Bootstrap col-sm-10 offset-sm-1 */
  .header__block {
    width: calc((100% + 2 * var(--gutter)) * 10 / 12 - 2 * var(--gutter));
    margin-left: calc((100% + 2 * var(--gutter)) / 12);
  }

  /* Bootstrap col-sm-7, centred */
  .map {
    width: calc((100% + 2 * var(--gutter)) * 7 / 12 - 2 * var(--gutter));
    margin: 0 auto;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }

  .header {
    height: 20.1875rem;
  }

  .header__block {
    height: 10rem;
    padding: 2.5rem;
  }

  .header__logo {
    margin-left: 1.25rem;
  }

  .header__logo img {
    height: 71px;
  }

  /* Sized per container width so the line never wraps (the original wrapped below 1200px). */
  .header__headline {
    font-size: 4rem;
  }

  .shops {
    padding: 12px 0 83px;
  }

  .map__dot {
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }

  .header__headline {
    font-size: 5.375rem;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1170px;
  }

  .header__headline {
    font-size: 6.25rem;
  }
}
