/* =====================================================
   BK Product Options — Frontend CSS (reference design)
   ===================================================== */

.bkpo-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    background: #FFF5E6;
    color: #C0392B;
    border: 2px solid #C0392B;
    border-radius: 30px;
    padding: 13px 24px;
    font-family: 'Burger', 'Arial Black', Impact, sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 14px;
}
.bkpo-trigger-btn:hover { background: #C0392B; color: #fff; }

.bkpo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.bkpo-overlay.bkpo-open { display: flex !important; }

.bkpo-popup {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}

/* Header */
.bkpo-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    flex-shrink: 0;
}
.bkpo-popup-title {
    font-family: 'snpro', Arial, sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #1A0A00;
}
.bkpo-popup-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #C0392B;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.bkpo-popup-close:hover { opacity: 0.85; }

/* Body */
.bkpo-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 8px;
    scrollbar-width: thin;
    scrollbar-color: #e8ddd4 transparent;
}
.bkpo-popup-body::-webkit-scrollbar { width: 4px; }
.bkpo-popup-body::-webkit-scrollbar-thumb { background: #e8ddd4; border-radius: 4px; }

.bkpo-popup-options { display: flex; flex-direction: column; }
.bkpo-group { margin-bottom: 4px; }

/* Group header */
.bkpo-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 4px 10px;
    gap: 10px;
}
.bkpo-group-header-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}
.bkpo-group-number {
    width: 28px; height: 28px;
    background: #C0392B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'snpro', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    margin-top: 1px;
}
.bkpo-group-info { flex: 1; }
.bkpo-group-label {
    font-family: 'snpro', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #1A0A00;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.3;
}
.bkpo-required { color: #C0392B; margin-left: 2px; }
.bkpo-group-subtitle {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
    font-family: 'snpro', Arial, sans-serif;
}
.bkpo-type-badge {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    background: #f5f0ea;
    border-radius: 6px;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'snpro', Arial, sans-serif;
    margin-top: 2px;
}

/* Choices */
.bkpo-choices {
    border: 1.5px solid #edddd0;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 2px 6px;
}
.bkpo-choice-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    cursor: pointer;
    background: #fff;
    border-bottom: 1px solid #f5ece2;
    transition: background 0.1s;
    user-select: none;
    position: relative;
}
.bkpo-choice-item:last-child { border-bottom: none; }
.bkpo-choice-item:hover { background: #fdf9f5; }
.bkpo-choice-item.bkpo-checked { background: #FFF8EE; }
.bkpo-choice-item input {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

/* Radio */
.bkpo-control.bkpo-radio-ctrl {
    width: 20px; height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.bkpo-choice-item.bkpo-checked .bkpo-control.bkpo-radio-ctrl {
    border-color: #E8890C;
    background: #E8890C;
}
.bkpo-choice-item.bkpo-checked .bkpo-control.bkpo-radio-ctrl::after {
    content: '';
    width: 7px; height: 7px;
    background: #fff;
    border-radius: 50%;
    display: block;
}

/* Checkbox */
.bkpo-control.bkpo-check-ctrl {
    width: 20px; height: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.bkpo-choice-item.bkpo-checked .bkpo-control.bkpo-check-ctrl {
    border-color: #E8890C;
    background: #E8890C;
}
.bkpo-choice-item.bkpo-checked .bkpo-control.bkpo-check-ctrl::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.bkpo-choice-emoji { font-size: 17px; flex-shrink: 0; width: 24px; text-align: center; }
.bkpo-choice-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bkpo-choice-name  { font-family: 'snpro', Arial, sans-serif; font-size: 14px; font-weight: 600; color: #1A0A00; line-height: 1.2; }
.bkpo-choice-desc  { font-size: 11px; color: #bbb; margin-top: 2px; font-family: 'snpro', Arial, sans-serif; }

.bkpo-choice-price-tag       { font-family: 'snpro', Arial, sans-serif; font-size: 13px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.bkpo-choice-price-tag.bkpo-extra  { color: #C0392B; }
.bkpo-choice-price-tag.bkpo-free   { color: #aaa; font-weight: 500; }

.bkpo-select-inner {
    width: 100%; padding: 13px 14px;
    font-family: 'snpro', Arial, sans-serif; font-size: 14px;
    color: #1A0A00; background: #fff; border: none; outline: none; cursor: pointer;
}
.bkpo-choices-input { padding: 4px; }
.bkpo-text-input, .bkpo-textarea {
    width: 100%; box-sizing: border-box; border: none;
    padding: 12px 14px; font-family: 'snpro', Arial, sans-serif;
    font-size: 14px; color: #1A0A00; background: #fff; outline: none; resize: vertical;
}

/* Error */
.bkpo-group.bkpo-error .bkpo-choices  { border-color: #C0392B; }
.bkpo-group.bkpo-error .bkpo-group-label { color: #C0392B; }

/* Footer */
.bkpo-popup-footer { flex-shrink: 0; border-top: 1px solid #f0e4d8; background: #fff; }

.bkpo-footer-summary {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px 10px; border-bottom: 1px solid #f5ece2;
}
.bkpo-footer-img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.bkpo-footer-product-name {
    font-family: 'Burger', 'Arial Black', Impact, sans-serif;
    font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: #1A0A00;
}
.bkpo-footer-base-price {
    font-family: 'snpro', Arial, sans-serif; font-size: 15px; font-weight: 700;
    color: #C0392B; margin-top: 3px;
}

.bkpo-footer-extras { padding: 0 18px; }
.bkpo-footer-extra-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; font-family: 'snpro', Arial, sans-serif;
    font-size: 13px; color: #3C1A00; border-bottom: 1px solid #f5ece2;
}
.bkpo-footer-extra-row:last-child { border-bottom: none; }
.bkpo-footer-extra-price { color: #C0392B; font-weight: 600; }

.bkpo-footer-total-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px 8px; border-top: 1px solid #f0e4d8;
}
.bkpo-footer-total-label  { font-family: 'snpro', Arial, sans-serif; font-size: 16px; font-weight: 700; color: #1A0A00; }
.bkpo-footer-total-amount { font-family: 'snpro', Arial, sans-serif; font-size: 20px; font-weight: 700; color: #C0392B; }

.bkpo-footer-buttons { display: flex; gap: 10px; padding: 6px 14px 16px; }
.bkpo-cancel-btn {
    flex: 1; background: #F5A623; color: #fff;
    font-family: 'Burger', 'Arial Black', Impact, sans-serif;
    font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
    border: none; border-radius: 30px; padding: 14px 16px; cursor: pointer; transition: opacity 0.15s;
}
.bkpo-cancel-btn:hover { opacity: 0.88; }
.bkpo-confirm-btn {
    flex: 1.6; background: #C0392B; color: #fff;
    font-family: 'Burger', 'Arial Black', Impact, sans-serif;
    font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
    border: none; border-radius: 30px; padding: 14px 16px; cursor: pointer; transition: opacity 0.15s;
}
.bkpo-confirm-btn:hover { opacity: 0.88; }

@media (max-width: 540px) {
    .bkpo-overlay { align-items: flex-end; padding: 0; }
    .bkpo-popup   { max-height: 94vh; border-radius: 20px 20px 0 0; }
}

/* ── Total line under trigger button ── */
#bkpo-trigger-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFF5E6;
    border: 1.5px solid #f0e0cc;
    border-radius: 10px;
    padding: 9px 18px;
    margin-top: -6px;
    margin-bottom: 12px;
    font-family: 'snpro', Arial, sans-serif;
}
.bkpo-trigger-total-label {
    font-size: 13px;
    font-weight: 600;
    color: #3C1A00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bkpo-trigger-total-amount {
    font-size: 16px;
    font-weight: 700;
    color: #C0392B;
    font-family: 'Burger', 'Arial Black', Impact, sans-serif;
}
