/**
 * Mandabem — Calculadora de Frete
 * Integra-se ao tema ativo sem sobrescrever estilos globais.
 */

/* ============================================================
   Wrapper principal
   ============================================================ */
.mandabem-calculator {
    margin: 1.25rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    font-family: inherit;
    font-size: 0.9375rem; /* 15px */
    line-height: 1.5;
    background: #fff;
}

/* ============================================================
   Cabeçalho
   ============================================================ */
.mandabem-calc__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mandabem-calc__icon {
    width: 18px;
    height: 18px;
    color: #555;
    flex-shrink: 0;
}

/* ============================================================
   Corpo
   ============================================================ */
.mandabem-calc__body {
    padding: 1rem;
}

/* ============================================================
   Formulário (input + botão lado a lado)
   ============================================================ */
.mandabem-calc__form {
    display: flex;
    gap: 0.5rem;
}

.mandabem-calc__input {
    flex: 1;
    min-width: 0; /* evita overflow em flex */
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mandabem-calc__input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.18);
}

.mandabem-calc__btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #2271b1;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}

.mandabem-calc__btn:hover {
    background: #135e96;
}

.mandabem-calc__btn:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
}

.mandabem-calc__btn:disabled,
.mandabem-calc__btn--loading {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ============================================================
   Área de resultado
   ============================================================ */
.mandabem-calc__result {
    margin-top: 0.75rem;
    min-height: 0;
}

/* ============================================================
   Lista de fretes
   ============================================================ */
.mandabem-calc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.mandabem-calc__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.mandabem-calc__item:last-child {
    border-bottom: none;
}

.mandabem-calc__item:nth-child(even) {
    background: #fafafa;
}

.mandabem-calc__item-nome {
    font-weight: 600;
    color: #333;
}

.mandabem-calc__item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mandabem-calc__item-prazo {
    color: #666;
    font-size: 0.8125rem;
}

.mandabem-calc__item-valor {
    font-weight: 700;
    color: #2271b1;
    white-space: nowrap;
}

/* ============================================================
   Mensagem de erro
   ============================================================ */
.mandabem-calc__error {
    margin: 0;
    padding: 0.625rem 0.875rem;
    border-radius: 4px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-size: 0.875rem;
}

/* ============================================================
   Dica de CEP
   ============================================================ */
.mandabem-calc__tip {
    margin: 0.625rem 0 0;
    font-size: 0.8125rem;
    color: #888;
}

.mandabem-calc__tip a {
    color: #2271b1;
    text-decoration: none;
}

.mandabem-calc__tip a:hover {
    text-decoration: underline;
}

/* ============================================================
   Screen reader only
   ============================================================ */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   Responsivo
   ============================================================ */
@media ( max-width: 480px ) {
    .mandabem-calc__form {
        flex-direction: column;
    }

    .mandabem-calc__btn {
        width: 100%;
    }

    .mandabem-calc__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .mandabem-calc__item-info {
        gap: 0.5rem;
    }
}