/* Compartilhar carrinho: modal do emissor (cart.php) e do receptor (global, injetado no Footer).
   Carregado em toda página (HTMLHead.html) porque o modal do receptor pode aparecer em qualquer
   lugar da loja, não só no carrinho. Usa as CSS vars do tema (variables.css) para respeitar
   qualquer paleta ativa em templates/luxe/config.php. */

.share-cart-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--palette-rgba-0-0-0-0-08, rgba(0, 0, 0, 0.5));
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.share-cart-modal-backdrop.is-open {
    display: flex;
}

.share-cart-modal {
    background: var(--theme-surface, #fff);
    color: var(--theme-text, #1a1a1a);
    width: 100%;
    max-width: 32rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
    overflow: hidden;
}

.share-cart-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--theme-border, #eee);
}

.share-cart-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.share-cart-modal-subtitle {
    font-size: 0.875rem;
    color: var(--theme-text-muted, #666);
    margin: 0.25rem 0 0;
}

.share-cart-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--theme-text-muted, #888);
    padding: 0.25rem;
}

.share-cart-modal-selectall {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--theme-border, #eee);
    font-size: 0.9rem;
    font-weight: 500;
}

.share-cart-modal-list {
    overflow-y: auto;
    padding: 0.25rem 1.5rem;
    flex: 1;
}

.share-cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--theme-border, #f0f0f0);
}

.share-cart-item:last-child {
    border-bottom: none;
}

.share-cart-checkbox,
.share-cart-select-all-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--theme-accent, #2563eb);
}

.share-cart-item-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--theme-bg-subtle, #f5f5f5);
}

.share-cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-cart-item-info {
    flex: 1;
    min-width: 0;
}

.share-cart-item-name {
    font-size: 0.875rem;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-cart-item-options {
    font-size: 0.75rem;
    color: var(--theme-text-muted, #777);
    margin: 0.25rem 0 0;
}

.share-cart-item-price {
    flex-shrink: 0;
    text-align: right;
}

.share-cart-item-oldprice {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
    margin-bottom: 0.15rem;
}

.share-cart-item-strike {
    font-size: 0.7rem;
    text-decoration: line-through;
    color: var(--theme-text-muted, #999);
}

.share-cart-item-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: #16a34a;
    border-radius: 0.25rem;
    padding: 0.05rem 0.3rem;
}

.share-cart-item-final {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.share-cart-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--theme-border, #eee);
}

.share-cart-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-dark, var(--theme-accent)) 100%);
    color: var(--theme-accent-text, #181b21);
    transition: opacity 0.15s ease;
}

.share-cart-btn-primary:hover {
    opacity: 0.92;
}

.share-cart-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.share-cart-trigger-wrap {
    position: relative;
    display: inline-flex;
}

.share-cart-hint {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #2563eb;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    z-index: 40;
}

.share-cart-hint strong {
    display: block;
    margin-bottom: 0.15rem;
}

.share-cart-hint-close {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #fff;
    opacity: 0.8;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

@media (max-width: 480px) {
    .share-cart-hint {
        width: 220px;
        right: -0.5rem;
    }
}

