:root {
  --menu-animation-speed: 0.3s;
}

#desktop-menu {
    display: none;
}

/* Prevent elements from highlighting up blue on tap event */
.no-highlight :active {
  outline: none;
  outline-style:none;
  user-select: none;
  -webkit-tap-highlight-color:transparent;
  tap-highlight-color: transparent;
}

/* Nothing else works while a pop-up menu is open */
body.disable-pointer-events {
  pointer-events: none;
}
body.disable-pointer-events .menu, body.disable-pointer-events .menu * {
  pointer-events: auto;
}

/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 20; /* Sit on top */
  width: 100svw; /* Full width */
  height: 100svh; /* Full height */
  overflow: auto; /* Enable scrolling */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.3); /* Black w/ opacity */
  align-items: flex-start;
  justify-content: center;
  align-items: center;
}


.modal #modal-dialog-box {
  display: flex;
  height: initial;
  position: unset;
  flex-direction: column;
  width: 70svw;
  max-width: 60em;
  max-height: 80svh;
  background-color: white;
  padding: 1.5em;
  box-shadow: 3px 3px 12px gray;
  border-radius: 0.2em;
  overflow: hidden;
  word-break:normal;
  overflow: auto;
}

.modal #modal-dialog-box h1 {
  font-size: 1.2em;
}

.modal li span {
  display: none;
}

.modal #modal-dialog-box p {
  margin: 0;
  padding: 0.1em;
  font-size: 1em;
  line-height: 125%;
}

.modal ul {
  list-style-type: none;
  margin: 0;
  padding: 0.1em;
  line-height: 125%;
  display: grid;
  grid-template-columns: auto max-content max-content;
  column-gap: 0.5em;
  row-gap: 0.75em;
}

.modal ul li {
  display: contents;
  gap: 12px;
}

.modal ul li p:nth-child(3)::before {
  content: "x";
}

.modal ul li p:nth-child(5)::after {
  content: " €";
}

.modal p#total-charged {
  padding-top: 1em;
  margin-top: 1em;
  border-top: 1px dotted black;
}

.modal p#total-charged::after {
  content: " €";
}







.modal #modal-buttons {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-top: 2em;
  gap: 1em;
}

.modal #modal-buttons div {
  display: flex;
  background-color: silver;
  padding: 0.5em 1em;
  flex-grow: 1;
  flex-shrink: 0;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.modal #modal-buttons div:last-of-type {
   background-color: rgb(72, 72, 107);
   color: white;
}

.modal #modal-dialog-box.small p {
  display: flex;
}

#search-input-bar {
  box-sizing: border-box;
  z-index: 10;
  position: absolute;
  height: 100%;
  animation: fold-out linear 0.2s;
  animation-fill-mode: forwards;
  padding: 0.5em;
  margin: 0;
  left: 3em;
  align-items: center;
}
@keyframes fold-out {
  from {
    width: calc(0em);
  }
  to {
    width: calc(100% - 7em);
  }
}

#search-input-bar input {
  position: relative;
  font-size: 1em;
  box-sizing: border-box;
  height: 100%;
  animation: fold-out-input linear 0.2s;
  animation-fill-mode: forwards;
}
@keyframes fold-out-input {
  from {
    width: calc(100%);
    padding-right: 0em;
    padding-left: 0em;
  }
  to {
    width: calc(100% - 1em);
    padding-right: 1.75em;
    padding-left: 0.5em;
  }
}

#search-input-bar p {
  position: absolute;
  right: 2.5em;
  top: 0.35em;
  font-size: 0.75em;
  animation: fold-out-x-cancel linear 0.2s;
  animation-fill-mode: forwards;
  cursor: pointer;
}
@keyframes fold-out-x-cancel {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

#search-results {
  box-sizing: border-box;
  font-size: 1em;
  color: black;
  -display: flex;
  position: relative;
  background-color: white;
  -margin: 0.5em -0.5em 0.5em 0.5em;
  width: calc(100% + 2em);
  padding: 0.5em 1em;
  border-radius: 0.5em;
  border: 1px solid rgb(185, 185, 185);
}

#search-results a {
  line-height: 2em;
  text-decoration: none;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

#search-results a:hover {
  background-color: #cfcfcf;
}

