@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ============================================================
   BLOCO NO CARRINHO — botão que abre popup
   ============================================================ */
.ma-cart-wrap {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 16px 18px;
    margin: 10px 0;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
}

.ma-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ma-cart-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: 0.3px;
}

.ma-cart-ativa {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.ma-cart-ativa img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.ma-cart-ativa-info p {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #1a1a1a;
}

.ma-cart-ativa-info span {
    font-size: 11px;
    color: #888;
}

.ma-btn-abrir {
    flex-shrink: 0;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
    transition: background 0.2s;
}

.ma-btn-abrir:hover { background: #333; }

.ma-btn-remover {
    background: none;
    border: none;
    font-size: 11px;
    color: #bbb;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    flex-shrink: 0;
}

/* ============================================================
   POPUP
   ============================================================ */
#ma-emb-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: ma-fade 0.2s ease;
}

@keyframes ma-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#ma-emb-popup {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    animation: ma-up 0.25s ease;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
}

@keyframes ma-up {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Botão fechar */
.ma-popup-close {
    position: fixed;
    top: auto;
    right: auto;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000000;
    font-size: 18px;
    color: #333;
    line-height: 1;
    transition: background 0.15s;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.ma-popup-close:hover { background: #fff; }

/* ---- GALERIA ---- */
.ma-gal {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f0ede8;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.ma-gal-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}

.ma-gal-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.ma-gal-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    position: absolute;
    inset: 0;
}

.ma-gal-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ma-gal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.ma-gal-arrow.prev { left: 10px; }
.ma-gal-arrow.next { right: 10px; }

.ma-gal-dots {
    position: absolute;
    bottom: 10px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    pointer-events: none;
}

.ma-gal-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    transition: background 0.2s;
}

.ma-gal-dot.active { background: #1a1a1a; }

/* ---- CORPO ---- */
.ma-body {
    padding: 16px 18px 0;
}

.ma-pre {
    font-size: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 14px;
    display: block;
    font-weight: 500;
}

/* ---- SELETORES ---- */
.ma-sel-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.ma-sel-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid #e5e5e5;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease;
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.ma-sel-btn.active { border: 2px solid #1a4d2e; }

.ma-sel-nome {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.ma-sel-sub {
    display: block;
    font-size: 10px;
    color: #888;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- BOTÃO ---- */
.ma-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

.ma-btn-add {
    width: 100%;
    height: 46px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 23px;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.ma-btn-add:hover { background: #2a2a2a; }
.ma-btn-add.loading { opacity: 0.65; cursor: not-allowed; }

.ma-btn-nao {
    width: 100%;
    height: 38px;
    background: transparent;
    color: #aaa;
    border: 1.5px solid #e5e5e5;
    border-radius: 19px;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.ma-btn-nao:hover { border-color: #bbb; color: #777; }

/* ---- MOBILE ---- */
@media (max-width: 600px) {
    #ma-emb-overlay {
        align-items: flex-end;
        padding: 0;
        z-index: 9999999;
    }
    #ma-emb-popup {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: ma-sheet-up 0.3s ease;
        display: block !important;
        grid-template-columns: unset !important;
    }
    @keyframes ma-sheet-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    #ma-emb-popup::before {
        content: '';
        display: block;
        width: 32px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto 0;
    }
    /* X no mobile: canto superior direito do sheet */
    .ma-popup-close {
        position: fixed !important;
        bottom: auto !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
    }
    /* Esconde X fixo do desktop no mobile, usa o do body */
    .ma-body .ma-popup-close {
        position: absolute !important;
        top: 10px !important;
        right: 12px !important;
        background: rgba(0,0,0,0.07) !important;
        box-shadow: none !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }
    .ma-body {
        padding: 14px 16px 0 !important;
        display: block !important;
    }
    .ma-gal { height: 200px; }
    .ma-sel-wrap { gap: 8px !important; margin-bottom: 12px !important; }
    .ma-footer { padding-bottom: 22px !important; gap: 8px !important; }
    .ma-btn-add, .ma-btn-nao { height: 44px !important; }
}

/* ---- DESKTOP ---- */
@media (min-width: 601px) {
    #ma-emb-popup {
        max-width: 820px;
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        grid-template-rows: 1fr;
        max-height: 88vh;
        overflow: hidden;
        border-radius: 16px;
        position: relative;
    }
    /* Foto à esquerda */
    .ma-gal {
        grid-column: 1;
        grid-row: 1;
        height: 100%;
        min-height: 480px;
        width: 100%;
    }
    .ma-gal-track { height: 100%; }
    .ma-gal-slide { height: 100%; }
    .ma-gal-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }
    /* Conteúdo à direita */
    .ma-body {
        grid-column: 2;
        grid-row: 1;
        padding: 40px 36px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow-y: auto;
        position: relative;
    }
    .ma-pre { margin-bottom: 24px; }
    .ma-sel-wrap { gap: 12px; margin-bottom: 28px; }
    .ma-footer { padding-bottom: 0; gap: 10px; }
    /* X no canto do popup */
    .ma-popup-close {
        position: absolute !important;
        top: 14px !important;
        right: 14px !important;
        background: rgba(255,255,255,0.95) !important;
        box-shadow: 0 1px 6px rgba(0,0,0,0.15) !important;
        width: 32px !important;
        height: 32px !important;
    }
    /* Esconder handle do mobile */
    #ma-emb-popup::before { display: none; }
}
