.kdg-medlemsmarknad-area * {
    box-sizing: border-box;
}

.kdg-mm-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.kdg-mm-header-row h2 {
    margin-top: 0;
}

.kdg-mm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.kdg-mm-card {
    min-width: 0;
    height: 100%;
}

.kdg-mm-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 310px;
    border: 1px solid #dce9df;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    color: #063b28;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kdg-mm-card-link:hover {
    transform: translateY(-2px);
    border-color: #bde8c7;
    box-shadow: 0 12px 26px rgba(0,0,0,0.08);
}

.kdg-mm-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f4f8f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a887f;
    font-weight: 700;
}

.kdg-mm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kdg-mm-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.kdg-mm-card-body h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
}

.kdg-mm-price {
    margin: 0;
    font-weight: 800;
    color: #087d35;
}

.kdg-mm-empty {
    grid-column: 1 / -1;
}

.kdg-mm-single-card {
    overflow: hidden;
}

.kdg-mm-single-layout {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.kdg-mm-single-image {
    width: 100%;
    border: 1px solid #dce9df;
    border-radius: 14px;
    overflow: hidden;
    background: #f4f8f5;
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a887f;
    font-weight: 700;
}

.kdg-mm-single-image img {
    width: 100%;
    height: auto;
    display: block;
}

.kdg-mm-single-details {
    min-width: 0;
}

.kdg-mm-single-details h2 {
    margin-top: 0;
}

.kdg-mm-single-price {
    font-size: 20px;
    margin-bottom: 16px;
}

.kdg-mm-description,
.kdg-mm-contact-box {
    border: 1px solid #dce9df;
    border-radius: 14px;
    padding: 16px;
    background: #fbfdfb;
    margin: 16px 0;
    overflow-wrap: anywhere;
}

.kdg-mm-description h3,
.kdg-mm-contact-box h3 {
    margin-top: 0;
}

.kdg-mm-back {
    margin-bottom: 16px;
}

.kdg-mm-form p {
    margin: 0 0 14px;
}

.kdg-mm-form label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
    color: #063b28;
}

.kdg-mm-form input[type="text"],
.kdg-mm-form textarea,
.kdg-mm-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    border: 1px solid #dce9df;
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffffff;
}

.kdg-mm-current-image {
    margin: 0 0 16px;
}

.kdg-mm-current-image img {
    border-radius: 10px;
    border: 1px solid #dce9df;
}

.kdg-mm-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    padding: 24px;
}

.kdg-mm-modal.is-open {
    display: block;
}

.kdg-mm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.kdg-mm-modal-dialog {
    position: relative;
    z-index: 1;
    max-width: 720px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.28);
}

.kdg-mm-modal-dialog h2 {
    margin-top: 0;
}

.kdg-mm-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f4f8f5;
    color: #063b28;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.kdg-mm-divider {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid #dce9df;
}

.kdg-mm-delete-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #b00020;
    border-radius: 10px;
    background: #ffffff;
    color: #b00020;
    padding: 10px 16px;
    font-weight: 800;
    cursor: pointer;
}

.kdg-mm-delete-button:hover {
    background: #b00020;
    color: #ffffff;
}

.kdg-mm-notice {
    margin-bottom: 18px;
}

body.kdg-mm-modal-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .kdg-mm-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .kdg-mm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kdg-mm-single-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .kdg-mm-grid {
        grid-template-columns: 1fr;
    }

    .kdg-mm-modal {
        padding: 10px;
    }

    .kdg-mm-modal-dialog {
        max-height: calc(100vh - 20px);
        padding: 20px;
    }
}
