html,
html,
body {
  overflow-x: hidden;
  min-height: 100%;
  margin: 0;
}

main {
  flex: 1;
  padding: 5px;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1 {
  color: #333;
}

/* p {
    color: #666;
} */

.container {
  margin: 0 px;
  padding: 0 px;
  padding-left: 2 !important;
  padding-right: 2 !important;
}

.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

footer {
  background: #343a40;
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

#layout-wrapper {
  position: relative;
}

.header-flex {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
}

#toggle-category-menu {
  z-index: 1101;
  transition: left 0.3s ease;
}

#layout-wrapper.shifted #toggle-category-menu {
  left: 300px;
}

@media (max-width: 768px) {
  .header-flex {
    flex-direction: column;
    align-items: stretch;
  }

  #toggle-category-menu {
    width: 100%;
    margin-bottom: 10px;
  }
}
/* ====================================================================== */
/* Ta bort pilar i input[type=number] för alla moderna webbläsare */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ta bort default-pilar (spinners) i alla webbläsare */
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield; /* modern standard */
}

/* ====================================================================== */

/* CSS för produktkort */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card .product-title {
  min-height: 2.8em; /* säkerställer att rubriken tar plats även vid radbrytning */
}

.product-title.text-truncate-multiline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* Max 2 rader */
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8em; /* Säkerställer att även 1-radstitlar får lika mycket plats */
  line-height: 1.4;
}

.product-card .product-description {
  min-height: 2.5em;
  font-size: 0.875rem;
  color: #666;
}

.product-card .price-section {
  margin-bottom: 0.5rem;
}

/* .product-card .actions {
    margin-top: auto;
} */

.product-card .quantity-wrapper {
  width: 110px !important;
  flex-shrink: 0;
}

.product-card .cart-action-wrapper .btn {
  white-space: nowrap;
}

/* Anpassa layout när produktkort ligger i smal grid (t.ex. col-6) */
@media (max-width: 576px) {
  .search-result-grid .cart-action-wrapper {
    flex-direction: column;
  }

  .search-result-grid .cart-action-wrapper > div {
    width: 100%;
  }

  .search-result-grid .quantity-wrapper {
    margin-bottom: 0.5rem;
  }
}

/* ======================================================================= */

.eco-tag-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  z-index: 2;
}

.eco-tag-overlay-card{
  position: absolute;
  top: -10px;
  right: -10px;
  width: 25px;
  height: 25px;
  z-index: 2;
}

.product-image-wrapper {
  position: relative;
}
