:root {
  /* Hof Wohlers – Markenfarben */
  --brand-logo:   #a8c844;
  --brand:        #287a32;
  --brand-50:     #f2f6e7;
  --brand-100:    #e8efda;
  --brand-200:    #dde3d7;
  --brand-600:    #1e5d27;

  /* Bootstrap-Kompatibilität */
  --bs-success:   var(--brand);
  --bs-success-rgb: 40,122,50;
}

.text-success {
  color: var(--brand) !important;
}
.btn-success,
.btn-success:focus {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
}
.btn-success:hover {
  background-color: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
}



/* 
 * NEU: CSS zur Entfernung der Pfeile (Spin-Buttons) in number-Inputs.
 * Sie zielen auf das Element mit der Klasse .qty-input und dem Typ "number".
 */
.qty-input[type="number"]::-webkit-outer-spin-button,
.qty-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input[type="number"] {
  -moz-appearance: textfield; /* Für Firefox */
}

th.col-title, td.col-title{ width:40%; }
th.col-origin,td.col-origin{ width:4.5rem; }
th.col-unit,  td.col-unit  { width:5.0rem; }
th.col-price, td.col-price { width:13.5rem; }
th.col-qty,   td.col-qty   { width:13.6rem; max-width:13.6rem; }


th.col-title, td.col-title{ width:40%; }
th.col-origin,td.col-origin{ width:4.5rem; }
th.col-unit,  td.col-unit  { width:5.0rem; }
th.col-price, td.col-price { width:13.5rem; }
th.col-qty,   td.col-qty   { width:13.6rem; max-width:13.6rem; }

