/* ============================================================
 * BookBildr Plugin — Frontend Price Calculator Styles
 * ============================================================ */

/* ─── Header ──────────────────────────────────────────────── */
.bb-calc-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.bb-calc-wrap .text-center {
    text-align: center;
    font-size: 1.6em;
    font-weight: 300;
    margin: 0 0 28px;
    color: #1d2327;
}

/* ─── Form ────────────────────────────────────────────────── */
.bb-calc-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    overflow: hidden;
}

.bb-calc-columns {
    display: flex;
}

.bb-calc-left {
    flex: 1;
    padding: 24px 28px 28px;
    min-width: 0;
}

.bb-calc-right {
    width: 300px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .bb-calc-columns {
        flex-direction: column;
    }
    .bb-calc-right {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
    .bb-calc-left {
        padding: 20px;
    }
}

@media (max-width: 500px) {
    .bb-calc-left {
        padding: 16px;
    }
    .bb-field input:not([type="radio"]):not([type="checkbox"]),
    .bb-field select {
        max-width: 210px !important;
    }
}

/* ─── Section ─────────────────────────────────────────────── */
.bb-calc-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8c8f94;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f1;
}

/* ─── Form fields ─────────────────────────────────────────── */
.bb-field {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.bb-field label:first-child {
    width: 110px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #50575e;
}

.bb-field input:not([type="radio"]):not([type="checkbox"]),
.bb-field select {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    font-size: 13px;
    color: #1d2327;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    max-width: 280px;
}

.bb-field input:focus,
.bb-field select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.bb-field select option:disabled {
    color: #ccc;
    font-style: italic;
}

/* ─── Radio buttons as pills ──────────────────────────────── */
.bb-radio-group {
    display: flex;
    gap: 8px;
}

.bb-radio-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #dcdcde;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    color: #50575e;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.bb-radio-btn:hover {
    border-color: #2271b1;
}

.bb-radio-btn input[type="radio"] {
    display: none;
}

.bb-radio-btn input[type="radio"]:checked + span {
    color: #2271b1;
    font-weight: 600;
}

.bb-radio-btn:has(input[type="radio"]:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.bb-calc-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bb-calc-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #1d2327;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.bb-calc-sidebar-header .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #2271b1;
}

.bb-calc-sidebar-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bb-calc-sidebar-note {
    font-size: 12px;
    color: #8c8f94;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ─── Placeholder state ───────────────────────────────────── */
.bb-calc-placeholder {
    text-align: center;
    padding: 20px 0;
    color: #c3c4c7;
}

.bb-calc-placeholder .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
}

.bb-calc-placeholder p {
    font-size: 12px;
    margin: 0;
    line-height: 1.5;
}

/* ─── Calculate button ────────────────────────────────────── */
.bb-calc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 13px 0;
    border: none;
    border-radius: 8px;
    background: #b20a4a;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
    font-family: inherit;
    margin-top: auto;
}

.bb-calc-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.bb-calc-btn:active {
    transform: translateY(0);
}

.bb-calc-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ─── Pricing results ─────────────────────────────────────── */
.bb-pricing {
    margin-bottom: 16px;
}

.bb-pricing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13px;
    color: #50575e;
    border-bottom: 1px solid #f0f0f1;
}

.bb-pricing-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 16px;
    color: #1d2327;
    border-top: 2px solid #dcdcde;
    margin-top: 4px;
    padding-top: 10px;
}

.bb-pricing-item .bb-price {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.bb-pricing-item .bb-price.discount {
    color: #b32d2e;
}

/* ─── Loading spinner ─────────────────────────────────────── */
.bb-spinner {
    text-align: center;
    padding: 20px 0;
}

.bb-spinner div {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    border-radius: 50%;
    background: #b20a4a;
    animation: bb-bounce 1s ease-in-out infinite alternate;
}

.bb-spinner div:nth-child(2) { animation-delay: .15s; }
.bb-spinner div:nth-child(3) { animation-delay: .3s; }
.bb-spinner div:nth-child(4) { animation-delay: .45s; }

@keyframes bb-bounce {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-14px); }
}
