/* ------------------------------------------------------
   shop.css — Product catalogue (webshop)
   Header slice + no outer page border
   Requires: bootstrap.css + bootstrap-icons.css
---------------------------------------------------------*/

    
  :root {
    --dabce-blue: #0A2F4E;        /* huvudfärg */
    --dabce-blue-hover: #14466F;  /* hover */
    --dabce-blue-light: #EAF2F8;  /* ljus bakgrund */
    --dabce-gold: #FFD700;        /* logo-gul */
    --dabce-orange: #E93F1A;      /* CTA */
  }

  html, body {
    height: 100%;
    margin: 0;
    
  }

  body {
    display: grid;
    grid-template-rows: auto 1fr auto;
  }


  /* Define fonts */
  @font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://dabce.se/fonts/poppins/poppins-v23-latin-regular.woff2') format('woff2');
  }

  @font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    src: url('https://dabce.se/fonts/poppins/poppins-v23-latin-600.woff2') format('woff2');
  }

  @font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    src: url('https://dabce.se/fonts/poppins/poppins-v23-latin-700.woff2') format('woff2');
  }

  /* Fonts end */

.shop-header {
  background-image:url('/images/DABCE_bg.jpg');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  min-height:80px;
  display:block;
  position:relative;
}

  /* Conflict-safe text link for DABCESHop */
  h1 {
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: 600;
    font-size: 2rem;
  }

  p .shop-link {
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: 600;
    color: #060606 !important;
    text-decoration: none !important;

    /* Ensure it doesn't look like a button */
    display: inline !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 2px;       /* optional: keep the highlight rounded */
    padding: 0 2px;           /* optional: small padding for highlight */

    /* Interaction */
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
  }

  /* Hover/focus: yellow highlight only */
  p .shop-link:hover,
  p .shop-link:focus {
    background-color: #ffeb3b !important;  /* bright yellow */
    color: #060606 !important;
    text-decoration: none !important;
    outline: none;
  }
  .btn_url {
    display: inline-block;
    padding: 8px 35px;
    background-color: #e93f1a;
    color: #ffffff;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    border: 1px solid transparent;
    border-radius: 5px;
    margin-top: 15px;
    margin-bottom: 45px;
  }

  .btn_url:hover {
    background-color: transparent;
    border-color: #e93f1a;
    color: #e93f1a;
  }

  .h2-products {
    padding-top: 5px;       /* Adds spacing above and below */
    font-size: 1em; 
    font-weight: bold;      /* Make it stand out */
    margin: 0;             /* Removes default margin */
  }

  /* Mobile optimization */
  @media (max-width: 768px) {
    .h2-products {
      padding: 5px 0;      /* Slightly less padding on mobile */
    }
  }
  
  .logo-link,
  .logo-link:hover,
  .logo-link:focus {
    background: none !important;
    border: none !important;
  }

  .logo-image {
    max-width: 100%;    /* Prevent overflow horizontally */
    max-height: 100%;   /* Prevent overflow vertically */
    object-fit: contain; /* Keep aspect ratio */
    display: block;
  }

  /* ======================================================
  PRODUCT GRID
  ======================================================*/
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
    align-content: start;   /* ensure cards begin top-left */
    justify-content: start;
  }

  /* Avoid Bootstrap .card conflicts */

  .grid > article.card {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .grid > article.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  }

  .product-card-inner {
    padding: 14px 16px;
  }

  .product-id {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
  }

  .product-name {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin: 0 0 6px 0;
  }

  .product-short {
    color: #333;
    margin: 0 0 8px 0;
  }

  .product-meta {
    font-size: 12px;
    color: #444;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }

  /* Details */
  details { margin-top: 8px; }
  summary { 
    cursor: pointer; 
    color: var(--dabce-blue);
    font-weight:600;
  }

  .product-desc {
    margin: 8px 0 0 0;
    line-height: 1.45;
    white-space: normal; /* viktigt: annars blir enters + <p> dubbla avstånd */
  }

  .product-desc p {
    margin: 0 0 0.55rem 0;
  }

  .product-desc p:last-child {
    margin-bottom: 0;
  }

  .product-desc ul {
    margin: 0.55rem 0 0.55rem 1.2rem;
    padding-left: 1.2rem;
  }

  .product-desc li {
    margin: 0.25rem 0;
  }

  .product-desc br {
    line-height: 1.2;
  }

  .product-img-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin: 0 0 6px 0;
  }

  .product-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* Two equal-width columns */
    gap: 8px;
  }

  .product-images img {
    width: 100%;
    aspect-ratio: 1 / 1;     /* optional: square thumbnails */
    object-fit: cover;       /* crops neatly */
    border-radius: 3px;
    border: 1px solid #FFF;
  }

  /* Categories filter styles */
      
  .category-filters {
    margin-top: 6px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85rem;
  }

  .category-filters label {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
  }

  .category-filters input {
    margin-right: 4px;
  }


/* Preview image (collapsed state) */
.product-preview {
margin: 8px 0;
}

.product-preview img {
width: 100%;
max-height: 140px;
object-fit: contain;
border: 1px solid #eee;
border-radius: 3px;
background: #fff;
opacity: 0.92;
}

/* Hide preview when the product <details> is open (modern browsers) */
#grid article.card:has(> details[open]) .product-preview {
display: none;
}

/* Fallback: hide preview when JS adds .is-open */
#grid article.card.is-open .product-preview {
display: none;
}


/* =========================
  CART
========================= */
.cart-link {
position: relative;
color: #FFF;
text-decoration: none;
font-weight: 600;
}

.cart-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 6px;
border-radius: 999px;
background: #e93f1a;
color: #fff;
font-size: 11px;
font-weight: 700;
margin-left: 6px;
line-height: 1;
}