#search-results a:not(a:first-child) {
  z-index: 10;
  border-top: 1px solid rgb(185, 185, 185);
}

.disabled {
  pointer-events: none;
}

.blurred {
  filter: blur(3px);
  overflow: hidden;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

/* Main app - middle of the page - injected content */
main#app {
  display: block;
  box-sizing: border-box;
  -margin: 0.75em 0.75em 0em 0.75em;
  flex: 1;
}

.hidden {
  display: none;
}

/* Alt-text for images, transparent */
img[alt] {
  color: #00000000;
}


/* Top menu; at the top of the page (not the main menu) */
header.top-menu {
  user-select: none;
  display: flex;
  box-sizing: border-box;
  justify-content: space-between;
  position: relative;
  background: #8d8d8d;
  color: #fff;
  height: 3em;
  padding: 0 0.85em;
  flex-shrink: 0;
}

header.top-menu img:active {
  --background-color: yellow;
  filter: invert(100%) sepia(100%);
  color: white;
  margin: 21px solid pink;
}

header.top-menu div.block {
  height: 100%;
  display: flex;
  gap: 0.85em;
}

header.top-menu div.block a {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  display: flex;
  height: 100%;
  align-items: center;
}

header.top-menu div.block a img {
  height: 50%;
}


header.top-menu div.block.middle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);  
}

/* Language selector flag */
nav.mainmenu img {
  user-select: none;
  position: absolute;
  right: 0;
  height: 1.1em;
  margin: 0.9em 1em;
  cursor: pointer;
  z-index: 9;
  float: right;
  object-fit: cover;
  width: 1.6em;
  opacity: 0;
}

/* Hambuger menu icon container */
nav.mainmenu #menu-icon {
  user-select: none;
  position: absolute;
  display: inline;
  font-size: 2em;
  cursor: pointer;
  z-index: 9;
  padding: 0em 0.2em;
}


nav.mainmenu #menu-icon:active {
  outline: none;
  outline-style: none;
  -webkit-tap-highlight-color: transparent;
}
nav.mainmenu #menu-icon img:active {
  outline: none;
  outline-style: none;
  -webkit-tap-highlight-color: transparent;
}

/* Always-invisible toggle helper */
nav.mainmenu input[type="checkbox"] {
  display: none;
  -display: block;
  user-select: none;
}

/* On-click main menu animation styling */
nav.mainmenu input[type="checkbox"].animate:checked ~ ul {
  transform: translateX(0%);
  animation: var(--menu-animation-speed) ease-out;
  animation-name: main-menu-slide-in;
  animation-fill-mode: forwards;
}
@keyframes main-menu-slide-in {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(0%);
  }
}

/* On-close main menu animation */
nav.mainmenu input[type="checkbox"].animate:not(:checked) ~ ul.unsealed {
  animation: var(--menu-animation-speed) ease-out;
  animation-name: main-menu-slide-out;
  animation-fill-mode: forwards;
}
@keyframes main-menu-slide-out {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-110%);
  }
}


/* On-click bring in opacity when menu is opened */
nav.mainmenu input[type="checkbox"].animate:checked + label + ul > li {
  opacity: 1;
  animation: var(--menu-animation-speed) ease-in;
  animation-name: main-menu-items-fade-in;
  animation-fill-mode: forwards;
}
@keyframes main-menu-items-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
    animation: none;
  }
}

/* Reset opacity when menu is closed */
nav.mainmenu input[type="checkbox"].animate:not(:checked) + label + ul > li {
  opacity: 0;
  animation: var(--menu-animation-speed) ease-out;
  animation-name: main-menu-items-fade-out;
  animation-fill-mode: forwards;
}
@keyframes main-menu-items-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    animation: none;
  }
}

nav.mainmenu {
  background: #333;
  color: #fff;
  height: 3em;
}

/* Main menu container */
nav.mainmenu ul {
  opacity: 1;
  position: relative;
  background-color: #4e4e4e;
  display: inline-block;
  border-radius: 0 0em 1em 0;
  top: 3em;
  left: 0;
  margin: 0px;
  transform: translateX(-110%);
  animation: 0.3s ease-in;
  box-shadow: 0.5px 0.5px 0.3em #000;
}

/* Main menu items' font size */
nav.mainmenu a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1em;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;  
  border-bottom: 1px solid #cccccc44;
}

