/* Grundsetup */
*,*::before,*::after { box-sizing: border-box; }
body,html { margin:0; padding:0; font-family: Arial,sans-serif; background:#FAF3E6; min-height:100vh; display:flex; flex-direction:column; }
main { flex:1 0 auto; padding:20px; max-width:1200px; margin:0 auto; }

/* Header */
header,.cart-header { display:flex; justify-content:space-between; align-items:center; background:#fff; padding:12px 20px; box-shadow:0 2px 6px rgba(0,0,0,0.1); border-radius:6px; }
header .logo img,.cart-header .header-left img { height:45px; width:auto; max-width:220px; }
header nav,.header-center { display:flex; gap:20px; align-items:center; }
header nav a,.header-center a { text-decoration:none; color:#333; font-weight:600; transition:color .2s; }
header nav a:hover,.header-center a:hover { color:#006699; }

/* User Dropdown */
.user-dropdown { position:relative; }
.user-dropdown button { background:none; border:none; cursor:pointer; font-weight:600; color:#333; }
.dropdown-content { display:none; position:absolute; right:0; top:120%; background:#fff; border:1px solid #ccc; border-radius:6px; min-width:150px; box-shadow:0 4px 10px rgba(0,0,0,0.1); z-index:100; }
.dropdown-content a { display:block; padding:10px 15px; text-decoration:none; color:#333; transition:background .2s; }
.dropdown-content a:hover { background:#f0f0f0; }

/* Produkt-Liste Desktop */
.cart-list { display:flex; flex-direction:column; gap:15px; margin-top:20px; max-width: 820px; width: 100%; margin-left: auto; margin-right: auto;}
.cart-item-desktop { display:flex; gap:15px; width: 100%; align-items:flex-start; background:#fff; padding:15px; border-radius:8px; box-shadow:0 2px 4px rgba(0,0,0,0.05); }
.product-image { width:120px; height:120px; flex-shrink:0; border-radius:6px; overflow:hidden; background:#f5f5f5; display:flex; justify-content:center; align-items:center; }
.product-image img { width:100%; height:100%; object-fit:cover; }

.item-info {
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between; /* Artikeltext oben, Aktionen unten */
  min-height:120px;
}
.item-title { font-weight:600; font-size:1em; line-height:1.2em; overflow:hidden; text-overflow:ellipsis; }
.price-row {
  display:flex;
  justify-content:space-between;
  margin:5px 0; /* direkt unter Artikeltext */
  font-size:0.95em;
}
.item-unit-price { font-size:0.95em; color:#333; }
.item-total-price { font-weight:700;}
.item-actions {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:auto; /* zwingt diese Zeile nach unten */
}
.select-item label,
.exclude-item label { font-size:0.85em; color:#666; }

.qty-container { display:flex; align-items:center; gap:6px; }
.qty-input { width:50px; text-align:center; border:1px solid #ccc; border-radius:4px; padding:4px; }
.qty-buttons { display:flex; gap:4px; }
.qty-buttons button { padding:4px 8px; border:1px solid #ccc; border-radius:4px; background:#fff; cursor:pointer; transition:0.2s; }
.qty-buttons button:hover { background:#f0f0f0; border-color:#006699; }

/* Gesamt & Checkout */
.cart-actions { display:flex; justify-content:space-between; align-items:center; margin-top:25px; flex-wrap:wrap; gap:10px; }
.cart-total { font-size:1.2em; font-weight:700; }
.checkout-btn { background:#006699; color:#fff; border:none; padding:12px 25px; border-radius:6px; cursor:pointer; font-size:1em; transition:background .2s; }
.checkout-btn:hover { background:#004466; }

/* Footer */
footer { flex-shrink:0; background:#eee; padding:20px; text-align:center; font-size:.85em; }
.footer-links a { color:#006699; text-decoration:none; margin:0 8px; font-weight:600; transition:0.2s; }
.footer-links a:hover { text-decoration:underline; }

.item-info {
  display: flex;
  flex-direction: column;
  min-height: 120px; /* oder die Höhe deiner Karten */
}

.item-title {
  font-weight: 600;
  font-size: 1em;
  line-height: 1em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-row {
  margin: 5px 0;
  font-size: 0.95em;
}

.spacer {
  flex-grow: 1; /* füllt den freien Raum zwischen Preis und Actions */
}

.item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-height: 120px; /* Höhe = Bildhöhe */
}

.spacer {
  flex-grow: 1;
  min-height: 1em; /* optional: minimale Höhe, damit Spacer nicht komplett verschwindet */
  overflow: hidden; /* nimmt nur den "freien Raum", ohne dass der Text abgeschnitten wird */
}
/* Standard Desktop bleibt unverändert */
.cart-item-desktop {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Mobile Layout unter 500px */
@media (max-width: 500px) {
  .cart-item-desktop {
    flex-direction: column; /* Ganze Box vertikal */
    gap: 10px;
  }

  .cart-item-desktop .item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .cart-item-desktop .product-image img {
    width: 80px; /* kleineres Bild */
    height: 80px;
    object-fit: cover;
    float: left; /* Bild links */
    margin-right: 10px;
  }

  .cart-item-desktop .item-title {
    display: inline-block;
    vertical-align: middle;
  }

  .cart-item-desktop .price-row,
  .cart-item-desktop .item-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .cart-item-desktop .spacer {
    display: none; /* Leerraum entfällt auf Mobile */
  }
}
/* Standard: Mobile-Liste verstecken */
.cart-list-mobile { display: none; }

@media only screen and (max-width: 500px) {
    .cart-item-mobile .top-row {
        display: flex;           /* Bild und Titel nebeneinander */
        align-items: center;     /* Vertikal zentrieren */
        gap: 10px;               /* Abstand zwischen Bild und Titel */
    }

    .cart-item-mobile .top-row .product-image {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
    }

    .cart-item-mobile .top-row .item-title {
        flex-grow: 1;
    }

    .cart-item-mobile .bottom-row {
        display: block;          /* alles andere unterhalb */
        margin-top: 10px;
    }

    .cart-item-mobile .bottom-row .left,
    .cart-item-mobile .bottom-row .right {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }
}

@media only screen and (max-width: 500px) {
    .cart-list { display: none; }           /* Desktop-Liste ausblenden */
    .cart-list-mobile { display: block; }   /* Mobile-Liste anzeigen */
}
.cart-item-mobile {
    background:#fff;
    border-radius:8px;
    box-shadow:0 2px 4px rgba(0,0,0,0.05);
    padding:10px;
    margin-bottom:10px;
}

.cart-item-mobile .top-row {
    display:flex;
    align-items:center;
    gap:10px;
}

.cart-item-mobile .top-row .product-image {
    width:80px;
    height:80px;
    flex-shrink:0;
    border-radius:6px;
    overflow:hidden;
    background:#f5f5f5;
}

.cart-item-mobile .top-row .item-title {
    font-weight:600;
    font-size:1em;
    flex-grow:1;
}

.cart-item-mobile .bottom-row {
    margin-top:10px;
    display:flex;
    flex-direction:column;
    gap:5px;
}

.cart-item-mobile .bottom-row .left,
.cart-item-mobile .bottom-row .right {
    display:flex;
    justify-content:space-between;
}
  #unavailable-container .remove-text {
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #c00;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
    border: 1px solid #ddd;
}

#unavailable-container .remove-text:hover {
    color: #a00;
    text-decoration: underline;
}

  #active-cart-container {
  max-width: 820px;       /* wie dein Warenkorb bisher skaliert */
  margin: 0 auto;         /* zentriert */
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.unavailable-title {
  text-align: center;        /* mittig */
  font-size: 1.3rem;         /* gut lesbare Größe */
  color: #222;               /* sehr dunkles Grau, fast Schwarz */
  margin-bottom: 20px;       /* Abstand zum Grid */
  font-weight: 500;          /* nicht zu schwer, nicht zu leicht */
}
#unavailable-container {
    display: grid;
    grid-template-columns: repeat(5, 200px);
    gap: 15px;
    justify-content: center; /* zentriert die Spalten */
}

/* Unter 1020px: 3 Spalten, gleiche Breite */
@media (max-width: 1100px) {
    #unavailable-container {
        grid-template-columns: repeat(3, 200px);
    }
}

/* Unter 680px: 2 Spalten */
@media (max-width: 680px) {
    #unavailable-container {
        grid-template-columns: repeat(2, 200px);
    }
}

/* Unter 480px: 1 Spalte */
@media (max-width: 480px) {
    #unavailable-container {
        grid-template-columns: 1fr;
    }
}

#unavailable-container .section-title {
    grid-column: 1 / -1;
    font-size: 1.2rem;
    color: #555;
    text-align: left;
    margin-bottom: 10px;
    font-weight: normal;
}

#unavailable-container .product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

#unavailable-container .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

#unavailable-container .product-image {
    width: 100%;
    height: 120px;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 6px;
    flex-shrink: 0;
}

#unavailable-container .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#unavailable-container .price-block {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

#unavailable-container .old-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 3px;
}

#unavailable-container .current-price {
    font-weight: bold;
    color: #333;
}

#unavailable-container .discount {
    color: red;
    font-weight: bold;
    margin-left: 3px;
    font-size: 0.8rem;
}

#unavailable-container .quantity-control {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 6px 0;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

#unavailable-container .quantity-control button {
    border: none;
    background: #ccc;
    color: #333;
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
}

#unavailable-container .quantity-control button:hover {
    background: #bbb;
}

#unavailable-container .qty-display {
    display: inline-block;
    width: 30px;
    text-align: center;
    font-weight: bold;
}

#unavailable-container .btn-readd {
    width: 100%;
    padding: 6px 0;
    background: #c5a26e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}

#unavailable-container .btn-readd:hover {
    background: #b4925b;
}

#unavailable-container .unavailable-note {
    color: #c00;
    font-weight: bold;
    font-size: 0.85rem;
    margin-top: 6px;
}

#unavailable-container h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2em; 
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* max. 2 Zeilen */
    -webkit-box-orient: vertical;
}
