/* ============================================================
   Bespoke Product Fields — Quick-Configure Modal
   Styled to match the BCE Boutique dark/gold palette
   ============================================================ */

/* ── Overlay ── */
.bpf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}
.bpf-overlay.bpf-visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Drawer ── */
.bpf-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: #111111;
    border-left: 1px solid #2a2a2a;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0, 0.15, 1);
    overflow: hidden;
}
.bpf-drawer.bpf-visible {
    transform: translateX(0);
}

/* ── Drawer header ── */
.bpf-drawer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #0e0e0e;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}
.bpf-drawer-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
    flex-shrink: 0;
}
.bpf-drawer-product-info {
    flex: 1;
    min-width: 0;
}
.bpf-drawer-product-name {
    font-size: 15px;
    font-weight: 600;
    color: #F0EBE0;
    margin: 0 0 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bpf-drawer-product-price {
    font-size: 14px;
    color: #C9A84C;
    margin: 0;
}
.bpf-drawer-product-price .woocommerce-Price-amount {
    color: #C9A84C;
}
.bpf-drawer-close {
    width: 36px;
    height: 36px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    color: #8a8074;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
    padding: 0;
}
.bpf-drawer-close:hover {
    color: #F0EBE0;
    border-color: #C9A84C;
}

/* ── Drawer body (scrollable) ── */
.bpf-drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #0e0e0e;
}
.bpf-drawer-body::-webkit-scrollbar { width: 4px; }
.bpf-drawer-body::-webkit-scrollbar-track { background: #0e0e0e; }
.bpf-drawer-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* ── Variations form inside modal ── */
.bpf-drawer-body .variations_form { margin-bottom: 20px; }
.bpf-drawer-body .variations td,
.bpf-drawer-body .variations th { padding: 6px 0; }
.bpf-drawer-body .variations label { color: #8a8074; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.bpf-drawer-body .variations select {
    background: #1a1a1a;
    color: #F0EBE0;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
}
.bpf-drawer-body .reset_variations { color: #8a8074; font-size: 12px; }
.bpf-drawer-body .woocommerce-variation-price .woocommerce-Price-amount { color: #C9A84C; font-size: 15px; }

/* ── Quantity row ── */
.bpf-qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1e1e1e;
}
.bpf-qty-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a8074;
}
.bpf-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}
.bpf-qty-btn {
    width: 36px;
    height: 36px;
    background: #1a1a1a;
    border: none;
    color: #8a8074;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    line-height: 1;
}
.bpf-qty-btn:hover { background: #222; color: #C9A84C; }
.bpf-qty-input {
    width: 48px;
    text-align: center;
    background: #0e0e0e;
    border: none;
    border-left: 1px solid #2a2a2a;
    border-right: 1px solid #2a2a2a;
    color: #F0EBE0;
    font-size: 15px;
    padding: 0;
    height: 36px;
    -moz-appearance: textfield;
}
.bpf-qty-input::-webkit-inner-spin-button,
.bpf-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Divider ── */
.bpf-fields-divider {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8a8074;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e1e1e;
}

/* ── Override bpf-fields styles for dark mode ── */
.bpf-drawer .bpf-label { color: #8a8074; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.bpf-drawer .bpf-required { color: #C9A84C; }
.bpf-drawer .bpf-help { color: #5a5450; }

.bpf-drawer .bpf-fields input[type="text"],
.bpf-drawer .bpf-fields input[type="date"],
.bpf-drawer .bpf-fields input[type="number"],
.bpf-drawer .bpf-fields select,
.bpf-drawer .bpf-fields textarea {
    background: #1a1a1a;
    color: #F0EBE0;
    border-color: #2a2a2a;
}
.bpf-drawer .bpf-fields input:focus,
.bpf-drawer .bpf-fields select:focus,
.bpf-drawer .bpf-fields textarea:focus {
    border-color: #C9A84C;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}
.bpf-drawer .bpf-fields select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8074' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.bpf-drawer .bpf-check-label,
.bpf-drawer .bpf-radio-label { color: #F0EBE0; }
.bpf-drawer .bpf-check-label input[type="checkbox"],
.bpf-drawer .bpf-radio-label input[type="radio"] { accent-color: #C9A84C; }

.bpf-drawer .bpf-upload-ui {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #8a8074;
}
.bpf-drawer .bpf-upload-ui:hover { background: #222; border-color: #C9A84C; }
.bpf-drawer .bpf-upload-wrap.bpf-has-file .bpf-upload-ui { border-color: #C9A84C; background: #1a1600; }
.bpf-drawer .bpf-upload-name { color: #C9A84C; }

.bpf-drawer .bpf-swatch-chip { border-color: rgba(255,255,255,.15); }
.bpf-drawer .bpf-swatch-label input:checked ~ .bpf-swatch-chip { border-color: #C9A84C; }
.bpf-drawer .bpf-tile-label { background: #1a1a1a; border-color: #2a2a2a; color: #F0EBE0; }
.bpf-drawer .bpf-tile-label:hover { border-color: #C9A84C; }
.bpf-drawer .bpf-tile-label:has(input:checked) { border-color: #C9A84C; background: #1a1600; }

.bpf-drawer .bpf-notice-block { background: #161400; border-left-color: #C9A84C; }
.bpf-drawer .bpf-notice-label,
.bpf-drawer .bpf-notice-text { color: #C9A84C; }

.bpf-drawer .bpf-conditional { border-left-color: #2a2a2a; }

/* ── Drawer footer ── */
.bpf-drawer-footer {
    padding: 16px 24px;
    background: #0e0e0e;
    border-top: 1px solid #2a2a2a;
    flex-shrink: 0;
}
.bpf-drawer-submit {
    width: 100%;
    padding: 14px 20px;
    background: #C9A84C;
    color: #0e0e0e;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.bpf-drawer-submit:hover { background: #d4b45a; }
.bpf-drawer-submit:active { transform: scale(0.98); }
.bpf-drawer-submit:disabled {
    background: #2a2a2a;
    color: #5a5450;
    cursor: not-allowed;
    transform: none;
}

/* ── Messages ── */
.bpf-drawer-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    display: none;
}
.bpf-drawer-message.bpf-msg-error {
    display: block;
    background: #2a0a0a;
    border: 1px solid #6b1a1a;
    color: #f87171;
}
.bpf-drawer-message.bpf-msg-success {
    display: block;
    background: #0a1a00;
    border: 1px solid #1a4a00;
    color: #86efac;
}
.bpf-drawer-message.bpf-msg-inquiry {
    display: block;
    background: #1a1400;
    border: 1px solid #C9A84C;
    color: #C9A84C;
}

/* ── Loading skeleton ── */
.bpf-drawer-loading {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
}
.bpf-skel {
    background: linear-gradient(90deg, #1a1a1a 25%, #242424 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: bpfSkel 1.4s infinite;
    border-radius: 6px;
}
.bpf-skel-title { height: 18px; width: 55%; }
.bpf-skel-field { height: 44px; width: 100%; }
.bpf-skel-field-sm { height: 44px; width: 70%; }
@keyframes bpfSkel {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Inquiry notice in modal ── */
.bpf-drawer .bpf-inquiry-notice {
    background: #1a1400;
    border-color: #C9A84C;
    margin-bottom: 0;
}
.bpf-drawer .bpf-inquiry-message { color: #C9A84C; }
.bpf-drawer .bpf-inquiry-btn { background: #C9A84C !important; color: #0e0e0e !important; }

/* ── Mobile ── */
@media (max-width: 560px) {
    .bpf-drawer { max-width: 100%; border-left: none; border-top: 1px solid #2a2a2a; }
    .bpf-drawer-body { padding: 16px; }
    .bpf-drawer-header { padding: 16px; }
    .bpf-drawer-footer { padding: 12px 16px; }
}