input.is-invalid.qty-input {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

.product { display:flex; gap:.75rem; align-items:flex-start; }
.product .thumb{
  width:72px; height:72px; object-fit:cover; border-radius:.5rem; border:1px solid #eee;
  background:#fafafa; flex:0 0 72px;
}
.product .meta .name{ font-weight:600; line-height:1.25; display:flex; align-items:center; gap:.5rem; }

.avail-note{ margin-top:.2rem; font-size:.8125rem; color:#a15f00; }

.product .meta .desc{
  font-size:.875rem; color:#6c757d; margin-top:.2rem; line-height:1.35;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3;
  overflow:hidden; max-height:calc(1.35em * 3);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.product .meta .desc.expanded{ -webkit-line-clamp:unset; max-height:none; mask-image:none; }

.desc-toggle {
  display:inline-block !important; margin-top:.25rem !important; font-size:.8125rem !important;
  color:var(--brand) !important; background:none !important; border:0 !important; padding:0 !important;
  text-decoration:underline !important; cursor:pointer !important; font-weight:500 !important;
}
.desc-toggle:hover { color:var(--brand-600) !important; }

.col-qty form{ display:flex; align-items:center; gap:.4rem; }
.col-qty .qty-group{ flex:1 1 5.8rem; min-width:5.6rem; display:flex; }
.col-qty .qty-group .form-control{ flex:1 1 auto; min-width:0; }
.col-qty .qty-input{ flex:1 1 5.2rem; min-width:4.8rem; }
.col-qty .btns{ flex:0 0 auto; display:flex; gap:.4rem; }

.btn-icon{
  width:2.0rem; height:2.0rem; padding:0;
  display:inline-flex; align-items:center; justify-content:center; border-radius:.5rem;
}
.btn-icon i{ font-size:1rem; line-height:1; }
.btn-heart-on { background: white !important; border-color: #dc3545 !important; }
.btn-heart-on i { color: #dc3545 !important; }

.price-tiers{ margin-top:.15rem; font-size:.875rem; color:#6c757d; }

/* Country Badge Styling */
.country-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: var(--brand-50);
  color: var(--brand-600);
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: help;
  transition: all 0.2s ease;
  user-select: none;
}

.country-badge:hover {
  background: var(--brand-100);
  transform: scale(1.05);
}

/* Mobile: Tap-Feedback */
@media (hover: none) and (pointer: coarse) {
  .country-badge:active {
    background: var(--brand-200);
    transform: scale(0.98);
  }
}

/* Tooltip auf Mobile: länger anzeigen */
@media (max-width: 767.98px) {
  .tooltip {
    font-size: 0.9rem;
  }
  
  .tooltip-inner {
    max-width: 200px;
    padding: 0.5rem 0.75rem;
  }
}

/* Mobile Cards */
.shop-cards {
  display: none;
}

.product-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  box-shadow: 0 2px 8px rgba(16,24,40,.04);
}

.product-card__header {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.product-card__img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid #eee;
  background: #fafafa;
}

.product-card__info {
  flex: 1;
  min-width: 0;
}

.product-card__title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.product-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.product-card__price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--brand);
}

.product-card__price-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.product-card__desc {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.75rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(1.35em * 3);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}

.product-card__desc.expanded {
  -webkit-line-clamp: unset;
  max-height: none;
  mask-image: none;
  overflow: visible;
}

.product-card__actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.product-card__qty {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.product-card__qty .input-group {
  display: flex;
}

.product-card__qty .form-control {
  flex: 1;
  min-width: 0;
}

.product-card__qty .btn {
  white-space: nowrap;
}

.product-card__buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Desktop: Tabelle anzeigen, Cards verstecken */
@media (min-width: 768px) {
  .shop-table {
    display: block;
  }
  
  .shop-cards {
    display: none;
  }
}

/* Mobile: Cards anzeigen, Tabelle verstecken */
@media (max-width: 767.98px) {
  .shop-table {
    display: none;
  }
  
  .shop-cards {
    display: block;
  }

  .desc-toggle {
    min-height: 32px;
    padding: .3rem 0 !important;
  }
  
  /* Beschriftete Aktionen untereinander statt schwer deutbarer Icon-Schalter */
  .product-card__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  /* FIX 2: Robuste Behandlung für dynamische Inline-Nachrichten (z.B. "Im Korb: 2 kg") */
  .product-card__actions > *:not(.product-card__qty):not(.product-card__buttons) {
    flex-shrink: 1; /* Erlaubt dem Element zu schrumpfen */
    min-width: 0; /* Verhindert, dass der Inhalt die Mindestbreite des Flex-Containers bestimmt */
    white-space: nowrap; /* Hält den Text auf einer Zeile */
    overflow: hidden; /* Schneidet den überlaufenden Text ab */
    text-overflow: ellipsis; /* Zeigt Ellipsis an, falls Text abgeschnitten wird */
    align-self: center; /* Stellt sicher, dass das Element vertikal zentriert ist */
    font-size: 0.9rem;
    color: var(--bs-success, #287a32);
    padding: 0 0.2rem;
  }
  
  .product-card__qty {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
  }
  
  .product-card__qty .input-group {
    flex: 1;
    min-width: 0;
  }
  
  .product-card__qty .form-control {
    min-width: 50px;
  }
  
  /* Cart-Button innerhalb des Forms, aber rechts neben Input */
  .btn-cart-mobile {
    flex: 0 0 auto;
  }
  
  .product-card__buttons {
    width: 100%;
    flex-direction: row;
    gap: 0.4rem;
  }
  
  .btn-icon-mobile {
    width: auto !important;
    min-height: 44px !important;
    height: auto !important;
    padding: .5rem .7rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .4rem;
    border-radius: 8px !important;
  }

  .product-card__buttons .btn-icon-mobile {
    flex: 1 1 auto !important;
  }

  .shop-action-label {
    display: inline;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
  }
  
  .btn-icon-mobile i {
    font-size: 1.1rem !important;
  }
}

@keyframes cartFlash {
  0%   { box-shadow: 0 0 0 rgba(16,185,129,0); }
  30%  { box-shadow: 0 0 0 4px rgba(16,185,129,.25); }
  100% { box-shadow: 0 0 0 rgba(16,185,129,0); }
}
.added-flash { animation: cartFlash 1000ms ease-out; }

/* Nicht blockierende Bestätigung nach einer Warenkorbaktion */
.cart-confirmation {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  width: min(24rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--brand-200);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: #fff;
  color: #30352f;
  box-shadow: 0 12px 32px rgba(30, 93, 39, .2);
  transition: opacity .18s ease, transform .18s ease;
}

.shop-results--empty .shop-table,
.shop-results--empty .shop-cards {
  display: none !important;
}

.shop-empty-state {
  max-width: 42rem;
  margin: 1.5rem auto;
  padding: 1.5rem;
  border: 1px solid var(--brand-200);
  border-radius: 12px;
  background: var(--brand-50);
  text-align: center;
}

.shop-empty-state__icon {
  display: block;
  margin-bottom: .65rem;
  color: var(--brand);
  font-size: 2rem;
}

.shop-empty-state__suggestions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.cart-confirmation.is-hiding {
  opacity: 0;
  transform: translateY(.5rem);
}

.cart-confirmation__close {
  position: absolute;
  top: .35rem;
  right: .45rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #596157;
  font-size: 1.4rem;
  line-height: 1;
}

.cart-confirmation__close:hover,
.cart-confirmation__close:focus-visible {
  background: var(--brand-50);
  color: var(--brand-600);
}

.cart-confirmation__title {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 2rem .35rem 0;
  color: var(--brand-600);
  font-weight: 700;
}

.cart-confirmation__product {
  margin: 0;
  font-weight: 650;
}

.cart-confirmation__detail {
  margin: .15rem 0 .8rem;
  color: #596157;
}

.cart-confirmation__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.cart-confirmation__sum {
  font-size: .9rem;
  font-weight: 600;
}

/* Ab Tabletbreite bestätigt der sichtbare Mini-Warenkorb die Änderung. */
@media (min-width: 768px) {
  .cart-confirmation {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .cart-confirmation {
    right: 1rem;
    bottom: 1rem;
  }

  .cart-confirmation__footer {
    align-items: stretch;
    flex-direction: column;
  }
}

#load-more-trigger {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}

.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--brand);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
