.ajax-section {
  margin: 28px 0 clamp(48px, 7vw, 86px);
}
.ajax-section[hidden] { display: none; }
.ajax-title { margin: 0 0 26px; max-width: 590px; }
.ajax-title h3 {
  margin: 6px 0 10px;
  font-size: clamp(2.1rem, 5vw, 3.55rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.055em;
}
.ajax-title p,
.ajax-description {
  color: var(--muted);
  margin: 0;
}
.ajax-packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}
.ajax-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}
.ajax-card.is-selected { border-color: var(--green); }
.ajax-packshot {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  place-items: center;
  align-items: stretch;
  padding: 19px 17px 12px;
  height: clamp(166px, 17vw, 235px);
  border-bottom: 1px solid var(--line);
  background: #fff;
  gap: 7px;
}
.ajax-figure {
  width: 100%;
  margin: 0;
  position: relative;
  min-height: 0;
}
.ajax-figure img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ajax-img-hub { grid-area: 1 / 1 / 3 / 3; }
.ajax-img-smoke { grid-area: 1 / 3 / 2 / 5; }
.ajax-img-keypad { grid-area: 1 / 5 / 2 / 7; }
.ajax-img-motion { grid-area: 2 / 3 / 3 / 4; }
.ajax-img-door { grid-area: 2 / 4 / 3 / 5; }
.ajax-img-homesiren { grid-area: 2 / 5 / 3 / 7; }
.ajax-packshot[data-package="brann"] .ajax-img-hub { grid-area: 1 / 1 / 3 / 4; }
.ajax-packshot[data-package="brann"] .ajax-img-smoke { grid-area: 1 / 4 / 3 / 7; }
.ajax-packshot[data-package="innbrudd"] .ajax-img-motion { grid-area: 1 / 3 / 2 / 5; }
.ajax-packshot[data-package="innbrudd"] .ajax-img-door { grid-area: 2 / 3 / 3 / 5; }
.ajax-unit-count {
  position: absolute;
  right: 2px;
  bottom: 2px;
  border-radius: 20px;
  padding: 0 7px;
  background: var(--cream);
  color: var(--green);
  font-weight: 650;
  font-size: .74rem;
}
.ajax-card-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 19px; }
.ajax-card h4 {
  font-weight: 620;
  font-size: clamp(1.22rem, 2vw, 1.68rem);
  line-height: 1.14;
  letter-spacing: -.04em;
  margin: 0 0 8px;
}
.ajax-description { font-size: .89rem; min-height: 2.8em; }
.ajax-included { margin: 12px 0 19px; color: var(--green); font-size: .84rem; }
.ajax-included summary { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ajax-included ul { padding-left: 18px; margin: 8px 0 0; }
.ajax-card-price { margin: auto 0 13px; }
.ajax-card-price strong, #ajax-total { display: block; font-size: 1.5rem; line-height: 1.17; letter-spacing: -.035em; }
.ajax-card-price small, .ajax-calculation small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: .78rem;
}
.ajax-pick.button { width: 100%; justify-content: space-between; padding: 9px 13px; font-size: .87rem; }
.ajax-pick[aria-pressed="true"] { color: white; background: var(--green); border-color: var(--green); }
.ajax-builder { margin-top: 22px; }
.ajax-dropdown {
  border-radius: 19px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.ajax-dropdown > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  padding: 16px 19px;
  gap: 12px;
  cursor: pointer;
  background: var(--paper);
}
.ajax-dropdown > summary::-webkit-details-marker { display: none; }
.ajax-dropdown > summary:focus-visible { outline-offset: -4px; }
.ajax-dropdown > summary strong { display: block; font-size: 1.04rem; }
.ajax-dropdown > summary small { display: block; color: var(--muted); font-size: .78rem; }
.ajax-chevron {
  width: 10px;
  height: 10px;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin: 0 6px 5px;
}
.ajax-dropdown[open] .ajax-chevron { transform: rotate(225deg); margin-bottom: 0; }
.ajax-dropdown-content { border-top: 1px solid var(--line); }
.ajax-groups {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 11px 14px;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--line);
}
.ajax-groups button {
  border: 1px solid var(--line);
  border-radius: 99px;
  background: white;
  font-size: .77rem;
  padding: 6px 11px;
  min-height: 35px;
  white-space: nowrap;
}
.ajax-groups button[aria-pressed="true"] { color: white; background: var(--green); border-color: var(--green); }
.ajax-options {
  max-height: min(445px, 53vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #abb7af #f6f7f4;
}
.ajax-option {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 17px;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}
.ajax-option:last-child { border-bottom: 0; }
.ajax-option.is-added { background: #f4f7f3; }
.ajax-thumb { height: 66px; background: #fff; border-radius: 8px; padding: 3px; }
.ajax-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ajax-option-name strong, .ajax-option-name small { display: block; }
.ajax-option-name strong { font-size: .94rem; line-height: 1.27; }
.ajax-option-name small, .ajax-option-name p { font-size: .77rem; color: var(--muted); }
.ajax-option-name p { margin: 3px 0 0; }
.ajax-option-action { text-align: right; min-width: 112px; }
.ajax-option-action strong { font-size: .92rem; white-space: nowrap; }
.ajax-option-action small { display: block; color: var(--muted); font-size: .7rem; }
.ajax-quantity { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 4px; }
.ajax-quantity button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--green);
  background: white;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
}
.ajax-quantity button:disabled { opacity: .35; cursor: default; }
.ajax-quantity button:hover:not(:disabled) { border-color: var(--green); }
.ajax-quantity output { min-width: 16px; text-align: center; font-size: .9rem; font-variant-numeric: tabular-nums; }
.ajax-calculation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 16px 3px 4px;
}
.ajax-calculation .button { font-size: .86rem; }
.ajax-price-note, .ajax-credit { color: var(--muted); margin: 9px 0 0; font-size: .8rem; }
.ajax-dropdown-content > .ajax-price-note { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ajax-credit { font-size: .73rem; }
.ajax-summary {
  box-sizing: border-box;
  border: 0;
  border-radius: 22px;
  width: min(520px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  padding: 25px;
}
.ajax-summary::backdrop { background: #1c2823aa; }
.ajax-summary-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ajax-summary h3 { font-size: 1.72rem; margin: 3px 0 12px; letter-spacing: -.045em; line-height: 1.12; }
.ajax-close { background: white; border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; font-size: 1.45rem; line-height: 1; }
.ajax-summary dl { margin: 12px 0; }
.ajax-summary dl div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 9px 0; }
.ajax-summary dd { margin: 0; white-space: nowrap; }
.ajax-summary-total { font-weight: 650; }
.ajax-summary .button { margin-top: 16px; }

@media (max-width: 750px) {
  .ajax-packages { grid-template-columns: 1fr; gap: 13px; }
  .ajax-packshot { height: clamp(155px, 36vw, 215px); padding-inline: 13%; }
  .ajax-description { min-height: 0; }
}
@media (max-width: 500px) {
  .ajax-section { margin-top: 22px; }
  .ajax-option { grid-template-columns: 49px minmax(0, 1fr) auto; padding: 10px 8px; gap: 8px; }
  .ajax-thumb { height: 51px; }
  .ajax-option-name strong { font-size: .84rem; }
  .ajax-option-action { min-width: 96px; }
  .ajax-quantity { gap: 2px; }
  .ajax-quantity button { width: 36px; height: 40px; }
  .ajax-calculation { align-items: flex-start; }
  .ajax-calculation .button { padding: 9px; gap: 4px; min-height: 42px; }
}

@media (max-width: 560px) {
  #ajax-trygghet:not([hidden]) + #cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #ajax-trygghet:not([hidden]) + #cards .card { min-width: 0; overflow-wrap: anywhere; }
  #ajax-trygghet:not([hidden]) + #cards .card-foot .round { flex-shrink: 0; }
}
