/* ==========================================================================
   SEARCH-LAYOUT (left filter panel + right results area)
   ========================================================================== */

.full-search-layout{
  display:flex;
  align-items:flex-start;
  gap:20px;
  margin: 0px 30px;
}

.full-search-layout form{
  width:300px;
  flex:0 0 300px;
}

.delarFilter{
  width: 100%;
}
.full-search-layout select, .full-search-layout input[type="text"]{
  padding:8px; 
  width:100%;
}
.full-search-layout button[type=submit]{
  background-color: #fd5f00;
  color: #fff;
  border: none;
}
#results{
  flex:1 1 auto;
  min-width:0; /* prevents grid overflow in flex layout */
}

.block-container  .block.modul{
  /*width: 96%;*/
}

.search-single-layout .single-search-box{
  padding:30px; 
  background-color: rgb(240, 244, 250);
}

.search-single-layout input[type="text"]{
  width: 80%;
  height: 41px;
  padding: 0px 12px;
}

.search-single-layout button[type="submit"]{
  background-color: #fd5f00;
  color: #fff;
  border: none;
  width: 20%;
  height: 40px;
}

/* ==========================================================================
   VEHICLE FACTS (boxes under "Test results for registration")
   ========================================================================== */

.carfacts{
  display:grid;
  grid-template-columns:repeat(3, minmax(220px, 1fr));
  gap:12px;
  margin:10px 0 16px 0;
}

.carfact{
  background:#f1f5f9;
  padding:12px 14px;
  border-radius:6px;
}

@media (max-width: 900px){
  .carfacts{ grid-template-columns: 1fr; }
}


/* ==========================================================================
   PART FILTER (collapsible categories + checkboxes)
   ========================================================================== */

#delarContainer label{
  display:block;
}

/* Collapsible category group wrapper */
.delar-group{
  margin:0;
}

/* Category toggle button */
.delar-group-toggle{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 4px;
  border:0;
  background:transparent;
  cursor:pointer;
  text-align:left;
  font-weight:700;
}

/* Plus / minus icon */
.delar-group-icon{
  width:12px;
  display:inline-block;
  text-align:center;
  font-weight:800;
}

/* Category title text */
.delar-group-title{
  font-weight:700;
  margin:-2px 0 6px 0;
  padding-top:8px;
}

/* Container for checkbox items inside category */
.delar-group-items{
  padding-left:26px;
}


/* ==========================================================================
   RESULTS GRID (product cards)
   ========================================================================== */

.parts-wrap{
  padding:12px;
  overflow:hidden; /* prevents float-related layout issues */
}

.parts-count{
  margin:10px 0 14px 0;
  font-weight:600;
}

/* Responsive grid layout */
.parts-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:12px;
}

/* Prevent overflow inside grid/flex children */
.parts-grid,
.part-card,
.part-content{
  min-width:0;
}

/* Individual product card */
.part-card{
  border:1px solid #ddd;
  background:#fafafa;
  padding:12px;
  border-radius:6px;

  display:flex;
  gap:12px;
  height:100%;
  box-sizing:border-box;
}

/* Image container */
.part-image{
  width:150px;
  flex-shrink:0;
}

/* Product image */
.part-image img{
  width:100%;
  aspect-ratio:4 / 3;
  object-fit:cover;
  border-radius:4px;
  background:#eaeaea;
}

/* Text content area */
.part-content{
  flex:1;
}

/* Product title */
.part-title{
  font-weight:700;
  margin-bottom:8px;
}

/* Metadata block */
.part-meta{
  font-size:14px;
  line-height:1.35;
}

.part-meta .part-row{
  margin:3px 0;
}

.part-meta .label{
  font-weight:600;
}

/* Optional forced column layout at breakpoints */
@media (max-width: 2200px){
  .parts-grid{ grid-template-columns:repeat(3, 1fr); }
}
@media (max-width: 1600px){
  .parts-grid{ grid-template-columns:repeat(2, 1fr); }
}
@media (max-width: 1200px){
  .parts-grid{ grid-template-columns:1fr; }
}


/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pager{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  padding:12px;
}

/* Pagination buttons */
.pager-link,
.pager-current,
.pager-disabled{
  border:1px solid #ddd;
  padding:6px 10px;
  border-radius:6px;
  text-decoration:none;
  background:#fafafa;
}

/* Current active page */
.pager-current{
  font-weight:700;
  background:#eee;
}

/* Disabled state */
.pager-disabled{
  color:#999;
  background:#f6f6f6;
}

/* Ellipsis between page ranges */
.pager-dots{
  padding:0 4px;
  color:#777;
}


/* ==========================================================================
  search-layout (first page with centered search form)
   ========================================================================== */

   .search-layout{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:300px;
    text-align:center;
   }

   .search-layout input[type="text"]{
    padding:8px;
    width:300px;
    max-width:100%;
    margin-right:8px;
   }
  .search-layout button{
    padding:8px 12px;
    color: #fff;
    background-color: #fd5f00;
    border: 1px solid #fd5f00;
    border: none;
  } 
  .search-layout a{
    display:inline-block;
    margin-top:12px;
    color:white;
  }



