/* ====================================================================
   Frete Carrinho — botão flutuante + chip de frete grátis no checkout
   Paleta alinhada ao tema (Codazon): rosa #db3e98 / #bf1363
   ==================================================================== */

:root {
    --fc-accent: #db3e98;
    --fc-accent-dark: #bf1363;
    --fc-accent-soft: #fbe6f1;
    --fc-track: #ececec;
    --fc-text: #383838;
}

/* ====================================================================
   1) Botão flutuante (FAB) — canto inferior esquerdo, minimalista/rosa
   ==================================================================== */
.fc-fab-wrap {
    position: fixed;
    left: 20px;
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 10px;
}

.fc-fab {
    position: relative;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fc-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(219, 62, 152, 0.28);
}

.fc-fab--liberado {
    background: var(--fc-accent-soft);
}

.fc-fab--loading {
    opacity: 0.7;
}

.fc-ring {
    width: 100%;
    height: 100%;
    display: block;
}

.fc-ring-bg {
    fill: none;
    stroke: var(--fc-track);
    stroke-width: 3;
}

.fc-ring-fill {
    fill: none;
    stroke: var(--fc-accent);
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.45s ease;
}

.fc-fab-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--fc-accent);
    line-height: 0;
}

.fc-fab-center svg {
    width: 28px;
    height: 28px;
    display: block;
}

/* Legenda — aparece no hover (desktop), à direita do botão */
.fc-fab-caption {
    background: #fff;
    color: var(--fc-text);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.fc-fab-wrap:hover .fc-fab-caption {
    opacity: 1;
    transform: translateX(0);
}

/* ====================================================================
   2) Modal — corrige a centralização quebrada do tema e o visual
   ==================================================================== */
#fc-modal {
    display: none;
}

/* O tema usa centralização antiga (margin-left:-400px;width:800px;left:50%;
   min-width:768px). Sobrescrevemos com a centralização padrão (margin auto). */
.modal-popup.frete-carrinho-modal .modal-inner-wrap {
    left: 0;
    right: 0;
    margin: 5rem auto;
    width: auto;
    min-width: 0;
    max-width: 420px;
    overflow: hidden;
}

.frete-carrinho-modal .modal-content {
    overflow: hidden;
    padding: 10px 28px 26px;
}

/* Botão de fechar: neutraliza o quadrado verde do tema, deixa um "x" rosa */
.frete-carrinho-modal .modal-header {
    padding-top: 18px;
}

/* O tema define `.modal-popup .action-close { display:inline-block; right:0 }`
   (0,2,0) e vence meu override por ordem de carga, deixando o "x" inline e
   desalinhando o conteúdo. Aqui usamos um seletor mais específico (0,5,0),
   escopado ao nosso modal, para forçar display:block. */
.modal-popup.frete-carrinho-modal .modal-inner-wrap .modal-header .action-close {
    display: block !important;
    right: 4px !important;
    top: 4px !important;
    background: transparent;
}

.modal-popup.frete-carrinho-modal .modal-inner-wrap .modal-header .action-close:before {
    color: var(--fc-accent);
    font-size: 24px;
}

.modal-popup.frete-carrinho-modal .modal-inner-wrap .modal-header .action-close:hover {
    background: transparent;
}

.modal-popup.frete-carrinho-modal .modal-inner-wrap .modal-header .action-close:hover:before {
    color: var(--fc-accent-dark);
}

.fc-modal-content {
    text-align: center;
    color: var(--fc-text);
}

/* Nada dentro do modal estoura a largura/altura (evita scroll e corte) */
.fc-modal-content,
.fc-modal-content * {
    box-sizing: border-box;
    max-width: 100%;
}

.fc-cep-row {
    text-align: left;
    margin-bottom: 18px;
}

.fc-cep-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.fc-cep-controls {
    display: flex;
    gap: 8px;
}

#fc-cep-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    font-size: 16px;
    letter-spacing: 1px;
}

#fc-cep-input:focus {
    border-color: var(--fc-accent);
    box-shadow: 0 0 0 1px var(--fc-accent);
}

/* Botão "Atualizar" em rosa do site (sobrepõe o verde) */
.frete-carrinho-modal .fc-cep-update,
.frete-carrinho-modal .fc-cep-update:visited {
    white-space: nowrap;
    background: var(--fc-accent);
    border: 1px solid var(--fc-accent);
    color: #fff;
}

.frete-carrinho-modal .fc-cep-update:hover,
.frete-carrinho-modal .fc-cep-update:focus {
    background: var(--fc-accent-dark);
    border-color: var(--fc-accent-dark);
    color: #fff;
}

.fc-input-error {
    color: #c62828;
    font-size: 13px;
    margin: 6px 0 0;
}

.fc-cep-inuse {
    font-size: 13px;
    color: #777;
    margin: 8px 0 0;
}

.fc-loading {
    padding: 24px 0;
    color: #777;
}

/* Anel grande no modal */
.fc-progress-block {
    padding: 8px 0 4px;
}

.fc-ring-lg-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 14px;
}

.fc-ring-lg {
    width: 100%;
    height: 100%;
    display: block;
}

.fc-ring-lg-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 700;
    color: var(--fc-accent);
}

.fc-message {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.fc-liberado {
    padding: 16px 0 8px;
}

.fc-liberado-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--fc-accent-soft);
    color: var(--fc-accent);
}

.fc-liberado-icon svg {
    width: 30px;
    height: 30px;
}

.fc-hint,
.fc-warn {
    font-size: 15px;
    margin: 8px 0 0;
}

.fc-warn {
    color: #b71c1c;
}

/* ====================================================================
   3) Chip de frete grátis no CHECKOUT (bloco de frete)
   ==================================================================== */
.fc-checkout-bar {
    margin: 14px 0;
}

.fc-checkout-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--fc-accent);
    color: #fff;
    padding: 9px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    box-shadow: 0 2px 8px rgba(219, 62, 152, 0.25);
}

.fc-checkout-chip svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .fc-fab-wrap {
        left: 14px;
        bottom: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .fc-fab {
        width: 62px;
        height: 62px;
    }
    .fc-fab-center svg {
        width: 25px;
        height: 25px;
    }
    .fc-fab-caption {
        display: none;
    }
}