/* Individual items, outermost parent object */
nav.mainmenu .nav-links {
  list-style: none;
  user-select: none;
  padding: 0;
  z-index: 2;
}

nav.mainmenu .nav-links li {
  padding: 0.75em;
  margin: 0.05em;
  flex-grow: 8;
}

/* Expand down arrow, "unfold" symbol */
nav.mainmenu .nav-links div.expand-arrow {
  align-items: stretch;
  border-top: 0.4em solid currentColor;
  border-left: 0.4em solid transparent;
  border-right: 0.4em solid transparent;
  margin: 0.4em;
  align-self: center;
  transition: transform 0.5s;
  transform: rotate(0deg);
}

nav.mainmenu .nav-links div.expand-arrow.open {
  transition: transform 0.5s;
  transform: rotate(90deg);
}

nav.mainmenu .submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

nav.mainmenu .submenu a {
  background-color:#606060;
  padding-left: 1.5em;
  padding-right: 1.5em;
}

nav.mainmenu .nav-links div > div.folded {
  max-height: 0px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}


nav.mainmenu .nav-links a:hover {
  background-color: #7a7a7a;
}

/* The menu is curved at the bottom, follow this shape */
nav.mainmenu .nav-links:hover > div:last-child a {
  border-radius: 0 0em 1em 0;
}

nav.mainmenu .nav-links li span {
  display: flex;
  justify-content: space-between;
}


body {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  z-index: 3;
}


footer {
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  background-color: #333;
  height: 4em;
  color: white;
  font-size: 0.75em;
  align-items: center;
  justify-content: center;  
  --margin-top: 3em;
}

@media (min-width: 640px) {
  
  header.top-menu div.block a img[src="/frontend/graphics/icon-static.svg"] {
    display: none;
  }
}

@media (max-width: 641px) {
  header.top-menu div.block a img[src="/frontend/graphics/logo1.svg"] {
    display: none;
  }
}

@media (min-width: 800px) {
    .compactmenu {
        display: none;
    }

    .compactmenu * {
        display: none;
    }

    #desktop-menu {
        all: unset;
        position: relative;
        display: flex;
        justify-content: space-between;
        height: 3em;
        width: calc(100% - 4em);
        transform: none;
        align-items: center;
        justify-content: space-around;
    }

    #desktop-menu * {
        all: unset;
        position: relative;
        top: 0;
        margin: 0;
        padding: 0;
    }

    nav.mainmenu {
        display: flex;
        justify-content: flex-start;
    }

    #desktop-menu  a {
        cursor: pointer;
    }

    #desktop-menu .submenu a {
        cursor:pointer;
        display: flex;
        flex-direction: row;
        white-space: nowrap;
        padding: 1em 2em 1em 2em;
        border-bottom: 1px solid #cccccc44;
        border-radius: 0;
    }


    #desktop-menu .submenu a:last-of-type {
        border-bottom: none;
        border-radius: 0;
    }

    #desktop-menu > div {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        justify-content: center;
        justify-items: center;
        text-align: center;
    }

    #desktop-menu > div > a {
        height: 100%;
        align-content: center;
        transition: background-color 0.2s;
    }

    
    #desktop-menu > div > a:hover {
        height: 100%;
        background-color: #7a7a7a;
        align-content: center;
        transition: background-color 0.2s;
    }


    #desktop-menu:has(a[href="/shop"]) .submenu {
        min-width: calc(100% - 4px);
        display: none;
        justify-items: center;
        justify-content: center;
        flex-direction: column;
        position: absolute;
        --gap: 0.5em;
        top: 3em;
        --left: -1em;
        color: white;
        background-color: #4E4E4E;
        border: 2px solid #4E4E4E;
        border-radius: 0 0em 1em 1em;

        & a:last-of-type {
            border-radius: 0 0em 1em 1em;
        }

        & a:hover {
            background-color: #7a7a7a;
        }
    }

    #desktop-menu:has(a[href="/shop"]:hover) .submenu {
        display: flex;
    }

    #desktop-menu:has(a[href="/shop"]) .submenu:hover {
        display: flex;
        --background-color: red;
    }

    #desktop-menu:has(a[href="/shop"]) .submenu {
        display: none;
        --background-color: red;
    }


}