/* X-Opta Fabrikanter — 0.1.0-beta6 */
.xof-overview,
.xof-detail{
  width:100%;
  min-width:0;
  box-sizing:border-box;
}
.xof-detail{background:rgb(245,245,245)}

/* Fabrikantoversikt */
body.x-opta-fabrikanter-overview-page,
body.x-opta-fabrikanter-overview-page #main,
body.x-opta-fabrikanter-overview-page .page-wrapper,
body.x-opta-fabrikanter-overview-page .page-inner{
  background:#f5f5f5!important;
}
.xof-overview{
  background:#f5f5f5;
}
.xof-overview__header{
  max-width:860px;
  margin:0 auto 52px;
  text-align:center;
}
.xof-overview__header h1{
  margin:0 0 16px;
  font-size:clamp(36px,4vw,50px);
  line-height:1.05;
  font-weight:500;
}
.xof-overview__intro{
  font-size:18px;
  line-height:1.55;
}
.xof-overview__intro>:last-child{margin-bottom:0}

.xof-grid{
  display:grid;
  grid-template-columns:repeat(var(--xof-columns,4),minmax(0,1fr));
  gap:var(--xof-gap,10px);
  width:100%;
}
.xof-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:250px;
  padding:28px 22px 23px;
  background:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
  color:#151515!important;
  text-align:center;
  text-decoration:none!important;
  box-sizing:border-box;
  transition:box-shadow .16s ease,transform .16s ease;
}
.xof-card:hover{box-shadow:0 5px 16px rgba(0,0,0,.12);transform:translateY(-1px)}
.xof-card:focus-visible{outline:2px solid #252525;outline-offset:-3px}
.xof-card__logo{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:122px;
  margin-bottom:16px;
}
.xof-card__logo-image{
  display:block;
  width:auto!important;
  height:auto!important;
  max-width:min(86%,240px)!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
}
.xof-card__logo-fallback{
  max-width:100%;
  font-size:clamp(24px,3vw,38px);
  line-height:1;
  font-weight:700;
  overflow-wrap:anywhere;
}
.xof-card__name{
  display:block;
  font-size:13px;
  line-height:1.35;
  font-weight:500;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.xof-card__meta{
  display:flex;
  align-items:baseline;
  justify-content:center;
  flex-wrap:wrap;
  column-gap:7px;
  row-gap:2px;
  margin-top:8px;
  color:#444;
  font-size:13px;
  line-height:1.35;
}
.xof-card__link{text-decoration:underline;text-underline-offset:2px}
.xof-empty{
  padding:14px 16px;
  background:#fff8e6;
  border-left:4px solid #d6a800;
}

/* Virtuell fabrikantside */
main .xof-page-main{background:#f5f5f5 !important}
.xof-page-main.xof-fabrikant-main{background:rgb(245,245,245)}
.xof-page-container{
  width:min(100% - 32px,1430px);
  margin:0 auto;
  padding:38px 0 70px;
}
.xof-fabrikant-main .xof-page-container{padding:28px 18px}


.xof-detail__intro-section{
  margin:40px 0 32px;
  padding:0;
  background:rgb(245,245,245);
}
.xof-detail__intro-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(310px,430px);
  gap:clamp(34px,5vw,72px);
  align-items:start;
}
.xof-detail__intro-section:not(.xof-detail__intro-section--with-aside) .xof-detail__intro-grid{
  grid-template-columns:minmax(0,1fr);
}
.xof-detail__brand{
  min-width:0;
  padding:6px 0 14px;
}
.xof-detail__title{
  margin:0 0 20px;
  max-width:760px;
  color:#1f1f1f;
  font-size:clamp(38px,5vw,64px);
  line-height:1;
  font-weight:600;
}
.xof-detail__title--logo{
  display:flex;
  align-items:center;
  width:300px;
  margin-bottom:22px;
}
.xof-detail__title--logo img{
  display:block;
  width:auto!important;
  height:auto!important;
  max-width:min(100%,380px)!important;
  max-height:92px!important;
  margin:0!important;
  object-fit:contain!important;
  object-position:left center!important;
}
.xof-detail__intro{
  max-width:900px;
  color:#303030;
  font-size:16px;
  line-height:1.62;
}
.xof-detail__intro>:first-child{margin-top:0}
.xof-detail__intro>:last-child{margin-bottom:0}
.xof-detail__total{
  margin:16px 0 0;
  color:#666;
  font-size:14px;
  line-height:1.4;
}

.xof-detail__aside{
  min-width:0;
  margin-top:25px;
  padding:25px 27px 27px;
  background:#fff;
  border:1px solid #d1d1d1;
  box-sizing:border-box;
}
.xof-detail__aside-title{
  margin:0 0 14px;
  color:#333;
  font-size:18px;
  line-height:1.3;
  font-weight:500;
}
.xof-detail__aside-text{
  color:#444;
  font-size:14px;
  line-height:1.6;
}
.xof-detail__aside-text>:first-child{margin-top:0}
.xof-detail__aside-text>:last-child{margin-bottom:0}
.xof-detail__links{margin-top:15px}
.xof-detail__links ul{
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  margin:0;
  padding:0;
  list-style:none;
}
.xof-detail__links li{margin:0;padding:0}
.xof-detail__links a{
  color:#4e88bd;
  font-size:14px;
  line-height:1.45;
  text-decoration:none;
}
.xof-detail__links a:hover{text-decoration:underline;text-underline-offset:2px}

.xof-detail__gallery{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:20px;
}
.xof-detail__gallery--1{grid-template-columns:minmax(0,1fr)}
.xof-detail__gallery--2{grid-template-columns:repeat(2,minmax(0,1fr))}
.xof-detail__gallery-item{
  position:relative;
  display:block;
  min-width:0;
  aspect-ratio:4/3;
  overflow:hidden;
  background:#efefef;
  border:1px solid #e0e0e0;
}
.xof-detail__gallery-item:focus-visible{outline:2px solid #222;outline-offset:2px}
.xof-detail__gallery-item img{
  display:block;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  object-fit:cover!important;
  object-position:center!important;
  transition:transform .18s ease;
}
.xof-detail__gallery-item:hover img{transform:scale(1.02)}

/* Produktseksjoner */
.xof-detail__sections{
  display:grid;
  gap:48px;
  padding-top:2px;
}
.xof-product-section{min-width:0;margin:0}
.xof-product-section>.opta-product-block__header{
  display:block!important;
  width:100%;
  margin-bottom:18px;
}
.xof-product-section .opta-product-block__title{
  margin:0;
  color:#292929;
  font-size:clamp(23px,2.2vw,31px);
  line-height:1.15;
  font-weight:500;
}
.xof-product-section__excerpt{
  display:block;
  width:100%;
  margin:5px 0 0;
  max-width:900px;
  color:#5a5a5a;
  font-size:15px;
  line-height:1.5;
  font-weight:400;
}
.xof-product-section--grid .opta-product-block__grid{
  display:grid;
  grid-template-columns:repeat(var(--opta-grid-columns-desktop,4),minmax(0,1fr));
  gap:var(--opta-scroller-gap,16px);
  align-items:stretch;
}
.xof-product-section .opta-product-block__item{min-width:0}
.xof-product-section .product-small.col{
  width:100%!important;
  max-width:100%!important;
  flex-basis:100%!important;
  box-sizing:border-box;
}
.xof-detail__footer{
  display:flex;
  justify-content:center;
  margin-top:52px;
}
.xof-detail__footer .button{margin:0}

@media(min-width:850px) and (max-width:1100px){
  .xof-grid{grid-template-columns:repeat(var(--xof-tablet-columns,3),minmax(0,1fr))}
  .xof-product-section--grid .opta-product-block__grid{grid-template-columns:repeat(var(--opta-grid-columns-tablet,3),minmax(0,1fr))}
  .xof-detail__intro-grid{grid-template-columns:minmax(0,1fr) minmax(280px,360px);gap:34px}
}

@media(max-width:849px){
  .xof-grid{grid-template-columns:repeat(var(--xof-mobile-columns,2),minmax(0,1fr))}
  .xof-product-section--grid .opta-product-block__grid{grid-template-columns:repeat(var(--opta-grid-columns-mobile,2),minmax(0,1fr))}
  .xof-overview__header{margin-bottom:34px}
  .xof-detail__intro-grid{grid-template-columns:1fr;gap:24px}
  .xof-detail__brand{padding-bottom:0}
  .xof-detail__aside{padding:22px}
  .xof-fabrikant-main .xof-page-container{padding:18px 0px}
}

@media(max-width:549px){
  .xof-overview__header h1{font-size:36px}
  .xof-overview__intro{font-size:16px}
  .xof-card{min-height:178px;padding:17px 10px 15px}
  .xof-card__logo{height:82px;margin-bottom:10px}
  .xof-card__name,.xof-card__meta{font-size:11px}
  .xof-card__meta{display:block}
  .xof-card__link{display:block;margin-top:2px}
  .xof-page-container{width:min(100% - 20px,1430px);padding:22px 0 50px}
  .xof-detail__intro-section{margin-bottom:28px}
  .xof-detail__title{font-size:38px}
  .xof-detail__title--logo{min-height:58px;margin-bottom:18px}
  .xof-detail__title--logo img{max-width:min(100%,280px)!important;max-height:72px!important}
  .xof-detail__intro{font-size:15px;line-height:1.58}
  .xof-detail__aside{padding:20px}
  .xof-detail__gallery{gap:6px}
  .xof-detail__sections{gap:40px}
  .xof-fabrikant-main .xof-page-container{padding:4px 4px;}
  .xof-detail__intro-section{margin:20px 0 32px;padding:0;background:rgb(245,245,245);}
}


/* Beta6: grid på desktop, horisontal scroller på mobil */
.xof-product-section--mobile-scroller .xof-product-section__viewport,
.xof-product-section--mobile-scroller .xof-product-section__items{
  min-width:0;
  box-sizing:border-box;
}

/* Core oppretter sidekontroller automatisk. Fabrikantsidene bruker dem ikke,
   fordi desktop er et vanlig grid og mobil styres med sveip. */
.xof-product-section--mobile-scroller .opta-core-scroller__side-controls,
.xof-product-section--mobile-scroller .opta-core-scroller__controls{
  display:none!important;
}

@media(min-width:850px){
  .xof-product-section--mobile-scroller .xof-product-section__viewport{
    overflow:visible!important;
    width:100%!important;
    cursor:default!important;
    scroll-behavior:auto!important;
  }
  .xof-product-section--mobile-scroller .xof-product-section__items{
    display:grid!important;
    grid-template-columns:repeat(var(--opta-grid-columns-desktop,4),minmax(0,1fr))!important;
    gap:var(--opta-scroller-gap,16px)!important;
    width:100%!important;
    min-width:0!important;
    align-items:stretch!important;
  }
  .xof-product-section--mobile-scroller .xof-product-section__items>.opta-core-scroller__item{
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    flex:initial!important;
    flex-basis:auto!important;
  }
  .xof-product-section--mobile-scroller>.opta-core-scroller__indicator{
    display:none!important;
  }
}

@media(min-width:850px) and (max-width:1100px){
  .xof-product-section--mobile-scroller .xof-product-section__items{
    grid-template-columns:repeat(var(--opta-grid-columns-tablet,3),minmax(0,1fr))!important;
  }
}

@media(max-width:849px){
  .xof-product-section--mobile-scroller .xof-product-section__viewport{
    width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain;
    scrollbar-width:none;
    -ms-overflow-style:none;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y pinch-zoom;
  }
  .xof-product-section--mobile-scroller .xof-product-section__viewport::-webkit-scrollbar{
    display:none;
  }
  .xof-product-section--mobile-scroller .xof-product-section__items{
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:stretch!important;
    gap:var(--opta-scroller-active-gap,var(--opta-scroller-gap,16px))!important;
    width:100%!important;
    min-width:100%!important;
  }
  .xof-product-section--mobile-scroller .xof-product-section__items>.opta-core-scroller__item{
    flex:0 0 var(--opta-scroller-active-item-size,44%)!important;
    width:var(--opta-scroller-active-item-size,44%)!important;
    min-width:0!important;
    max-width:none!important;
  }
  .xof-product-section--mobile-scroller>.opta-core-scroller__indicator{
    display:block;
  }
}

@media(max-width:549px){
  .xof-product-section--mobile-scroller .xof-product-section__items>.opta-core-scroller__item{
    flex-basis:var(--opta-scroller-active-item-size,86%)!important;
    width:var(--opta-scroller-active-item-size,86%)!important;
  }
}

/* Progressiv produktlasting */
.xof-load-more{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-height:42px;
  margin:22px 0 0;
}
.xof-load-more[hidden],
.xof-load-more__sentinel[hidden]{
  display:none!important;
}
.xof-load-more.is-auto:not(.is-loading):not(.is-error){
  display:none;
}
.xof-load-more__button{
  margin:0!important;
}
.xof-load-more__status{
  color:#666;
  font-size:13px;
  line-height:1.4;
}
.xof-load-more.is-loading .xof-load-more__button{
  display:none;
}
.xof-load-more.is-error{
  flex-direction:column;
}
.xof-load-more__sentinel{
  width:100%;
  height:1px;
  margin:0;
  padding:0;
  pointer-events:none;
}
