/* =========================================================
   CARRINHO
   Arquivo: public/assets/cliente/css/cart.css
   ========================================================= */

/* =========================================================
   CONTAINER DA PÁGINA
   ========================================================= */
.cart-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-page-compact {
    margin-bottom: 20px;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =========================================================
   LABEL / TÍTULO COMPACTO
   ========================================================= */
.cliente-account-card-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fff1f2;
    color: #df1f26;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =========================================================
   CARD DA LOJA
   ========================================================= */
.cart-store-card {
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.cart-store-card-unified {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.cart-store-card-unified-compact {
    padding: 0;
}

.cart-store-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.cart-store-card-head-main {
    min-width: 0;
    flex: 1 1 auto;
}

.cart-store-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 5px;
    font-weight: 700;
}

.cart-store-name {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    color: #222;
    margin-bottom: 7px;
}

.cart-store-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: visible;
}

.cart-store-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 0;
}

.cart-store-meta-item i {
    color: #df1f26;
    font-size: 11px;
    flex: 0 0 auto;
}

.cart-store-link {
    color: #df1f26;
    font-size: 12px;
    font-weight: 700;
}

.cart-store-link-top {
    align-self: start;
    justify-self: end;
    white-space: nowrap;
}

.cart-store-link-compact {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
}

/* =========================================================
   CARD UNIFICADO / DIVISORES
   ========================================================= */
.cart-card-unified {
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.cart-card-unified-compact {
    border: 1px solid #efefef;
    padding: 12px;
    border-radius: 18px;
}

.cart-unified-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-unified-divider {
    border: 0;
    border-top: 1px solid #efefef;
    margin: 12px 0;
}

/* =========================================================
   ITEM DO CARRINHO
   ========================================================= */
.cart-item {
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.cart-item-unified {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
}

.cart-item-unified-compact {
    gap: 10px;
}

.cart-item-image-wrap {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
}

.cart-item-image-wrap-compact {
    width: 64px;
    height: 64px;
}

.cart-item-image,
.cart-item-image-placeholder {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    background: #eee;
}

.cart-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 10px;
    text-align: center;
    padding: 6px;
}

.cart-item-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.cart-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.cart-item-head-unified {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.cart-item-head-unified-compact {
    gap: 8px;
}

.cart-item-head-main {
    min-width: 0;
    flex: 1 1 auto;
}

.cart-item-head-reflow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.cart-item-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
    color: #222;
    flex: 1 1 auto;
    min-width: 0;
}

.cart-item-title-full {
    word-break: break-word;
}

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    color: #666;
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 8px;
}

.cart-item-meta-under-title {
    margin-top: 6px;
    margin-bottom: 0;
}

.cart-item-actions {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
}

.cart-item-actions-stack {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
}

.cart-icon-btn,
.cart-addon-action {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #f3f3f3;
    color: #444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
    font-size: 12px;
}

.cart-icon-btn-danger,
.cart-addon-action-danger {
    background: #fff1f1;
    color: #c62828;
}

.cart-icon-btn:hover,
.cart-addon-action:hover {
    opacity: 0.92;
}

/* =========================================================
   ADICIONAIS
   ========================================================= */
.cart-item-addons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.cart-item-addon {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px 9px;
    font-size: 11px;
    color: #444;
}

.cart-item-addon-advanced {
    align-items: center;
    padding: 8px 9px;
}

.cart-item-addon-advanced-compact {
    padding: 8px 9px;
    border-radius: 10px;
}

.cart-item-addon-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 11px;
    line-height: 1.35;
}

