/* ── Overlay ─────────────────────────────────────────── */
#vfl-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#vfl-overlay.vfl-open {
    display: flex;
}

/* ── Popup card ──────────────────────────────────────── */
#vfl-popup {
    background: #faf8f5;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    animation: vflFadeIn 0.22s ease;
}

@keyframes vflFadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Close button ────────────────────────────────────── */
#vfl-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    z-index: 10;
    padding: 0 4px;
    transition: color 0.2s;
}
#vfl-close:hover { color: #111; }

/* ── Inner layout ────────────────────────────────────── */
#vfl-popup-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* ── Image side ──────────────────────────────────────── */
#vfl-popup-image {
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    background: #ece8e0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

#vfl-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

/* ── Details side ────────────────────────────────────── */
#vfl-popup-details {
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#vfl-category {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #b8934a;
    margin: 0;
    font-weight: 600;
}

#vfl-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

#vfl-price {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 500;
}

#vfl-price del {
    color: #aaa;
    font-size: 13px;
    margin-right: 6px;
}

#vfl-price ins {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 700;
}

/* ── Attributes ──────────────────────────────────────── */
#vfl-attributes {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vfl-attr-group label.vfl-attr-label {
    display: block;
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 8px;
    font-weight: 600;
}

.vfl-attr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vfl-attr-options button {
    padding: 7px 16px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}

.vfl-attr-options button:hover {
    border-color: #b8934a;
    color: #b8934a;
}

.vfl-attr-options button.vfl-selected {
    border-color: #b8934a;
    background: #b8934a;
    color: #fff;
}

/* ── Quantity row ────────────────────────────────────── */
#vfl-qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

#vfl-qty-row > span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
    font-weight: 600;
}

#vfl-qty-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.vfl-qty-btn {
    width: 34px;
    height: 34px;
    background: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vfl-qty-btn:hover { background: #f0ece4; }

#vfl-qty {
    width: 44px;
    height: 34px;
    border: none;
    border-left: 1.5px solid #ddd;
    border-right: 1.5px solid #ddd;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: #1a1a1a;
    -moz-appearance: textfield;
}
#vfl-qty::-webkit-inner-spin-button,
#vfl-qty::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Add to cart button ──────────────────────────────── */
#vfl-atc-btn {
    width: 100%;
    padding: 13px 20px;
    background: #b8934a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
}

#vfl-atc-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#vfl-atc-btn:not(:disabled):hover {
    background: #a07838;
}

#vfl-atc-btn.vfl-loading {
    opacity: 0.75;
    pointer-events: none;
}

/* ── Message ─────────────────────────────────────────── */
#vfl-message {
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    border-radius: 6px;
    padding: 0;
    transition: all 0.2s;
}

#vfl-message.vfl-success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 8px 12px;
}

#vfl-message.vfl-error {
    color: #c62828;
    background: #ffebee;
    padding: 8px 12px;
}

/* ── Loader ──────────────────────────────────────────── */
#vfl-popup.vfl-loading-state #vfl-popup-inner {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 680px) {
    #vfl-overlay {
        padding: 20px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #vfl-popup {
        border-radius: 12px !important;
        max-height: 86vh !important;
        width: calc(100% - 0px) !important;
        overflow-y: auto !important;
        position: relative !important;
        bottom: auto !important;
        top: auto !important;
    }

    #vfl-popup-inner {
        grid-template-columns: 1fr !important;
    }

    #vfl-popup-image {
        border-radius: 12px 12px 0 0 !important;
        min-height: 190px !important;
        max-height: 210px !important;
    }

    #vfl-popup-details {
        padding: 20px 18px 24px !important;
        gap: 12px !important;
    }

    #vfl-close {
        top: 10px !important;
        right: 12px !important;
        font-size: 22px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 50% !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    }

    #vfl-name {
        font-size: 18px !important;
    }

    .vfl-attr-options button {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    #vfl-atc-btn {
        padding: 14px 20px !important;
        font-size: 14px !important;
    }
}