/* ==========================================================================
  _parts_grid.php (grid layout for search results)
   ========================================================================== */

  /* Modal wrapper */
.part-image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

/* Display modal while opening/open/closing */
.part-image-modal.is-visible {
    display: block;
}

/* Backdrop */
.part-image-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    transition: opacity 180ms ease;
}

/* Centered content container */
.part-image-modal__content {
    position: relative;
    z-index: 2;
    width: 90vw;
    max-width: 90vw;
    height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
}

/* Modal image */
.part-image-modal__content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: scale(0.86);
    transition:
        opacity 140ms ease,
        transform 170ms ease;
    pointer-events: auto;
}

/* Opening/open state */
.part-image-modal.is-open .part-image-modal__backdrop {
    opacity: 1;
}

.part-image-modal.is-open .part-image-modal__content img {
    opacity: 1;
    transform: scale(1);
}

/* Closing state, image shrinks first */
.part-image-modal.is-closing .part-image-modal__content img {
    opacity: 0;
    transform: scale(0.88);
    transition:
        opacity 120ms ease,
        transform 140ms ease;
}

.part-image-modal.is-closing .part-image-modal__backdrop {
    opacity: 0;
    transition: opacity 200ms ease 100ms;
}

/* Default: clickable images */
.js-part-image {
    cursor: pointer;
}

/* Fallback image: NOT clickable */
.js-part-image.is-fallback-image {
    cursor: default;
    opacity: 0.85; /* valfri, ger visuell hint */
}



/* ==========================================================================
  _parts_grid.php Modal thumbnails (row of small images below the main modal image)
   ========================================================================== */


/* Modal thumbnails row */
.part-image-modal__thumbs {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 3;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Thumbnail button */
.part-image-modal__thumb {
    border: 2px solid transparent;
    padding: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    opacity: 0.85;
    transition: opacity 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.part-image-modal__thumb:hover {
    opacity: 1;
    transform: scale(1.04);
}

.part-image-modal__thumb.is-active {
    border-color: #ffffff;
    opacity: 1;
}

/* Thumbnail image */
.part-image-modal__thumb img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
  _parts_grid.php Action buttons (View product, Add to cart)
   ========================================================================== */


.btn-view-product{
  width: 100%;
  padding: 2px;

  background-color: gray;
  color:black;
  line-height: 1.4rem;
}
.btn-view-product i{
      float: left;
    margin-top: 6px;
    font-size: 24px;
    margin-left: 9px;
    border: 2px solid black;
    border-radius: 50%;
    padding: 2px 18px 5px 10px;
}
.btn-view-product:hover{
  background-color:lightgray;
}

.btn-add-to-cart{
  width: 100%;
  padding: 2px;
    color:white;
    line-height: 1.4rem;
}
.btn-add-to-cart i{
        float: left;
    margin-top: 11px;
    font-size: 24px;
    margin-left: 9px;
}
.btn-add-to-cart:hover{
  background-color:#fd6100a9;
  color:white;
}

.btn-add-to-cart-single{
  width: 200px
 
}

.cart-overview__total {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: right;
}

/* ==========================================================================
   Single product page
   ========================================================================== */

.single-part-page {
  margin: 0 auto;
}

.single-part-card {
  background: #fff;
  padding: 20px;
}

.single-part-top {
  margin-bottom: 20px;
}

.single-part-back-link {
  display: inline-block;
  margin-bottom: 10px;
  text-decoration: none;
}

.single-part-title {
  margin: 0;
}

.single-part-image-wrap {
  margin-bottom: 20px;
}

.single-part-main-image {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  cursor: pointer;
}

.single-part-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.single-part-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #c8c8c8;
  cursor: pointer;
}

.single-part-dot.is-active {
  background: #333;
}

.single-part-actions {
  margin-bottom: 20px;
  max-width: 320px;
}

.single-part-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.single-part-meta-column {
  min-width: 0;
}

.btn-back{
   width: 200px;
    background-color: gray;
  padding: 2px;
    color:white;
    line-height: 1.4rem;
}
.btn-back:hover{
  background-color:lightgray;
  color:white;
}

.btn-cart{
   width: 200px;
    background-color: #fd5f00;
  padding: 5px;
    color:white;
    line-height: 1.4rem;
}
.btn-cart:hover{
  background-color:#fd6100a9;
  color:white;
}

.btn-add-to-cart-single{
  width: 180px!important;
  padding: 2px;
    color:white;
    line-height: 1.4rem;
}
.btn-add-to-cart-single i{
        float: left;
    margin-top: 11px;
    font-size: 24px;
    margin-left: 9px;
}
.btn-add-to-cart-single:hover{
  background-color:#fd6100a9;
  color:white;
}

.part-row-single{
  background-color: rgb(243, 243, 243);
  padding: 5px 12px;
  
}

@media (min-width: 768px) {
  .single-part-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   Single product gallery (bootstrap carousel + modal)
   ========================================================================== */

.single-part-gallery {
 
}


/* ==========================================================================
   Cart overview
   ========================================================================== */

.cart-overview {
    position: relative;
    color: white;
    display: flex;
    align-items: center;
}

.cart-overview__icon {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.cart-overview__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffffff;
    color: #fd5f00;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.cart-overview__body {
    display: block;
    visibility: hidden;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 20px);
    background: #ffffff;
    color: #333333;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    padding: 1rem;
    z-index: 1001;

    /* Hidden state */
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0s linear 0.25s;
}

.cart-overview.is-open .cart-overview__body {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0s linear 0s;
}

.cart-overview__empty {
    font-size: 14px;
    line-height: 1.4;
}

.cart-overview__items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 420px;
    overflow-y: auto;
}

