/* HF Maschinenmanager – Frontend
   Farbpalette:
   Navy  #1E1B3A
   Grün  #58b137
   Grau  #6B7280
   BG    #F4F4F4
*/

.hf-mm-archive, .hf-mm-single {
    color: #1E1B3A;
    padding-top: 104px; /* 72px Header + 32px Abstand */
}
@media (max-width: 900px) {
    .hf-mm-archive, .hf-mm-single { padding-top: 96px; }
}

.hf-mm-archive-header { margin: 0 0 30px; }
.hf-mm-archive-header h1 { margin: 0 0 8px; color: #1E1B3A; }

/* Card-Grid */
.hf-mm-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.hf-mm-cards.hf-mm-cols-1 { grid-template-columns: 1fr; }
.hf-mm-cards.hf-mm-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hf-mm-cards.hf-mm-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hf-mm-cards.hf-mm-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hf-mm-cards.hf-mm-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hf-mm-cards.hf-mm-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .hf-mm-cards, .hf-mm-cards[class*="hf-mm-cols-"] { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hf-mm-cards, .hf-mm-cards[class*="hf-mm-cols-"] { grid-template-columns: 1fr; } }

/* Shortcode-Wrapper: kein Header-Padding, die Seite selbst hat schon Abstand */
.hf-mm-shortcode-wrap { padding: 0; }

.hf-mm-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(30, 27, 58, 0.08), 0 4px 12px rgba(30, 27, 58, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.hf-mm-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30, 27, 58, 0.12); }

.hf-mm-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: #F4F4F4;
    overflow: hidden;
}
.hf-mm-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-mm-no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #6B7280; font-size: 14px; background: #F4F4F4;
}

