/*
 * Maiopcao - Modais refinados V10.3
 * Corrige a faixa lateral causada pelo ajuste de scrollbar do Bootstrap
 * e uniformiza a galeria ampliada / Login CRM.
 */

/* Bootstrap pode aplicar padding lateral inline ao abrir um modal. */
#loginModal,
#imagemModal {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ================================================================
   LOGIN CRM
   ================================================================ */
#loginModal .modal-dialog {
    width: calc(100% - 32px) !important;
    max-width: 520px !important;
    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    margin: 16px auto !important;
}

#loginModal .modal-content {
    width: 100% !important;
    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    align-items: stretch !important;
    border: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28) !important;
}

#loginModal .modal-header {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 24px 8px !important;
    border: 0 !important;
    background: #fff !important;
}

#loginModal .modal-title {
    margin: 0 !important;
    font-family: 'Saira', sans-serif !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: #000103 !important;
}

#loginModal .btn-close {
    margin: 0 !important;
    padding: 8px !important;
    opacity: .7;
}

#loginModal .btn-close:hover {
    opacity: 1;
}

#loginModal .modal-body {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 0 1 auto !important;
    padding: 8px 28px 28px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #fff !important;
}

#loginModal .container-fluid,
#loginModal .row,
#loginModal .col-md-12 {
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#loginModal .col-md-12 {
    display: block !important;
}

#loginModal .modal-body img {
    display: block !important;
    width: 145px !important;
    max-width: 42vw !important;
    height: auto !important;
    margin: 2px auto 20px !important;
    object-fit: contain !important;
}

#loginModal #loginForm {
    width: 100% !important;
    max-width: 390px !important;
    margin: 0 auto !important;
}

#loginModal #loginForm .form-label {
    margin-bottom: 6px !important;
    color: #1d2733 !important;
    font-weight: 500 !important;
}

#loginModal #loginForm .customizado-input,
#loginModal #loginForm .form-control {
    width: 100% !important;
    min-height: 44px !important;
    border: 1px solid #d6dce3 !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none !important;
}

#loginModal #loginForm .customizado-input:focus,
#loginModal #loginForm .form-control:focus {
    border-color: #006ABA !important;
    box-shadow: 0 0 0 3px rgba(0, 106, 186, 0.12) !important;
}

#loginModal #loginForm .btn-primary {
    min-height: 44px !important;
    border-radius: 8px !important;
}

/* ================================================================
   GALERIA DE IMAGENS EM ECRA INTEIRO
   ================================================================ */
#imagemModal {
    overflow: hidden !important;
    background: #292929 !important;
}

#imagemModal .modal-dialog {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
}

#imagemModal .modal-content {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #292929 !important;
}

#imagemModal .modal-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 20 !important;
    display: flex !important;
    justify-content: flex-end !important;
    padding: 14px 16px !important;
    border: 0 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) !important;
    pointer-events: none;
}

#imagemModal .modal-header .btn-close {
    pointer-events: auto;
    width: 34px;
    height: 34px;
    margin: 0 !important;
    padding: 8px !important;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .34);
    opacity: .9;
}

#imagemModal .modal-header .btn-close:hover {
    background-color: rgba(0, 0, 0, .56);
    opacity: 1;
}

#imagemModal .modal-body {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #292929 !important;
}

#imagemModal #modal-img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    user-select: none;
    -webkit-user-drag: none;
}

#imagemModal .modal-control {
    z-index: 12 !important;
}

/* Fotografia + informação integradas na própria imagem */
#imagemModal .image-modal-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    max-width: calc(100vw - 112px);
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    overflow: hidden;
    border-radius: 8px;
    background: #1d1d1d;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .24);
}

#imagemModal .image-modal-frame #modal-img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100vh - 28px) !important;
    max-height: calc(100dvh - 28px) !important;
    margin: 0 !important;
    object-fit: contain !important;
}

