/* ═══════════════════════════════════════════════════════════════
   Quick-view de variantes — prefixo .pf-qv-
   Mecânica espelhada do cart-sidebar (drawer + overlay + Esc)
   ═══════════════════════════════════════════════════════════════ */

/* Overlay */
.pf-qv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 3600;
}
.pf-qv-overlay.pf-qv-open {
    display: block;
    animation: pfQvOverlayIn 0.25s ease forwards;
}
@keyframes pfQvOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Drawer */
.pf-qv-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: #fff;
    z-index: 3700;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.18);
}
.pf-qv-drawer.pf-qv-open {
    transform: translateX(0);
}

/* Header */
.pf-qv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--pf-secondary, #003352);
    color: #fff;
    flex-shrink: 0;
}
.pf-qv-header-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
}
.pf-qv-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}
.pf-qv-close:hover {
    background: rgba(255, 255, 255, 0.22);
}
.pf-qv-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Body */
.pf-qv-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
}

/* Loading */
.pf-qv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 160px;
    color: #7a8fa8;
    font-size: 14px;
}
.pf-qv-loading[hidden],
.pf-qv-error[hidden],
.pf-qv-content[hidden] {
    display: none !important;
}
.pf-qv-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e8edf2;
    border-top-color: var(--pf-primary, #0057A6);
    border-radius: 50%;
    animation: pfQvSpin 0.7s linear infinite;
}
@keyframes pfQvSpin {
    to { transform: rotate(360deg); }
}

/* Error */
.pf-qv-error {
    padding: 14px 16px;
    background: #fdf2f1;
    border: 1px solid #f0c4bf;
    border-radius: 8px;
    color: #b0392e;
    font-size: 13px;
    line-height: 1.4;
}

