:root {
  --ser-color-primary: #545b5c;
  --ser-color-secondary: #999a97;
  --ser-color-bg: #ebe6e3;
  --ser-color-header: #ded8d3;
  --ser-color-text: #2b2b2b;
  --ser-color-muted: #545b5c;
}

/* Banner height is measured at runtime by inline-script.js and written
   to --ser-banner-h on <html>. Defaults to 41px before JS runs. */
:root {
  --ser-banner-h: 41px;
  --ser-header-h: 95px;
}

.ser-header {
  background: var(--ser-color-header);
  position: relative;
  z-index: 200;
  /* Spacer = current banner height + header height so content sits below the
     fixed banner+header stack regardless of how tall the banner happens to be. */
  min-height: calc(var(--ser-banner-h) + var(--ser-header-h));
}

/* Sticky announcement banner + header
   Both fixed at top, banner above header */
.opening-hours-banner.is-visible {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.site-header-inner {
  position: fixed;
  top: var(--ser-banner-h);
  left: 0;
  width: 100%;
  z-index: 999;
  background: #ded8d3;
  transition: background-color 0.3s ease;
}

.site-header-inner.is-scrolled {
  background-color: rgba(222, 216, 211, 0.95);
}

/* When logged in, offset for admin bar */
.admin-bar .opening-hours-banner.is-visible {
  top: 32px;
}

/* Override Tactica Opening Hours plugin's hardcoded #2c2c2c.
   Slightly lighter than the original dark, same hue family as the
   brand gray (#545b5c) so it blends with the rest of the palette. */
.opening-hours-banner,
.opening-hours-banner .banner-dropdown {
  background: #3a3f40 !important;
}

.admin-bar .site-header-inner {
  top: calc(32px + var(--ser-banner-h));
}

/* Mobile: tighten typography so the full banner text wraps as compactly as
   possible. When it does need to wrap to a second line, the dynamic
   --ser-banner-h (set by the plugin's JS) keeps the header positioned
   directly below the actual banner height so nothing gets covered. */
@media (max-width: 640px) {
  .opening-hours-banner {
    padding: 6px 12px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
  }
  .opening-hours-banner .banner-today {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
  }
  /* Drop the "·" separator on mobile — looks dangling when the two shops
     wrap onto separate lines. The plugin's inline <style> block uses the
     same selector with equal specificity and is parsed later, so the
     override needs !important to win the cascade. */
  .opening-hours-banner .banner-today .banner-today-shop + .banner-today-shop::before {
    content: none !important;
  }
}

.ser-header .ser-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.ser-header .site-branding img {
  max-width: 300px;
  height: auto;
  display: block;
}

.ser-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.ser-nav__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.ser-nav__item > .ser-nav__link {
  margin-left: 20px;
  margin-right: 20px;
}

.ser-nav__item {
  position: relative;
}

/* [Nav] Main menu links — match live: granville serif, 16px, 500 */
.ser-nav__link {
  font-family: granville, serif;
  font-size: 16px;
  line-height: 60px;
  font-weight: 500;
  color: var(--ser-color-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  word-break: normal;
}

.ser-nav__link::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
  opacity: 0.6;
  display: inline-block;
}

.ser-nav__item:not(.ser-has-mega) .ser-nav__link::after {
  display: none;
}

.ser-nav__search {
  display: none;
}

.ser-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ser-search input[type="search"] {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 14px;
}

.ser-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ser-tool {
  color: var(--ser-color-text);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.ser-tool--search {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.dgwt-wcas-style-pirx.dgwt-wcas-search-filled .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
  font-family: granville;
}

/* On mobile, hide the desktop FiboSearch (mobile sidebar has its own search) */
@media (max-width: 1024px) {
  .ser-tool--search {
    display: none;
  }
}

.ser-tool--cart {
  position: relative;
}

.ser-tool--cart svg {
  width: 20px;
  height: 20px;
}

.ser-cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-family: granville, serif;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  background: var(--ser-color-primary);
  border-radius: 50%;
  padding: 0 3px;
}

.ser-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 210;
  min-width: 44px;
  min-height: 44px;
}

.ser-nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ser-color-primary);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Close button inside sidebar (hidden on desktop) */
.ser-nav-close {
  display: none;
}

.ser-has-mega {
  position: static;
}

.ser-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--ser-color-bg);
  box-shadow: 0 2px 8px rgba(125, 122, 122, 0.2);
  border-radius: 4px;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Invisible bridge so mouse can travel from nav link down to dropdown */
.ser-mega::before {
  content: "";
  position: absolute;
  top: -25px;
  left: 0;
  right: 0;
  height: 25px;
}