.hf-mm-card-body { padding: 18px 20px; display: flex; flex-direction: column; flex: 1; }
.hf-mm-card-title { margin: 0 0 10px; font-size: 18px; line-height: 1.3; color: #1E1B3A; }
.hf-mm-card-title a { color: inherit; text-decoration: none; }
.hf-mm-card-title a:hover { color: #58b137; }

.hf-mm-card-meta { list-style: none; margin: 0 0 14px; padding: 0; color: #6B7280; font-size: 14px; }
.hf-mm-card-meta li { margin: 2px 0; }
.hf-mm-card-meta strong { color: #1E1B3A; font-weight: 600; }

.hf-mm-card-footer {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding-top: 12px; border-top: 1px solid #F4F4F4;
}

/* Badges */
.hf-mm-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .3px;
}
.hf-mm-card .hf-mm-badge {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 2;
}
.hf-mm-status-verfuegbar { background: #58b137; }
.hf-mm-status-reserviert { background: #F59E0B; }
.hf-mm-status-verkauft   { background: #EF4444; }

/* Buttons */
.hf-mm-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #58b137;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background .2s;
}
.hf-mm-btn:hover { background: #479029; color: #fff !important; }
.hf-mm-btn-small { padding: 6px 14px; font-size: 14px; }

/* Preis */
.hf-mm-preis-value { font-weight: 700; color: #1E1B3A; }
.hf-mm-preis { margin: 16px 0; font-size: 20px; }
.hf-mm-preis-label { color: #6B7280; font-weight: 500; margin-right: 6px; }

/* Single */
.hf-mm-single .hf-mm-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
@media (max-width: 800px) { .hf-mm-single .hf-mm-grid { grid-template-columns: 1fr; } }

.hf-mm-gallery-col .hf-mm-main-image {
    background: #F4F4F4;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex; align-items: center; justify-content: center;
}
.hf-mm-gallery-col .hf-mm-main-image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.hf-mm-thumbs {
    list-style: none; margin: 10px 0 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.hf-mm-thumbs li { width: 80px; height: 80px; }
.hf-mm-thumb {
    display: block; width: 100%; height: 100%;
    padding: 0; margin: 0; border: 2px solid transparent; border-radius: 4px;
    background: #F4F4F4; cursor: pointer; overflow: hidden;
    transition: border-color .15s, transform .15s;
}
.hf-mm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-mm-thumb:hover { transform: translateY(-1px); }
.hf-mm-thumb.is-active { border-color: #58b137; }
.hf-mm-thumb:focus-visible { outline: 2px solid #58b137; outline-offset: 2px; }

/* Hauptbild als Button */
.hf-mm-gallery-open {
    position: relative;
    padding: 0; margin: 0; border: 0; background: #F4F4F4;
    width: 100%; cursor: zoom-in; display: block;
    border-radius: 8px; overflow: hidden;
    aspect-ratio: 4 / 3;
}
.hf-mm-gallery-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-mm-zoom-hint {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(30, 27, 58, 0.75); color: #fff;
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
}
.hf-mm-gallery-open:hover .hf-mm-zoom-hint { opacity: 1; }

/* ============ Lightbox ============ */
body.hf-mm-lb-open { overflow: hidden; }
.hf-mm-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    z-index: 99999;
    align-items: center; justify-content: center;
}
.hf-mm-lightbox.is-open { display: flex; }
.hf-mm-lb-stage {
    max-width: 95vw; max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
}
.hf-mm-lb-img {
    max-width: 95vw; max-height: 90vh;
    object-fit: contain; display: block;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.hf-mm-lb-close, .hf-mm-lb-prev, .hf-mm-lb-next {
    position: absolute;
    background: rgba(255,255,255,0.1); color: #fff; border: 0;
    width: 48px; height: 48px; border-radius: 50%;
    font-size: 24px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.hf-mm-lb-close:hover, .hf-mm-lb-prev:hover, .hf-mm-lb-next:hover { background: rgba(255,255,255,0.25); }
.hf-mm-lb-close { top: 20px; right: 20px; font-size: 32px; }
.hf-mm-lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.hf-mm-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.hf-mm-lb-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 14px; background: rgba(0,0,0,0.4);
    padding: 4px 12px; border-radius: 999px;
}
@media (max-width: 600px) {
    .hf-mm-lb-close, .hf-mm-lb-prev, .hf-mm-lb-next { width: 40px; height: 40px; }
    .hf-mm-lb-close { top: 12px; right: 12px; }
    .hf-mm-lb-prev  { left: 8px; }
    .hf-mm-lb-next  { right: 8px; }
}

.hf-mm-title { margin: 0 0 16px; color: #1E1B3A; }
.hf-mm-info-col .hf-mm-badge { margin-bottom: 16px; }

.hf-mm-stammdaten {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 16px;
    margin: 16px 0;
}
.hf-mm-stammdaten dt { color: #6B7280; font-weight: 500; }
.hf-mm-stammdaten dd { margin: 0; color: #1E1B3A; font-weight: 600; }

.hf-mm-cta { margin-top: 24px; }

/* Sections */
.hf-mm-section { margin: 40px 0; }
.hf-mm-section h2 {
    margin: 0 0 16px;
    color: #1E1B3A;
    border-bottom: 2px solid #58b137;
    padding-bottom: 8px;
    display: inline-block;
}

.hf-mm-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.hf-mm-table th, .hf-mm-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #F4F4F4; }
.hf-mm-table th { width: 220px; color: #6B7280; font-weight: 500; background: #fafafa; }
.hf-mm-table tr:last-child th, .hf-mm-table tr:last-child td { border-bottom: 0; }

.hf-mm-sonder {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
}
@media (max-width: 600px) { .hf-mm-sonder { grid-template-columns: 1fr; } }
.hf-mm-sonder li {
    padding-left: 26px;
    position: relative;
    color: #1E1B3A;
}
.hf-mm-sonder li::before {
    content: "";
    position: absolute;
    left: 0; top: 4px;
    width: 18px; height: 18px;
    background: #58b137;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.hf-mm-beschreibung { color: #1E1B3A; line-height: 1.6; }

.hf-mm-pagination { margin-top: 40px; }

/* ============ Toolbar (Shortcode-App) ============ */
.hf-mm-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "search view"
        "filters filters";
    gap: 12px;
    align-items: center;
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(30, 27, 58, 0.08);
}
.hf-mm-search { grid-area: search; }
.hf-mm-view-toggle { grid-area: view; }
.hf-mm-filters { grid-area: filters; }
@media (max-width: 600px) {
    .hf-mm-toolbar {
        grid-template-columns: 1fr;
        grid-template-areas: "search" "filters" "view";
    }
    .hf-mm-view-toggle { justify-self: end; }
}
.hf-mm-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 15px;
    color: #1E1B3A;
    background: #F9FAFB;
    transition: border-color .15s, background .15s;
}
.hf-mm-search-input:focus {
    outline: none;
    border-color: #58b137;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(88, 177, 55, .15);
}
.hf-mm-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
@media (max-width: 800px) { .hf-mm-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .hf-mm-filters { grid-template-columns: 1fr; } }
.hf-mm-filter, .hf-mm-sort {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #fff;
    color: #1E1B3A;
    font-size: 14px;
    cursor: pointer;
}
.hf-mm-filter:focus, .hf-mm-sort:focus { outline: none; border-color: #58b137; }

.hf-mm-view-toggle { display: inline-flex; border: 1px solid #E5E7EB; border-radius: 6px; overflow: hidden; background: #fff; }
.hf-mm-view-btn {
    background: #fff; border: 0; padding: 8px 12px; cursor: pointer;
    color: #6B7280; display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.hf-mm-view-btn + .hf-mm-view-btn { border-left: 1px solid #E5E7EB; }
.hf-mm-view-btn:hover { color: #1E1B3A; }
.hf-mm-view-btn.is-active { background: #1E1B3A; color: #fff; }

.hf-mm-count { margin: 0 0 14px; color: #6B7280; font-size: 14px; }

/* ============ Listenansicht ============ */
.hf-mm-app[data-view="liste"] .hf-mm-cards,
.hf-mm-app[data-view="liste"] .hf-mm-cards[class*="hf-mm-cols-"] {
    grid-template-columns: 1fr;
    gap: 12px;
}
.hf-mm-app[data-view="liste"] .hf-mm-card {
    flex-direction: row;
    align-items: stretch;
}
.hf-mm-app[data-view="liste"] .hf-mm-card-media {
    flex: 0 0 240px;
    aspect-ratio: auto;
    height: auto;
    min-height: 160px;
}
.hf-mm-app[data-view="liste"] .hf-mm-card-body {
    flex: 1;
    padding: 16px 20px;
}
.hf-mm-app[data-view="liste"] .hf-mm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}
@media (max-width: 700px) {
    .hf-mm-app[data-view="liste"] .hf-mm-card { flex-direction: column; }
    .hf-mm-app[data-view="liste"] .hf-mm-card-media { flex: 0 0 auto; aspect-ratio: 4/3; }
}