.cart-item-addon-main strong {
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.cart-item-addon-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

/* =========================================================
   TOTAL DO ITEM
   ========================================================= */
.cart-item-total {
    color: #222;
    font-weight: 800;
    font-size: 13px;
    margin-top: 1px;
}

.cart-item-total-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.cart-item-total-right {
    min-width: 74px;
    text-align: right;
    font-size: 14px;
    font-weight: 800;
    color: #222;
    white-space: nowrap;
    margin-top: 2px;
}

.cart-item-total-bottom {
    align-self: flex-end;
}

/* =========================================================
   RESUMO
   ========================================================= */
.cart-summary {
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #efefef;
}

.cart-summary-compact {
    padding: 14px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.35;
}

.cart-summary-total {
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 10px;
    font-size: 16px;
}

/* =========================================================
   AÇÕES
   ========================================================= */
.cart-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-actions .btn,
.cart-actions a.btn {
    width: 100%;
}

.cart-actions-compact .btn,
.cart-actions-compact a.btn {
    min-height: 44px;
}

/* =========================================================
   ESTADO VAZIO
   ========================================================= */
.empty-state {
    background: #fff;
    border: 1px solid #efefef;
    border-radius: 18px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.empty-state-title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    color: #222;
}

.empty-state-text {
    margin: 0 0 16px;
    color: #666;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 700;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 640px) {
    .cart-page {
        gap: 10px;
    }

    .cart-store-card {
        border-radius: 16px;
        padding: 12px;
    }

    .cart-store-card-head {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: start;
    }

    .cart-store-link-top {
        justify-self: end;
        align-self: start;
    }

    .cart-store-name {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .cart-store-meta {
        gap: 5px;
        flex-wrap: nowrap;
        overflow: visible;
    }

    .cart-store-meta-item {
        font-size: 10px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .cart-store-link-compact {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 11px;
        border-radius: 11px;
    }

    .cart-card-unified,
    .cart-card-unified-compact {
        padding: 10px;
        border-radius: 16px;
    }

    .cart-unified-divider {
        margin: 10px 0;
    }

    .cart-item,
    .cart-item-unified {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 8px;
    }

    .cart-item-image-wrap,
    .cart-item-image-wrap-compact {
        width: 60px;
        height: 60px;
    }

    .cart-item-image,
    .cart-item-image-placeholder {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }

    .cart-item-head-reflow {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cart-item-title {
        font-size: 13px;
    }

    .cart-item-meta {
        font-size: 10px;
        gap: 4px 6px;
        margin-bottom: 7px;
    }

    .cart-item-actions,
    .cart-item-actions-stack {
        gap: 4px;
    }

    .cart-icon-btn,
    .cart-addon-action {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .cart-item-total-right {
        min-width: 68px;
        font-size: 13px;
    }

    .cart-item-addon-advanced,
    .cart-item-addon-advanced-compact {
        padding: 7px 8px;
    }

    .cart-item-addon-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        font-size: 10px;
    }

    .cart-item-addon-main strong {
        font-size: 10px;
    }

    .cart-summary,
    .cart-summary-compact {
        padding: 12px;
        border-radius: 16px;
    }

    .cart-summary-row {
        font-size: 13px;
        padding: 6px 0;
    }

    .cart-summary-total {
        font-size: 15px;
        padding-top: 9px;
    }
    
    .cart-actions {
    grid-template-columns: 1fr;
    }

    .cart-actions .btn,
    .cart-actions a.btn {
        width: 100%;
    }

    .cart-actions-compact .btn,
    .cart-actions-compact a.btn {
        min-height: 42px;
    }

    .empty-state {
        border-radius: 16px;
        padding: 20px 14px;
    }

    .empty-state-title {
        font-size: 20px;
    }

    .empty-state-text {
        font-size: 13px;
    }
}

/* =========================================================
   CORREÇÃO FINAL CARRINHO
   ========================================================= */

/* "carrinho" não deve ser badge vermelha */
.cart-page .cliente-account-card-label {
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #888;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

/* botão voltar à loja: fundo vermelho e texto branco visível */
.cart-store-link-top.btn,
.cart-store-link-top.btn:visited,
.cart-store-link-top.btn:hover,
.cart-store-link-top.btn:focus {
    background: #df1f26;
    color: #fff;
    text-decoration: none;
}

/* ações do item sempre no canto superior direito */
.cart-item-head-reflow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.cart-item-actions,
.cart-item-actions-stack {
    justify-self: end;
    align-self: start;
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
}

/* botões duplicar/remover */
.cart-icon-btn,
.cart-addon-action {
    flex: 0 0 auto;
}

/* ações finais do carrinho */
.cart-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-actions .btn,
.cart-actions a.btn,
.cart-actions button.btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
}

/* garantir visual do limpar carrinho */
.cart-actions .btn-secondary,
.cart-actions button.btn-secondary {
    background: #f1f2f4;
    color: #333;
}

/* garantir visual do checkout */
.cart-actions .btn-primary,
.cart-actions a.btn-primary {
    background: #df1f26;
    color: #fff;
}

@media (max-width: 640px) {
    .cart-item-head-reflow {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .cart-item-actions,
    .cart-item-actions-stack {
        justify-self: end;
    }

    .cart-actions {
        flex-direction: column;
    }

    .cart-actions .btn,
    .cart-actions a.btn,
    .cart-actions button.btn {
        width: 100%;
    }
}

/* ajuste específico do carrinho para reduzir espaço antes do rodapé */
body.cliente-footer-float .cliente-main {
    padding-bottom: 95px;
}

.cart-page,
.cart-page-compact {
    margin-bottom: 0;
}