/* JS adds .is-mega-open class with a delay on mouseleave */
.ser-has-mega.is-mega-open > .ser-mega,
.ser-has-mega:focus-within > .ser-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ser-mega__inner {
  --ser-mega-cols: 4;
  max-width: 100%;
  margin: 0 auto;
  padding: 50px;
  display: grid;
  grid-template-columns: repeat(var(--ser-mega-cols), minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.ser-mega__inner--five {
  --ser-mega-cols: 5;
}

.ser-mega__inner--four {
  --ser-mega-cols: 4;
}

.ser-mega__inner--two {
  --ser-mega-cols: 2;
}

.ser-mega__col h3,
.ser-mega__col h3 a,
.ser-nav .ser-mega__col h3,
.ser-nav .ser-mega__col h3 a {
  font-family: "ivypresto-display", serif !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  line-height: 24px !important;
  color: var(--ser-color-primary);
  margin: 0 0 20px;
}

.ser-mega__col h3 a {
  color: inherit;
  text-decoration: none;
  margin: 0;
}

.ser-mega__col h3 a:hover,
.ser-mega__col h3 a:focus {
  color: var(--ser-color-primary);
}

.ser-mega__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  row-gap: 0;
}

.ser-mega__col--split h3 {
  white-space: nowrap;
}

.ser-mega__col--split ul {
  column-count: 2;
  column-gap: 48px;
  display: block;
}

.ser-mega__col--split ul li {
  break-inside: avoid;
}

/* [Mega menu] Dropdown links — match live: granville serif, 15px, 500 */
.ser-mega__col li a {
  font-family: granville, serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  color: var(--ser-color-muted);
  text-decoration: none;
  display: block;
  padding: 8px 0;
  white-space: normal;
}

.ser-mega__col li a:hover,
.ser-mega__col li a:focus {
  color: var(--ser-color-primary);
}

.ser-mega__image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 300px;
  object-fit: cover;
}

/* ── Verklýsingar captioned image columns ── */

.ser-mega__image.ser-mega-image--verklysingar-1,
.ser-mega__image.ser-mega-image--verklysingar-2,
.ser-mega__image.ser-mega-image--verklysingar-3 {
  max-width: 200px;
}

.ser-mega__image.ser-mega-image--verklysingar-1 img,
.ser-mega__image.ser-mega-image--verklysingar-2 img,
.ser-mega__image.ser-mega-image--verklysingar-3 img {
  width: 200px;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
}

.ser-mega__caption {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ser-color-text, #1e1e1e);
  line-height: 1.3;
}

.ser-mega__image a {
  text-decoration: none;
  color: inherit;
}

.ser-mega__image a:hover .ser-mega__caption {
  color: var(--ser-color-primary);
}

.ser-mega__spacer {
  display: none;
}

.ser-sub-toggle {
  display: none;
}

/* Desktop: hide mobile menu list and mobile search */
.ser-nav__list--mobile {
  display: none;
}
.ser-mobile-search {
  display: none;
}

/* Tablet: reduce nav margins to prevent overflow.
   Font size stays at 16px — only margins shrink. */
@media (max-width: 1350px) and (min-width: 1025px) {
  .ser-nav__item > .ser-nav__link {
    margin-left: 12px;
    margin-right: 12px;
  }

  .ser-header .ser-container {
    gap: 16px;
  }

  .ser-header .site-branding img {
    max-width: 240px;
  }

  .ser-mega__inner {
    padding: 30px 20px;
    gap: 16px;
  }
}

/* Narrower desktop: tighter margins 1025–1150px */
@media (max-width: 1150px) and (min-width: 1025px) {
  .ser-nav__item > .ser-nav__link {
    margin-left: 6px;
    margin-right: 6px;
  }

  .ser-header .ser-container {
    gap: 12px;
    padding: 15px 16px;
  }

  .ser-header .site-branding img {
    max-width: 200px;
  }
}

