/* Mobile touch targets, solid sticky header, and visible focus (WCAG 2.2). */

html {
  scroll-padding-top: 80px;
}

:focus {
  scroll-margin-top: 80px;
}

header.sticky.top-0 {
  background-color: var(--bg, #0b0d10);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid #5f7d8e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Dark ring for light surfaces. #071018 on #f4f7f8 is 17.8:1. */
:focus-visible {
  outline: 3px solid #071018;
  outline-offset: 2px;
}

/* Light ring on the dark page. #e8f4f8 on #0b0d10 is 17.4:1, on #14181e is 15.9:1. */
.bg-bg :focus-visible,
.bg-surface :focus-visible,
header :focus-visible,
footer :focus-visible {
  outline-color: #e8f4f8;
}

.focus\:outline-none:focus-visible {
  outline: 3px solid #e8f4f8;
  outline-offset: 2px;
}

a.overflow-hidden:focus-visible {
  outline-offset: -4px;
}

/* Shop CTAs: was h-9 / text-xs (36px, 12px). */
a.bg-primary.h-9 {
  box-sizing: border-box;
  height: auto;
  min-height: 48px;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

/* One buy button on every page: same radius, weight and text colour as the
   CMS guide button (.cms-shop-btn), "(annons)" in the same small size. */
a.bg-primary.h-9,
.cms-products a.cms-shop-btn {
  border-radius: 0.25rem;
  font-weight: 600;
  color: #071018;
  column-gap: 0.3em;
}

a.bg-primary.h-9 small,
.cms-products a.cms-shop-btn small {
  font-size: 0.8em;
  font-weight: 600;
}

@media (max-width: 480px) {
  li.flex:has(> a.bg-primary.h-9) {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  /* Name and shop on their own row, then price + button. */
  li.flex:has(> a.bg-primary.h-9) {
    width: 100%;
  }

  li.flex:has(> a.bg-primary.h-9) > div.flex-1 {
    flex-basis: 100%;
  }

  li.flex:has(> a.bg-primary.h-9) > a.bg-primary.h-9 {
    flex-grow: 1;
  }

  .cms-products a.cms-shop-btn {
    width: 100%;
  }
}

.cms-products a.cms-shop-btn {
  box-sizing: border-box;
  min-height: 48px;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
}

.cms-products span.annons {
  opacity: 1;
}

#mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

@media (max-width: 767px) {
  footer a.block {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .shop-compare {
    overflow: visible;
  }

  .shop-compare table,
  .shop-compare tbody,
  .shop-compare tr,
  .shop-compare td {
    display: block;
    width: 100%;
  }

  .shop-compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .shop-compare tr {
    margin: 0 0 0.75rem;
    padding: 0.75rem 0 0.85rem;
    border: 1px solid #5f7d8e;
    border-radius: var(--radius-md, 0.35rem);
    background: var(--surface, #14181e);
  }

  .shop-compare td {
    border: 0;
    padding: 0.2rem 0.75rem;
    text-align: left;
  }

  .shop-compare td:last-child {
    padding-top: 0.65rem;
  }

  .shop-compare td:last-child a {
    width: 100%;
  }
}


/* Guide snabbval (above-the-fold CTA after ingress) */
.early-cta {
  margin: 1rem 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
.early-cta-pick { margin: 0 0 0.75rem; line-height: 1.4; text-wrap: pretty; font-size: 1rem; }
.early-cta-lead { font-weight: 700; }
.early-cta-actions { margin: 0; }
.early-cta-actions .cms-shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1rem;
  width: 100%;
  box-sizing: border-box;
  text-wrap: balance;
  white-space: normal;
}

/* Produktsida: bildkolumnen följer bildens höjd i stället för att sträckas
   till textkolumnens höjd (gav tomt mörkt fält under bilden). */
.pdp-media {
  align-self: start;
  min-width: 0;
}
.pdp-media:is(.overflow-hidden),
.pdp-media > .overflow-hidden {
  aspect-ratio: 1 / 1;
}
.pdp-media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
@media (min-width: 1024px) {
  .pdp-media {
    position: sticky;
    top: 1.5rem;
  }
}