.cart-panel {
margin-top: 18px;
border: 1px solid #A0A0A0;
border-radius: 5px;
overflow: hidden;
background: #fff;
}

.cart-items {
display: grid;
gap: 12px;
}

.cart-item {
display: grid;
grid-template-columns: 72px 1fr auto;
gap: 12px;
align-items: start;
border: 1px solid #eee;
border-radius: 6px;
padding: 10px;
}

.cart-item img {
width: 72px;
height: 72px;
object-fit: contain;
border: 1px solid #eee;
border-radius: 4px;
background: #fff;
}

.cart-item-name {
font-weight: 600;
margin-bottom: 4px;
}

.cart-item-price {
color: #555;
font-size: 0.95rem;
}

.cart-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
}

.cart-actions form {
margin: 0;
}

.cart-qty-input {
width: 72px;
padding: 5px 8px;
border: 1px solid #ccc;
border-radius: 4px;
}

.cart-summary {
margin-top: 16px;
border-top: 1px solid #eee;
padding-top: 12px;
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}

.btn-cart,
.btn-cart-secondary {
display: inline-block;
padding: 4px 6px;
border-radius: 3px;
border: 1px solid transparent;
cursor: pointer;
font-weight: 400;
font-size: 0.9rem;
}


.btn-cart {
background: var(--dabce-blue);
color: #fff;
}

.btn-cart:hover {
background: transparent;
border-color: var(--dabce-blue);
color: var(--dabce-blue);
}


.btn-cart-secondary {
background: #fff;
color: #666;              /* diskret grå text */
border: 1px solid #000;   /* svart kant */
border-radius: 3px;
padding: 4px 6px;
font-size: 0.8rem;
font-weight: 400;
cursor: pointer;
transition: all 0.15s ease;
}

.btn-cart-secondary:hover {
background: #f5f5f5;      /* subtil hover */
color: #000;              /* lite tydligare på hover */
border-color: #000;

}

.product-card-actions {
margin-top: 10px;
}

@media (max-width: 768px) {
.cart-item {
  grid-template-columns: 1fr;
}
}

/* CART COLLAPSIBLE */

/* Header (always visible) */
.cart-summary-header {
display: grid;
grid-template-columns: 1fr auto auto;
align-items: center;
gap: 12px;

padding: 4px 8px;
background: var(--dabce-blue);
color: #fff;
font-weight: 400;
cursor: pointer;
}

/* Remove default arrow */
.cart-summary-header::-webkit-details-marker {
display: none;
}

/* + / − toggle */
.cart-summary-header::after {
content: "+";
font-size: 18px;
margin-left: 10px;
}

/* Expanded content */
.cart-content {
padding: 6px;
}

/* Light grey when expanded */
.cart-panel[open] .cart-content {
background: #fff;
}

/* Keep total duplicated section spaced */
.cart-summary {
margin-top: 16px;
}

/* Remove default arrow */
.cart-summary-header::-webkit-details-marker {
display: none;
}

/* LEFT side */
.cart-header-left {
display: flex;
align-items: center;
white-space: nowrap;
}

/* RIGHT block */
.cart-header-right {
display: flex;
align-items: center;
gap: 10px;
}

/* TOTAL */
.cart-total-inline {
font-weight: 400;
white-space: nowrap;
}

/* Button tweak inside header */
.cart-header-btn {
padding: 4px 10px;
font-size: 0.85rem;
background: #ffffff;
color: var(--dabce-blue);
}

.cart-header-btn:hover {
background: transparent;
color: #ffffff;
border-color: #ffffff;
}

/* +/- icon */
.cart-summary-header::after {
content: "+";
font-size: 18px;
}

.cart-panel[open] .cart-summary-header::after {
content: "−";
}


  /* =========================
  IMAGE LIGHTBOX
  ========================= */

  .img-trigger {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
  }

  .img-trigger img {
    display: block;
  }

  .product-preview .img-trigger img {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 3px;
    background: #fff;
    opacity: 0.92;
  }

  .product-images .img-trigger img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #fff;
  }

  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.86);
    cursor: zoom-out;
  }

  .lightbox.is-open {
    display: flex;
  }

  .lightbox img {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  }

  body.no-scroll {
    overflow: hidden;
  }
  
  .shop-legal-links a{
    color: var(--dabce-blue);
    text-decoration:none;
    font-weight:600;
    display:inline-block;
    margin-right:18px;
    padding:2px 4px;
  }

  .shop-legal-links a:hover{
    text-decoration:underline;
  }

  .product-desc h2,
  .product-desc h3,
  .product-desc h4 {
  display: block;
  font-size: inherit;
  font-weight: 700;
  margin: 12px 0 6px 0;
}


@media (max-width: 768px) {

  .cart-summary-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cart-header-left,
  .cart-header-right {
    width: 100%;
  }

  .cart-header-right {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .cart-header-btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

}

.scroll-hint {
display: none;
}

@media (max-width: 768px) {

  .scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    margin: 8px 0 12px 0;

    color: var(--dabce-blue);
    font-size: 0.85rem;
    font-weight: 600;

    animation: bounce 2s infinite;
  }

  .scroll-hint i {
    font-size: 1.2rem;
    margin-top: 2px;
  }

  @keyframes bounce {
    0%,20%,50%,80%,100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(4px);
    }
    60% {
      transform: translateY(2px);
    }
  }
}

.shop-legal-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9rem;
}

.shop-legal-footer a {
    margin: 0 12px;
    color: #666;
    text-decoration: none;
}

.shop-legal-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {

    .category-filters {
        gap: 6px 10px;
        font-size: 0.82rem;
    }

    .category-filters label {
        margin: 0;
    }

}

@media (max-width: 768px) {

    .category-filters {
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap:4px 10px;
    }

}