.cart-overview__item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    flex-shrink: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dddddd;
    overflow: hidden;
    height: auto;
    transition: height 220ms ease, opacity 220ms ease, margin 220ms ease, padding 220ms ease, border-bottom-width 220ms ease;
}

.cart-overview__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.cart-overview__item-image {
    width: 64px;
    min-width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f3f3;
    display: block;
}

.cart-overview__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-overview__item-content {
    flex: 1;
    min-width: 0;
}

.cart-overview__item-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.cart-overview__item-meta {
    font-size: 13px;
    line-height: 1.3;
    color: #666666;
}

.cart-overview__footer {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #dddddd;
}

.cart-overview__body .cart-overview__checkout-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #fd5f00;
    border-radius: 0;
    color: #ffffff;
    text-decoration: none;
}

.cart-overview.is-updated .cart-overview__icon {
    animation: fsCartPulse 0.7s ease;
}

.cart-overview.is-updated .cart-overview__count {
    animation: fsCartCountPulse 0.7s ease;
}

.cart-overview__item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-overview__qty-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.cart-overview__qty-value {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}



.cart-overview__item-image,
.cart-overview__item-content {
    transition: opacity 180ms ease, transform 180ms ease;
}

.cart-overview__item.is-removing {
    pointer-events: none;
}

.cart-overview__item.is-removing .cart-overview__item-image,
.cart-overview__item.is-removing .cart-overview__item-content {
    opacity: 0;
    transform: scale(0.98);
}

/* ==========================================================================
  search brand layout (grid of brand buttons on first search page)
   ========================================================================== */
.search-brand-layout .brand-grid{
  display:grid; 
  grid-template-columns:repeat(5, 1fr); 
  gap:10px;
}

@media (max-width: 600px) {
  .search-brand-layout .brand-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 450px) {
  .search-brand-layout .brand-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.search-brand-layout .car-brand-button{
    padding:10px; 
    border:1px solid #fd5f00; 
    background:#fd5f00; 
    cursor:pointer;
    color:white;
    transition: background-color 300ms ease;
}
.search-brand-layout .car-brand-button:hover{
  background-color: rgb(219, 88, 1);
}


/* ==========================================================================
   Checkout cart
   ========================================================================== */

.checkout-page {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  margin: 30px;
}

.checkout-content,
.checkout-information {
  background: #f5f5f5;
  padding: 20px;
}

.checkout-cart__empty {
  font-size: 14px;
  line-height: 1.4;
}

.checkout-cart__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-cart__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #dddddd;
}

.checkout-cart__item-image {
  width: 90px;
  min-width: 90px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f3f3;
  display: block;
}

.checkout-cart__item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkout-cart__item-content {
  flex: 1;
  min-width: 0;
}

.checkout-cart__item-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.checkout-cart__item-meta {
  font-size: 14px;
  line-height: 1.4;
  color: #666666;
}

.checkout-cart__item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.checkout-cart__qty-value {
  font-weight: 600;
}

.checkout-cart__remove-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

.checkout-cart__footer {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #dddddd;
}

.checkout-cart__total {
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}

@media (max-width: 900px) {
  .checkout-page {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Checkout page
   ========================================================================== */

.checkout-page {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    margin: 30px;
    align-items: start;
}

.checkout-content,
.checkout-information {
    background: #f3f3f3;
    padding: 30px;
    box-sizing: border-box;
}

.checkout-content h2,
.checkout-information h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkout-form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkout-form__row label {
    font-weight: 600;
}

.checkout-form__row input,
.checkout-form__row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cccccc;
    background: #ffffff;
    box-sizing: border-box;
    font-size: 16px;
}

.checkout-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkout-form__actions {
    margin-top: 8px;
}

.checkout-form__actions button {
    padding: 10px 20px;
    color: #ffffff;
    background-color: #fd5f00;
    border: none;
    cursor: pointer;
}

.checkout-form__actions button:hover {
    background-color: #e55600;
}

@media (max-width: 900px) {
    .checkout-page {
        grid-template-columns: 1fr;
    }

    .checkout-form__grid {
        grid-template-columns: 1fr;
    }
}











/* ==========================================================================
    Animations for cart updates (adding/removing items)
   ========================================================================== */

@keyframes fsCartPulse {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.12);
    }
    60% {
        transform: scale(0.96);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fsCartCountPulse {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.25);
    }
    60% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
    }
}