/* =====================================================
   WOOCOMMERCE – PRODUKTKORT (ARCHIVE / SHOP)
   ===================================================== */

.woocommerce ul.products li.product{
  display:flex;
  flex-direction:column;

  background:#fff;
  padding:12px;

  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Titel: 2 rader, stabil höjd */
.woocommerce-loop-product__title{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;

  overflow:hidden;
  line-height:1.4;
  min-height: calc(1.4em * 2);
}

/* Pris */
.woocommerce ul.products li.product .price{
  color:#274e25;
  font-weight:500;
  font-size:16px;
}

/* Knappen: placera längst ned, men låt buttons.css styra utseendet */
.woocommerce ul.products li.product .button{
  margin-top:auto;
}

/* =====================================================
   WOOCOMMERCE – PRODUCT GRID (SHOP/KATEGORI/TAGG/SEARCH)
   Gemensam styling så korten beter sig likadant överallt.
   ===================================================== */

/* Grid container */
body.search .products,
.post-type-archive-product .products,
.tax-product_cat .products,
.tax-product_tag .products{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

/* Card */
body.search .product,
.post-type-archive-product .product,
.tax-product_cat .product,
.tax-product_tag .product{
  background:#fff;
  border-radius:6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  padding:16px;

  display:flex;
  flex-direction:column;

  transition: transform .15s ease, box-shadow .15s ease;
}

body.search .product:hover,
.post-type-archive-product .product:hover,
.tax-product_cat .product:hover,
.tax-product_tag .product:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* Bild */
body.search .product img,
.post-type-archive-product .product img,
.tax-product_cat .product img,
.tax-product_tag .product img{
  width:100%;
  height:auto;
  border-radius:4px;
  margin-bottom:12px;
}

/* Titel */
body.search .woocommerce-loop-product__title,
.post-type-archive-product .woocommerce-loop-product__title,
.tax-product_cat .woocommerce-loop-product__title,
.tax-product_tag .woocommerce-loop-product__title{
  font-size:15px;
  font-weight:500;
  letter-spacing:1px;
  color:#0f172a;
  margin: 0 0 10px;
}

/* Tighta till mellan figure och titel (som du hade) */
.woocommerce ul.products li.product figure{
  margin-bottom: 4px;
}
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3{
  margin-top: 0;
}

/* =====================================================
   Gäst: dölj bookable “välj datum / se datum” CTA i grid
   och visa login-meddelande istället
   (behåller !important pga tema/Blocksy knappar är ofta starkt specificerade)
   ===================================================== */
body:not(.logged-in) .ct-woo-card-actions a.button{
  display:none !important;
}

body:not(.logged-in) .ct-woo-card-actions::after{
  content:"🔒 Logga in för att se priser";
  display:block;
  margin-top: .75rem;
  padding: .5rem 0;
  font-size: .9rem;
  color:#555;
  text-align:center;
}

/* =====================================================
   BADGES – lagerplats / sku / privat
   (flyttat från sections.css)
   ===================================================== */
.woocommerce ul.products li.product{
  position:relative;
}

.product-badge{
  position:absolute;
  padding:4px 8px;
  border-radius:3px;
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  white-space:nowrap;
  z-index:5;
}

/* PRIVAT */
.product-badge.badge-private{
  top:85px;
  right:25px;

  background:#857700;
  color:#fff;
  z-index:3;
}

/* Om SOLD OUT + PRIVAT → flytta ner PRIVAT */
.product-badge.badge-sold-out + .badge-private{
  top:55px;
}

/* Lagerplats */
.product-badge.badge-stock-place{
  top:55px;
  right:25px;

  background:#1f6f8b;
  color:#fff;
}

/* SKU */
.product-badge.badge-sku{
  top:27px;
  right:25px;

  background:#7a0d0d;
  color:#fff;

  font-size:10.5px;
  letter-spacing:.03em;
  opacity:.95;
}

@media (max-width:768px){
  .product-badge{
    font-size:10px;
    padding:3px 6px;
  }
}

/* =====================================================
   PRODUCT GRID CTA – enhetlig styling för knappen i produktkort
   (archive / categories / tags / search)
   ===================================================== */

.woocommerce ul.products li.product .ct-woo-card-actions a.button,
.woocommerce ul.products li.product .ct-woo-card-actions a.add_to_cart_button,
.woocommerce ul.products li.product .ct-woo-card-actions a.product_type_simple,
.woocommerce ul.products li.product .ct-woo-card-actions a.product_type_variable {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  max-width: 100%;
  min-height: 44px;
  box-sizing: border-box;

  padding: 10px 14px;
  margin: 10px 0 0;

  background: var(--sj-blue);
  color: #fff;

  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;

  border: 0;
  border-radius: 0;
  text-decoration: none;

  display: flex;

  box-shadow: var(--sj-shadow-lg);
  transition: background-color .2s ease, transform .15s ease, box-shadow .15s ease;
}

/* Hover/focus */
.woocommerce ul.products li.product .ct-woo-card-actions a.button:hover,
.woocommerce ul.products li.product .ct-woo-card-actions a.add_to_cart_button:hover,
.woocommerce ul.products li.product .ct-woo-card-actions a.product_type_simple:hover,
.woocommerce ul.products li.product .ct-woo-card-actions a.product_type_variable:hover {
  background: var(--sj-blue-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

/* Fokus (tillgänglighet) */
.woocommerce ul.products li.product .ct-woo-card-actions a.button:focus-visible {
  outline: 2px solid var(--sj-orange);
  outline-offset: 2px;
}

/* Se till att action-wrappen inte begränsar bredden */
.woocommerce ul.products li.product .ct-woo-card-actions {
  width: 100%;
  display: block;
}