/* Mobile: sidebar navigation replaces desktop nav */
@media (max-width: 1024px) {
  .ser-header .ser-container {
    padding: 12px 16px;
    justify-content: space-between;
  }

  .ser-header .site-branding {
    flex: 1 1 auto;
    text-align: center;
  }

  .ser-header .site-branding img {
    max-width: 180px;
    margin: 0 auto;
  }

  .ser-nav-toggle {
    display: inline-flex;
    order: -1;
  }

  .ser-tools {
    order: 1;
  }

  /* Overlay backdrop */
  .ser-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 299;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .ser-header.is-mobile-open .ser-nav-overlay {
    opacity: 1;
    visibility: visible;
  }

  /* Sidebar slides in from the left (matching LIVE) */
  .ser-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: 380px;
    max-width: 85vw;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 0;
    overflow-y: auto;
    justify-content: flex-start;
    flex-direction: column;
    z-index: 300;
  }

  .ser-header.is-mobile-open .ser-nav {
    transform: translateX(0);
  }

  /* Close button */
  .ser-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ser-color-text);
    z-index: 10;
    padding: 0;
  }

  .ser-nav-close:hover {
    color: var(--ser-color-secondary);
  }

  .ser-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 60px 24px 40px;
    margin: 0;
  }

  .ser-nav__item {
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }

  .ser-nav__link {
    width: 100%;
    line-height: 1.6;
    padding: 14px 0;
    font-size: 15px;
  }

  /* Hide dropdown arrow on mobile links */
  .ser-nav__link::after {
    display: none;
  }

  .ser-nav__search {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 16px;
    margin-bottom: 0;
  }

  .ser-search input[type="search"] {
    width: 100%;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 12px 14px;
    border-radius: 2px;
    font-size: 14px;
    font-family: granville, serif;
  }

  /* Mega menu accordion in sidebar */
  .ser-mega {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: transparent;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: none;
  }

  .ser-mega::before {
    display: none;
  }

  .ser-has-mega.is-open > .ser-mega {
    max-height: 2000px;
    padding-bottom: 20px;
  }

  .ser-mega__inner,
  .ser-mega__inner--five,
  .ser-mega__inner--four,
  .ser-mega__inner--two {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 10px 0;
  }

  .ser-mega__col h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .ser-mega__col li a {
    font-size: 13px;
    padding: 3px 0;
  }

  /* Accordion toggle (+/–) */
  .ser-sub-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    position: absolute;
    right: 0;
    top: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 0;
  }

  .ser-sub-toggle::before {
    content: "+";
    font-size: 20px;
    font-weight: 300;
    color: var(--ser-color-text);
  }

  .ser-has-mega.is-open > .ser-sub-toggle::before {
    content: "\2212";
  }

  /* Hide mega-menu image columns in sidebar */
  .ser-mega__image {
    display: none;
  }

  .ser-mega__spacer {
    display: none;
  }

  /* Prevent body scroll when sidebar is open */
  body.ser-sidebar-open {
    overflow: hidden;
  }

  /* Mobile FiboSearch in sidebar — full search bar */
  .ser-mobile-search {
    display: block;
    padding: 60px 24px 0;
    width: 100%;
  }

  .ser-mobile-search .dgwt-wcas-search-wrapp {
    width: 100%;
    max-width: 100%;
  }

  .ser-mobile-search .dgwt-wcas-search-wrapp input[type="search"].dgwt-wcas-search-input {
    width: 100%;
    font-family: granville, serif;
    font-size: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 2px;
  }

  .ser-mobile-search .dgwt-wcas-sf-wrapp {
    width: 100%;
  }

  /* Hide the icon-mode search trigger and submit button inside mobile sidebar */
  .ser-mobile-search .dgwt-wcas-search-icon,
  .ser-mobile-search .js-dgwt-wcas-search-icon-handler,
  .ser-mobile-search .dgwt-wcas-enable-mobile-form,
  .ser-mobile-search .dgwt-wcas-search-submit {
    display: none !important;
  }

  /* ── Mobile menu list (standard WP submenus) ── */
  .ser-nav__list--desktop {
    display: none;
  }

  .ser-nav__list--mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    list-style: none;
    gap: 0;
    width: 100%;
    padding: 16px 24px 40px;
    margin: 0;
  }

  .ser-nav__list--mobile li {
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    position: relative;
    list-style: none;
  }

  .ser-nav__list--mobile li a {
    font-family: granville, serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    padding: 14px 0;
    color: var(--ser-color-text);
    text-decoration: none;
    display: block;
  }

  .ser-nav__list--mobile .sub-menu {
    display: none;
    padding-left: 16px;
    margin: 0;
  }

  .ser-nav__list--mobile .menu-item-has-children.is-open > .sub-menu {
    display: block;
  }

  .ser-nav__list--mobile .sub-menu li {
    border-bottom: none;
  }

  .ser-nav__list--mobile .sub-menu li a {
    font-size: 14px;
    font-weight: 400;
    padding: 8px 0;
    color: var(--ser-color-muted);
  }

  .ser-nav__list--mobile .sub-menu .sub-menu li a {
    font-size: 13px;
    padding: 5px 0;
  }

  /* Mobile submenu toggle button */
  .ser-mobile-sub-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    position: absolute;
    right: 0;
    top: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    font-weight: 300;
    color: var(--ser-color-text);
  }
}

@media (max-width: 768px) {
  .ser-header .site-branding img {
    max-width: 160px;
  }
}

@media (max-width: 480px) {
  .ser-header .ser-container {
    padding: 10px 12px;
  }

  .ser-header .site-branding img {
    max-width: 140px;
  }
}