#imagemModal .image-modal-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 14;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    min-height: 112px;
    padding: 44px 18px 15px;
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .20) 20%, rgba(0, 0, 0, .82) 100%);
    pointer-events: none;
}

#imagemModal .image-modal-meta-card {
    min-width: 0;
    max-width: calc(100% - 78px);
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

#imagemModal .image-modal-title {
    margin: 0 0 3px;
    overflow: hidden;
    color: #fff;
    font-family: 'Saira', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#imagemModal .image-modal-location {
    margin-bottom: 7px;
    overflow: hidden;
    color: rgba(255, 255, 255, .88);
    font-size: .79rem;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#imagemModal .image-modal-location i {
    margin-right: 6px;
    color: #69c2ff;
}

#imagemModal .image-modal-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}

#imagemModal .image-modal-badge,
#imagemModal .image-modal-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .02em;
}

#imagemModal .image-modal-badge {
    color: #fff;
    background: rgba(0, 106, 186, .88);
    border: 1px solid rgba(255, 255, 255, .22);
}

#imagemModal .image-modal-status.status-reservado {
    color: #fff;
    background: rgba(214, 44, 54, .92);
}

#imagemModal .image-modal-status.status-propostas {
    color: #fff;
    background: rgba(0, 106, 186, .92);
}

#imagemModal .image-modal-price {
    color: #fff;
    font-size: .96rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

#imagemModal .image-modal-ref {
    color: rgba(255, 255, 255, .76);
    font-size: .73rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

#imagemModal .modal-counter {
    position: static !important;
    flex: 0 0 auto;
    min-width: 56px;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px !important;
    color: #fff !important;
    background: rgba(0, 0, 0, .60) !important;
    font-size: .84rem !important;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

@media (max-width: 767px) {
    #loginModal .modal-dialog {
        width: calc(100% - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        margin: 10px auto !important;
    }

    #loginModal .modal-content {
        max-height: calc(100vh - 20px) !important;
        border-radius: 14px !important;
    }

    #loginModal .modal-header {
        padding: 16px 18px 6px !important;
    }

    #loginModal .modal-body {
        padding: 6px 20px 22px !important;
    }

    #loginModal .modal-body img {
        width: 118px !important;
        margin-bottom: 14px !important;
    }

    #imagemModal .modal-header {
        padding: 10px !important;
    }

    #imagemModal .image-modal-meta {
        left: 10px;
        right: 10px;
        bottom: 10px;
        gap: 8px;
    }

    #imagemModal .image-modal-meta-card {
        max-width: calc(100vw - 86px);
        padding: 9px 11px;
        border-radius: 9px;
    }

    #imagemModal .image-modal-title {
        margin-bottom: 2px;
        font-size: .88rem;
    }

    #imagemModal .image-modal-location {
        margin-bottom: 6px;
        font-size: .7rem;
    }

    #imagemModal .image-modal-details {
        gap: 5px 7px;
    }

    #imagemModal .image-modal-badge,
    #imagemModal .image-modal-status {
        min-height: 22px;
        padding: 3px 7px;
        font-size: .62rem;
    }

    #imagemModal .image-modal-price {
        font-size: .83rem;
    }

    #imagemModal .image-modal-ref {
        display: none;
    }

    #imagemModal .modal-counter {
        min-width: 52px;
        padding: 6px 8px !important;
        font-size: .78rem !important;
    }
}

@media (max-width: 420px) {
    #imagemModal .image-modal-location {
        display: none;
    }

    #imagemModal .image-modal-status {
        display: none;
    }
}


