/**
 * Add-to-Cart Modal — Hotelequip
 * Abre após clicar "Adicionar ao Carrinho" nos product cards
 */

/* Overlay */
.hq-cart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hq-cart-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
.hq-cart-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
    position: relative;
}

.hq-cart-modal-overlay.is-open .hq-cart-modal {
    transform: translateY(0) scale(1);
}

/* Botão fechar */
.hq-cart-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: #f2f2f2;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #555;
    line-height: 1;
    z-index: 2;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.hq-cart-modal-close:hover {
    background: #131313;
    color: #fff;
}

/* Cabeçalho — mensagem de sucesso */
.hq-cart-modal-header {
    background: #1a7f37;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.hq-cart-modal-header svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Corpo */
.hq-cart-modal-body {
    padding: 24px 20px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

/* Imagem do produto */
.hq-cart-modal-image {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hq-cart-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Info do produto */
.hq-cart-modal-info {
    flex: 1;
    min-width: 0;
}

.hq-cart-modal-name {
    font-size: 15px;
    font-weight: 600;
    color: #131313;
    line-height: 1.4;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hq-cart-modal-qty {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
}

.hq-cart-modal-price {
    font-size: 16px;
    font-weight: 700;
    color: #131313;
    margin: 0;
}

/* Separador + subtotal */
.hq-cart-modal-subtotal {
    border-top: 1px solid #e8e8e8;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
}

.hq-cart-modal-subtotal strong {
    font-size: 15px;
    color: #131313;
    font-weight: 700;
}

/* Acções */
.hq-cart-modal-actions {
    padding: 14px 20px 20px;
    display: flex;
    gap: 10px;
}

.hq-cart-modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.2;
}

/* ← Voltar à Loja */
.hq-cart-modal-btn-back {
    background: #fff;
    color: #131313;
    border: 1.5px solid #d0d0d0;
}

.hq-cart-modal-btn-back:hover {
    background: #f5f5f5;
    color: #131313;
    border-color: #999;
}

/* Ver Carrinho */
.hq-cart-modal-btn-cart {
    background: #fff;
    color: #131313;
    border: 1.5px solid #d0d0d0;
}

.hq-cart-modal-btn-cart:hover {
    background: #f5f5f5;
    color: #131313;
    border-color: #999;
}

/* Finalizar a Compra */
.hq-cart-modal-btn-checkout {
    background: #131313;
    color: #fff;
    border: 1.5px solid #131313;
}

.hq-cart-modal-btn-checkout:hover {
    background: #004F6B;
    border-color: #004F6B;
    color: #fff;
}

/* Loader enquanto adiciona */
.hq-cart-modal-loading {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hq-cart-modal-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #004F6B;
    border-radius: 50%;
    animation: hq-spin 0.7s linear infinite;
}

@keyframes hq-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .hq-cart-modal-actions {
        flex-direction: column;
    }

    .hq-cart-modal-body {
        gap: 14px;
    }

    .hq-cart-modal-image {
        width: 72px;
        height: 72px;
    }
}
