/* --- PÁGINA DO CARRINHO --- */

/* Cabeçalho da página */
.cart-main {
    padding-top: 20px;
}

.cart-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.cart-page-header i {
    font-size: 22px;
    color: var(--blue);
}

.cart-page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

.cart-badge-count {
    background: var(--gray-light);
    color: var(--gray-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--gray-medium);
}

/* Estado vazio */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.cart-empty i {
    font-size: 56px;
    color: var(--gray-medium);
    display: block;
    margin-bottom: 18px;
}

.cart-empty h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.cart-empty p {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 24px;
}

.cart-empty-btn {
    display: inline-block;
    width: auto !important;
    padding: 12px 30px !important;
    text-decoration: none;
}

/* Título do item como link */
.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    margin-bottom: 4px;
    display: block;
    line-height: 1.4;
}

.cart-item-title:hover {
    color: var(--blue);
}

/* Imagem do item com suporte a <img> */
.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.cart-item-unit-price {
    font-size: 13px;
    color: var(--gray-dark);
    margin-bottom: 10px;
    display: block;
}

/* Subtotal por item */
.cart-item-subtotal {
    font-size: 15px;
    font-weight: 800;
    color: var(--blue);
    white-space: nowrap;
}

/* Botão remover */
.cart-remove-btn {
    background: none;
    border: none;
    color: var(--gray-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    transition: color 0.2s;
}

.cart-remove-btn:hover {
    color: #e53935;
}

/* Controle de quantidade AJAX — substitui o antigo .qty-control com form */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
    overflow: hidden;
    height: 34px;
    user-select: none;
}

.qty-btn {
    background: var(--gray-light);
    border: none;
    width: 32px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-dark);
    font-size: 11px;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

.qty-btn:hover:not(:disabled) {
    background: var(--gray-medium);
    color: var(--text-dark);
}

.qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qty-value {
    min-width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    border-left: 1px solid var(--gray-medium);
    border-right: 1px solid var(--gray-medium);
    line-height: 34px;
    padding: 0 4px;
}

/* Botão checkout como link (remove inline style do PHP) */
.btn-checkout {
    display: block;
    text-align: center;
    text-decoration: none;
}

.cart-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.cart-item {
    display: flex;
    gap: 15px;
    background-color: var(--white);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    background-color: var(--gray-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--gray-dark);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-info h4 {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-weight: 600;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* Resumo do Pedido */
.cart-summary {
    background-color: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.cart-summary h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 10px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--gray-dark);
}

.total-line {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    border-top: 1px solid var(--gray-light);
    padding-top: 15px;
    margin-top: 15px;
}

/* Opções de Entrega */
.delivery-options {
    margin: 20px 0;
    background-color: var(--gray-light);
    padding: 15px;
    border-radius: 8px;
}

.delivery-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.delivery-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.delivery-label:last-child {
    margin-bottom: 0;
}

.delivery-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.delivery-method {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.delivery-price {
    font-size: 12px;
    color: var(--blue);
    font-weight: 700;
}

.btn-checkout {
    background-color: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(30, 94, 255, 0.2);
}

.btn-checkout:hover {
    background-color: var(--blue-dark);
    box-shadow: 0 6px 15px rgba(15, 61, 179, 0.3);
}

.btn-continue-shopping {
    display: block;
    text-align: center;
    color: var(--blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 10px;
}

/* Responsividade do Carrinho */
@media (min-width: 768px) {
    .cart-container {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .cart-summary {
        width: 350px;
        position: sticky;
        top: 120px; /* Para acompanhar a rolagem da página no PC */
    }
}
/* ── Variação exibida no item ────────────────────────────── */
.cart-item-variation {
    font-size: 12px;
    color: var(--gray-dark);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item-variation i {
    font-size: 10px;
    color: var(--blue);
}

/* ── Campo CEP no resumo ─────────────────────────────────── */
.cep-row-cart {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.cep-row-cart input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.cep-row-cart input:focus {
    border-color: var(--blue);
}

.cep-row-cart button {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cep-row-cart button:hover:not(:disabled) {
    background: var(--blue-dark);
}

.cep-row-cart button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Feedback CEP ────────────────────────────────────────── */
.cep-feedback {
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.cep-success { color: #2e7d32; }
.cep-error   { color: #c62828; }
.cep-loading { color: var(--gray-dark); }