/* V10.4 - ajustes responsivos da informação integrada na fotografia */
@media (max-width: 767px) {
    #imagemModal .image-modal-frame {
        max-width: calc(100vw - 28px);
        max-height: calc(100dvh - 24px);
        border-radius: 6px;
    }

    #imagemModal .image-modal-frame #modal-img {
        max-height: calc(100dvh - 24px) !important;
    }

    #imagemModal .image-modal-meta {
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 88px;
        padding: 34px 10px 9px;
        gap: 8px;
    }

    #imagemModal .image-modal-meta-card {
        max-width: calc(100% - 60px);
        padding: 0;
        border-radius: 0;
    }

    #imagemModal .image-modal-title {
        margin-bottom: 2px;
        font-size: .83rem;
    }

    #imagemModal .image-modal-location {
        margin-bottom: 5px;
        font-size: .68rem;
    }

    #imagemModal .image-modal-details {
        gap: 4px 6px;
    }

    #imagemModal .image-modal-badge,
    #imagemModal .image-modal-status {
        min-height: 20px;
        padding: 3px 6px;
        font-size: .58rem;
    }

    #imagemModal .image-modal-price {
        font-size: .78rem;
    }

    #imagemModal .image-modal-ref {
        display: none;
    }

    #imagemModal .modal-counter {
        min-width: 48px;
        padding: 5px 7px !important;
        font-size: .72rem !important;
    }
}

@media (max-width: 420px) {
    #imagemModal .image-modal-location {
        display: none;
    }

    #imagemModal .image-modal-status {
        display: none;
    }
}

/* ================================================================
   V10.5 - GALERIA COM INFORMAÇÃO FORA DA FOTOGRAFIA
   A fotografia fica 100% visível, sem texto/gradiente sobreposto.
   ================================================================ */
#imagemModal .modal-body {
    flex-direction: column !important;
}

#imagemModal .image-modal-frame {
    position: relative !important;
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 14px 72px 6px !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #292929 !important;
    box-shadow: none !important;
}

#imagemModal .image-modal-frame #modal-img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    border-radius: 7px;
    object-fit: contain !important;
}

#imagemModal .image-modal-meta {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 14;
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 10px 24px 12px !important;
    color: #fff !important;
    background: #202020 !important;
    border-top: 1px solid rgba(255, 255, 255, .08);
    pointer-events: none;
}

#imagemModal .image-modal-meta-card {
    min-width: 0 !important;
    max-width: calc(100% - 78px) !important;
    padding: 0 !important;
    color: #fff !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#imagemModal .image-modal-title {
    margin-bottom: 2px !important;
    font-size: .96rem !important;
}

#imagemModal .image-modal-location {
    margin-bottom: 5px !important;
    font-size: .76rem !important;
}

#imagemModal .image-modal-details {
    gap: 5px 9px !important;
}

#imagemModal .modal-control {
    top: calc(50% - 38px) !important;
}

@media (max-width: 767px) {
    #imagemModal .image-modal-frame {
        max-width: none !important;
        max-height: none !important;
        padding: 10px 42px 4px !important;
        border-radius: 0 !important;
    }

    #imagemModal .image-modal-frame #modal-img {
        max-height: 100% !important;
        border-radius: 5px;
    }

    #imagemModal .image-modal-meta {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        min-height: 0 !important;
        padding: 8px 10px 10px !important;
        gap: 8px !important;
        background: #202020 !important;
    }

    #imagemModal .image-modal-meta-card {
        max-width: calc(100% - 58px) !important;
        padding: 0 !important;
    }

    #imagemModal .image-modal-title {
        font-size: .82rem !important;
    }

    #imagemModal .image-modal-location {
        font-size: .67rem !important;
    }

    #imagemModal .image-modal-badge,
    #imagemModal .image-modal-status {
        min-height: 20px !important;
        padding: 3px 6px !important;
        font-size: .58rem !important;
    }

    #imagemModal .image-modal-price {
        font-size: .78rem !important;
    }

    #imagemModal .modal-control {
        top: calc(50% - 34px) !important;
    }
}

@media (max-width: 420px) {
    #imagemModal .image-modal-frame {
        padding-left: 34px !important;
        padding-right: 34px !important;
    }

    #imagemModal .image-modal-location,
    #imagemModal .image-modal-status,
    #imagemModal .image-modal-ref {
        display: none !important;
    }

    #imagemModal .image-modal-meta {
        padding-top: 7px !important;
        padding-bottom: 8px !important;
    }
}
