/* =========================================================
   Grid + Card UI (3/2/1) + Favoriten + Toasts
   ========================================================= */

/* 1) Grid layout – 3 / 2 / 1 */
.mt-productlisthold {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-productlisthold > li {
    display: flex;
    flex: 0 0 calc((100% - 36px) / 3);
    max-width: calc((100% - 36px) / 3);
    margin: 0 !important;
}

/* 2) Card basis */
.mt-product1.ah-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .07);
    transition:
        transform .12s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.mt-productlisthold > li:hover .mt-product1.ah-card {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, .12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .10);
}

/* Altes Theme neutralisieren */
.mt-product1 .box,
.mt-product1 .b1,
.mt-product1 .b2 {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 3) Favoriten-Button innerhalb der Karte */
.mt-product1.ah-card .ah-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #5c5c5c;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    cursor: pointer;
    text-decoration: none !important;
}

.mt-product1.ah-card .ah-fav i {
    font-size: 17px;
}

.mt-product1.ah-card .ah-fav:hover {
    border-color: rgba(0, 0, 0, .12);
    background: rgba(255, 255, 255, .98);
}

.mt-product1.ah-card .ah-fav.is-active,
.mt-product1.ah-card .ah-fav.active {
    color: #ff8a00;
    border-color: rgba(255, 138, 0, .35);
    background: #fff4e6;
}

.mt-product1.ah-card .ah-fav.is-active:hover,
.mt-product1.ah-card .ah-fav.active:hover {
    border-color: rgba(255, 138, 0, .45);
    background: #fff1dd;
}

/* 4) Bild */
.mt-product1.ah-card .ah-thumb {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    aspect-ratio: 3 / 4;
}

.mt-product1.ah-card .ah-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: none !important;
}

/* 5) Text / Titel / Preis */
.mt-product1.ah-card .ah-card-body {
    padding: 8px 12px 12px;
}

.mt-product1.ah-card .ah-card-title {
    display: -webkit-box;
    min-height: calc(1.25em * 2);
    overflow: hidden;
    color: #222;
    font-size: .90rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .1px;
    text-decoration: none !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mt-product1.ah-card .ah-card-title:hover {
    color: #111;
}

.mt-product1.ah-card .ah-card-price {
    display: block;
    margin-top: .3rem;
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.1;
}

/* 6) Favoriten-Toast */
#favsekme {
    position: fixed;
    bottom: 12px;
    left: 50%;
    z-index: 99999;
    display: none;
    max-width: 92vw;
    transform: translateX(-50%);
}

#favsekme .fav-toast {
    padding: 10px 14px;
    color: #111827;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 999px;
    background: #f3f4f6;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    font-size: .95rem;
    font-weight: 600;
}

#favsekme .fav-toast.success {
    color: #1b5e20;
    border-color: rgba(27, 94, 32, .22);
    background: #e8f5e9;
}

#favsekme .fav-toast.danger {
    color: #b71c1c;
    border-color: rgba(183, 28, 28, .22);
    background: #ffebee;
}

/* 7) Bootstrap-Toast */
.ah-toast-wrap {
    z-index: 99999;
}

#ahToast {
    color: #111827;
    border-left: 6px solid #f59e0b;
    border-radius: 14px;
    background: #f3f4f6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

#ahToast .btn-close {
    filter: none;
}

/* 8) Globale Favoriten-Zustände */
.ah-fav {
    border-color: rgba(0, 0, 0, .12);
}

.ah-fav i {
    color: #555;
}

.ah-fav:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.ah-fav.active,
.ah-fav.is-active {
    border-color: rgba(255, 138, 0, .35);
    background: #fff4e6;
}

.ah-fav.active i,
.ah-fav.is-active i {
    color: #ff8a00;
}

button.ah-fav {
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .08);
    background: rgba(255, 255, 255, .94);
}

@media (max-width: 992px) {
    .mt-productlisthold > li {
        flex-basis: calc((100% - 18px) / 2);
        max-width: calc((100% - 18px) / 2);
    }

    .mt-product1.ah-card .ah-thumb {
        aspect-ratio: 1 / 1;
    }

    .mt-product1.ah-card .ah-card-price {
        font-size: .97rem;
    }
}

/* =========================
   MOBILE GRID – kompakter
   ========================= */
@media (max-width: 576px){

  .mt-productlisthold.list-inline{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
  }

  .mt-product1.large.ah-card,
  .ah-card{
    border-radius:14px;
    box-shadow:0 6px 16px rgba(0, 0, 0, .055);
  }

  .ah-thumb{
    aspect-ratio:4 / 3;
  }

  .mt-product1.large.ah-card .ah-card-body,
  .ah-card .ah-card-body{
    padding:8px 9px !important;
    gap:3px !important;
  }

  .ah-card-title{
    min-height:2.1em;
    font-size:.78rem;
    line-height:1.2 !important;
    font-weight:600;
    -webkit-line-clamp:2;
  }

  .ah-card-price{
    font-size:.88rem;
    line-height:1.1;
  }

  .ah-fav{
    top:7px;
    right:7px;
    width:30px;
    height:30px;
  }

  .ah-fav i{
    font-size:.88rem;
  }
}

/* Nur für außergewöhnlich schmale Displays */
@media (max-width: 340px){
  .mt-productlisthold.list-inline{
    grid-template-columns:1fr;
  }
}