/* === Botão / Link "Medidas da modelo" === */

.mdm-trigger-wrap {
    margin: 14px 0 18px;
}

.mdm-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    font-family: inherit;
}

.mdm-trigger:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.mdm-trigger span {
    border-bottom: 1px solid transparent;
}

.mdm-icon {
    flex-shrink: 0;
}

/* === Modal === */

.mdm-modal[hidden] {
    display: none !important;
}

.mdm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: mdmFadeIn 0.2s ease-out;
}

.mdm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.mdm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: mdmSlideUp 0.25s ease-out;
}

@keyframes mdmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mdmSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.mdm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mdm-close:hover {
    background: #f0f0f0;
    color: #222;
}

.mdm-modal-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 24px;
    color: #1a1a1a;
    padding-right: 30px;
}

.mdm-modal-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.mdm-measurements {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mdm-measure .mdm-label {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.mdm-measure .mdm-value {
    font-size: 15px;
    color: #555;
}

.mdm-illustration {
    flex: 0 0 auto;
    width: 240px;
    max-width: 100%;
}

.mdm-illustration svg {
    width: 100%;
    height: auto;
    display: block;
}

.mdm-extra-table {
    margin-top: 28px;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    font-size: 14px;
}

.mdm-extra-table th,
.mdm-extra-table td {
    padding: 12px 16px;
    text-align: left;
    border-right: 1px solid #e5e5e5;
}

.mdm-extra-table th:last-child,
.mdm-extra-table td:last-child {
    border-right: none;
}

.mdm-extra-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #e5e5e5;
}

.mdm-extra-table td {
    color: #555;
}

/* Bloquear scroll do body quando modal aberto */
body.mdm-modal-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 600px) {
    .mdm-modal-content {
        padding: 24px 20px;
        max-height: 95vh;
    }

    .mdm-modal-title {
        font-size: 18px;
        margin-bottom: 18px;
    }

    .mdm-modal-body {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .mdm-illustration {
        width: 180px;
    }
}