/* Product strip */
.pf-qv-product {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.pf-qv-img-wrap {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fa;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pf-qv-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pf-qv-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.pf-qv-product-info {
    flex: 1 1 auto;
    min-width: 0;
}
.pf-qv-product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pf-secondary, #003352);
    line-height: 1.35;
    margin-bottom: 6px;
}
.pf-qv-product-link {
    font-size: 12px;
    color: var(--pf-primary, #0057A6);
    text-decoration: none;
}
.pf-qv-product-link:hover {
    text-decoration: underline;
    color: var(--pf-tertiary, #00A3E0);
}

/* Eixos / chips */
.pf-qv-eixos {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pf-qv-eixo {
    min-width: 0;
}
.pf-qv-eixo-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5a6f86;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}
.pf-qv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* sem scroll horizontal em 375px */
    max-width: 100%;
}

/* Chip: seleção via box-shadow inset — NUNCA border (zero layout shift) */
.pf-qv-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: #f5f7fa;
    color: var(--pf-secondary, #003352);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #d5dee8;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    max-width: 100%;
    /* evita quebra de layout em 375px: chip encolhe, texto quebra se preciso */
    word-break: break-word;
}
.pf-qv-chip:hover:not(.pf-qv-chip--disabled):not(.pf-qv-chip--inexistente) {
    background: #eef4fb;
    box-shadow: inset 0 0 0 1px #a8c4e0;
}
.pf-qv-chip:focus-visible {
    outline: 2px solid var(--pf-primary, #0057A6);
    outline-offset: 2px;
}
.pf-qv-chip--selected {
    background: #e8f3fc;
    color: var(--pf-primary, #0057A6);
    font-weight: 600;
    box-shadow: inset 0 0 0 2px var(--pf-primary, #0057A6);
}
.pf-qv-chip--selected:hover:not(.pf-qv-chip--disabled) {
    background: #e8f3fc;
    box-shadow: inset 0 0 0 2px var(--pf-primary, #0057A6);
}

/* ── Estados dos chips (UX-QV.6) ────────────────────────────────
   esgotado     → risco diagonal (linear-gradient), permanece no grid
   inexistente  → opaco + riscado, SEM risco (distinto do esgotado)
   guest        → preço travado no footer (não no chip)
   ─────────────────────────────────────────────────────────────── */

/* Esgotado: permanece no grid, overlay com risco diagonal */
.pf-qv-chip--esgotado {
    color: #8a96a5;
}
.pf-qv-chip--esgotado::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(176, 57, 46, 0.18) 4px,
        rgba(176, 57, 46, 0.18) 6px
    );
}
.pf-qv-chip--esgotado.pf-qv-chip--selected {
    color: #8a3a32;
    box-shadow: inset 0 0 0 2px #c45a4e;
}

/* Combinação inexistente: visualmente DISTINTA do esgotado
   (sem risco diagonal — só opacidade + line-through) */
.pf-qv-chip--inexistente,
.pf-qv-chip--disabled {
    opacity: 0.38;
    cursor: not-allowed;
    color: #9aa8b8;
    background: #f0f2f5;
    box-shadow: inset 0 0 0 1px #e0e5eb;
    text-decoration: line-through;
}
.pf-qv-chip--inexistente::after,
.pf-qv-chip--disabled::after {
    display: none;
}

/* sr-only (acessibilidade) */
.pf-qv-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Summary */
.pf-qv-summary {
    margin-top: 16px;
    padding: 10px 12px;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 12px;
    color: #5a6f86;
    line-height: 1.4;
}
.pf-qv-summary[hidden] {
    display: none !important;
}

/* Footer / CTA */
.pf-qv-footer {
    flex-shrink: 0;
    padding: 14px 18px 18px;
    border-top: 1px solid #e8edf2;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pf-qv-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}
.pf-qv-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--pf-secondary, #003352);
    line-height: 1.2;
}
.pf-qv-price--locked {
    font-size: 14px;
    font-weight: 600;
    color: #7a8fa8;
}
.pf-qv-price--unavailable {
    font-size: 14px;
    font-weight: 600;
    color: #b0392e;
}
.pf-qv-price-unit {
    font-size: 13px;
    color: #7a8fa8;
}
.pf-qv-price-unit[hidden] {
    display: none !important;
}
.pf-qv-status {
    font-size: 12px;
    color: #5a6f86;
    min-height: 1.2em;
}
.pf-qv-status--ok { color: #1a7a40; }
.pf-qv-status--warn { color: #b07a1a; }
.pf-qv-status--err { color: #b0392e; }
.pf-qv-status--muted { color: #7a8fa8; }

/* Quantidade (mostrado só quando há variação comprável selecionada) */
.pf-qv-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.pf-qv-qty-row[hidden] {
    display: none !important;
}
.pf-qv-qty-label {
    font-size: 12px;
    font-weight: 600;
    color: #5a6f86;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pf-qv-qty-wrap {
    display: flex;
    align-items: center;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px #d5dee8;
    overflow: hidden;
}
.pf-qv-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    background: #f5f7fa;
    color: var(--pf-secondary, #003352);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.pf-qv-qty-btn:hover {
    background: #e8f3fc;
    color: var(--pf-primary, #0057A6);
}
.pf-qv-qty-input {
    width: 44px;
    height: 34px;
    border: 0;
    border-left: 1px solid #d5dee8;
    border-right: 1px solid #d5dee8;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    color: var(--pf-secondary, #003352);
    -moz-appearance: textfield;
}
.pf-qv-qty-input::-webkit-outer-spin-button,
.pf-qv-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pf-qv-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--pf-primary, #0057A6);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.pf-qv-add-btn:hover:not(:disabled):not(.pf-qv-add-btn--disabled) {
    background: var(--pf-tertiary, #00A3E0);
    color: #fff;
}
.pf-qv-add-btn:focus-visible {
    outline: 2px solid var(--pf-primary, #0057A6);
    outline-offset: 2px;
}
.pf-qv-add-btn--disabled,
.pf-qv-add-btn:disabled {
    background: #c5d0dc;
    color: #fff;
    cursor: not-allowed;
    opacity: 1;
}
.pf-qv-add-btn--unavailable {
    background: #c45a4e;
    cursor: not-allowed;
}
.pf-qv-add-btn--guest {
    background: var(--pf-secondary, #003352);
}
.pf-qv-add-btn--guest:hover {
    background: var(--pf-primary, #0057A6);
}

/* Mobile full-width */
@media (max-width: 480px) {
    .pf-qv-drawer {
        width: 100vw;
    }
}
