﻿/* ── CBB Membership – Frontend Styles ───────────────────────────────────── */

/* ── Single product page – membership discount notice ─────────────────── */
.cbb-product-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff8f3;
    border: 1px solid #f5b27a;
    border-left: 4px solid #f58235;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.cbb-notice-tag {
    flex-shrink: 0;
    background: #f58235;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 3px;
    margin-top: 1px;
    white-space: nowrap;
}

.cbb-notice-text {
    color: #7a3a0e;
}

.cbb-notice-text strong {
    color: #7a3a0e;
}

/* ── Cart / checkout – price display ──────────────────────────────────── */
.cbb-original-price {
    color: #999;
    font-size: 0.9em;
    text-decoration: line-through;
    margin-right: 4px;
}

.cbb-discounted-price {
    color: #e44c4c;
    font-style: normal;
    font-weight: 600;
    text-decoration: none;
}

/* ── Cart totals – savings row ────────────────────────────────────────── */
.cbb-savings-row th,
.cbb-savings-row td {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    border-top: 1px dashed #e0e0e0 !important;
}

.cbb-savings-label {
    font-weight: 600;
    color: #f58235;
    display: block;
}

.cbb-savings-plan {
    font-size: 0.85em;
    color: #555;
    font-weight: normal;
}

.cbb-savings-amount {
    color: #f58235;
    font-weight: 700;
    font-size: 1em;
}

.cbb-savings-amount .woocommerce-Price-amount {
    color: inherit;
}


/* ══════════════════════════════════════════════════════════════════════════
   Registration Form  [cbb_membership_form]
   ══════════════════════════════════════════════════════════════════════════ */

.cbb-reg-wrap {
    max-width: 780px;
    margin: 0 auto;
    font-family: inherit;
}

.cbb-reg-heading {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 28px;
    color: #1d2327;
    border-bottom: 3px solid #f58235;
    padding-bottom: 12px;
}

/* ── Form errors ─────────────────────────────────────────────────────────── */
.cbb-form-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.cbb-form-errors ul {
    margin: 0;
    padding: 0 0 0 18px;
}

.cbb-form-errors li {
    color: #b91c1c;
    margin-bottom: 4px;
    font-size: 14px;
}

/* ── Fieldsets ───────────────────────────────────────────────────────────── */
.cbb-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 22px 26px;
    margin-bottom: 24px;
    background: #fafafa;
}

.cbb-fieldset legend {
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    padding: 0 8px;
    letter-spacing: 0.2px;
}

/* ── Grid rows ───────────────────────────────────────────────────────────── */
.cbb-form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.cbb-form-row:last-child {
    margin-bottom: 0;
}

.cbb-row-1 { grid-template-columns: 1fr; }
.cbb-row-2 { grid-template-columns: 1fr 1fr; }
.cbb-row-3 { grid-template-columns: 2fr 1fr 1fr; }

@media (max-width: 600px) {
    .cbb-row-2,
    .cbb-row-3 { grid-template-columns: 1fr; }
}

/* ── Individual fields ───────────────────────────────────────────────────── */
.cbb-field {
    display: flex;
    flex-direction: column;
}

.cbb-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.cbb-req {
    color: #ef4444;
}

/* Visually hidden but still readable by screen readers — used when an admin
   toggles field labels off but we still need them for accessibility. */
.cbb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cbb-field input[type="text"],
.cbb-field input[type="email"],
.cbb-field input[type="tel"],
.cbb-field input[type="number"],
.cbb-field input[type="date"],
.cbb-field input[type="password"],
.cbb-reg-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

.cbb-field input:focus,
.cbb-reg-form select:focus {
    border-color: #f58235;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
    outline: none;
}

.cbb-field input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

/* ── Plan dropdown & card ────────────────────────────────────────────────── */
.cbb-reg-form select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 12px;
}

.cbb-plan-card {
    background: #fff8f3;
    border: 1px solid #f5b27a;
    border-left: 4px solid #f58235;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 4px;
    animation: cbbSlideIn 0.18s ease;
}

@keyframes cbbSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cbb-plan-card-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 14px;
}

.cbb-plan-card-label {
    font-weight: 600;
    color: #374151;
    min-width: 140px;
    flex-shrink: 0;
}

.cbb-plan-card-val {
    color: #111827;
}

.cbb-green {
    color: #e07320;
    font-weight: 600;
}

.cbb-price-val {
    font-size: 16px;
    font-weight: 700;
    color: #f58235;
}

.cbb-plan-card-benefits {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #fde8d0;
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
}

/* ── Payment options ─────────────────────────────────────────────────────── */
.cbb-payment-options {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.cbb-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.cbb-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #f58235;
}

.cbb-payment-info {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
    margin-top: 4px;
}

.cbb-payment-info p {
    margin: 0 0 10px;
}

.cbb-payment-info p:last-child {
    margin-bottom: 0;
}

/* ── Additional contribution + total ─────────────────────────────────────── */
.cbb-contribution-field {
    margin-bottom: 16px;
}

.cbb-input-prefix {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    max-width: 200px;
}

.cbb-prefix-symbol {
    background: #f3f4f6;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    border-right: 1px solid #d1d5db;
}

.cbb-input-prefix input[type="number"] {
    border: none !important;
    box-shadow: none !important;
    padding: 10px 14px;
    width: 120px;
    font-size: 14px;
}

.cbb-input-prefix input[type="number"]:focus {
    outline: none;
    border: none !important;
    box-shadow: none !important;
}

.cbb-total-summary {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 340px;
}

.cbb-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #374151;
}

.cbb-total-row:last-child {
    border-bottom: none;
}

.cbb-total-final {
    background: #fff8f3;
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

#cbb-total-amount {
    color: #f58235;
    font-size: 18px;
    font-weight: 800;
}

/* ── Mission block ───────────────────────────────────────────────────────── */
.cbb-mission-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 22px 26px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.75;
    color: #374151;
}

.cbb-mission-block p {
    margin: 0 0 12px;
}

.cbb-mission-block p:last-child {
    margin-bottom: 0;
}

/* ── Signature section ───────────────────────────────────────────────────── */
.cbb-signature-fieldset { }

.cbb-sig-label-block {
    font-size: 14px;
    color: #374151;
    margin-bottom: 18px;
    line-height: 1.6;
}

.cbb-sig-label-block p {
    margin: 0;
}

.cbb-sig-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: end;
}

@media (max-width: 600px) {
    .cbb-sig-row { grid-template-columns: 1fr; }
}

.cbb-sig-field label,
.cbb-date-field label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
    display: block;
}

.cbb-sig-input {
    font-family: 'Brush Script MT', 'Segoe Script', cursive, sans-serif !important;
    font-size: 20px !important;
    color: #1d2327 !important;
    border: none !important;
    border-bottom: 2px solid #374151 !important;
    border-radius: 0 !important;
    padding: 6px 0 !important;
    background: transparent !important;
    width: 100%;
    box-sizing: border-box;
}

.cbb-sig-input:focus {
    outline: none !important;
    border-bottom-color: #f58235 !important;
    box-shadow: none !important;
}

.cbb-date-field input[type="date"] {
    border: none !important;
    border-bottom: 2px solid #374151 !important;
    border-radius: 0 !important;
    padding: 6px 0 !important;
    background: transparent !important;
    width: 100%;
    box-sizing: border-box;
}

.cbb-date-field input[type="date"]:focus {
    outline: none !important;
    border-bottom-color: #f58235 !important;
    box-shadow: none !important;
}

/* ── Submit ──────────────────────────────────────────────────────────────── */
.cbb-submit-wrap {
    text-align: center;
    margin-top: 8px;
}

.cbb-submit-btn {
    display: inline-block;
    background: #f58235;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
}

.cbb-submit-btn:hover {
    background: #e07320;
}

.cbb-submit-btn:active {
    transform: scale(0.98);
}

.cbb-req-note {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */
.cbb-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.cbb-notice--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.cbb-notice--warn {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.cbb-notice--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* ── Admin order box ─────────────────────────────────────────────────────── */
.cbb-admin-order-box {
    background: #fff8f3;
    border: 1px solid #f5b27a;
    border-radius: 6px;
    padding: 14px 18px;
    margin-top: 16px;
}

.cbb-admin-order-box h4 {
    margin: 0 0 10px;
    color: #7a3a0e;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cbb-admin-order-box table {
    width: 100%;
    font-size: 13px;
}

.cbb-admin-order-box th {
    text-align: left;
    padding: 4px 10px 4px 0;
    color: #374151;
    font-weight: 600;
    width: 40%;
}

.cbb-admin-order-box td {
    color: #111827;
}


/* ══════════════════════════════════════════════════════════════════════════
   Membership Plans Grid  [cbb_membership_plans]
   ══════════════════════════════════════════════════════════════════════════ */

.cbb-plans-grid {
    display: grid;
    gap: 24px;
    margin: 0 0 40px;
}

.cbb-plans-cols-1 { grid-template-columns: 1fr; }
.cbb-plans-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cbb-plans-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cbb-plans-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .cbb-plans-cols-3,
    .cbb-plans-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .cbb-plans-cols-2,
    .cbb-plans-cols-3,
    .cbb-plans-cols-4 { grid-template-columns: 1fr; }
}

/* ── Individual plan card ────────────────────────────────────────────────── */
.cbb-plan-item {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: box-shadow .2s, transform .2s;
}

.cbb-plan-item:hover {
    box-shadow: 0 8px 24px rgba(245, 130, 53, .15);
    transform: translateY(-3px);
}

/* ── Discount badge ──────────────────────────────────────────────────────── */
.cbb-plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #f58235;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(245, 130, 53, .4);
}

/* ── Plan header ─────────────────────────────────────────────────────────── */
.cbb-plan-header {
    margin-bottom: 16px;
}

.cbb-plan-name {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    margin: 0;
    line-height: 1.3;
}

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.cbb-plan-pricing {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.cbb-plan-price {
    font-size: 32px;
    font-weight: 800;
    color: #f58235;
    line-height: 1;
}

.cbb-plan-duration {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
}

/* ── Discount note ───────────────────────────────────────────────────────── */
.cbb-plan-discount-tag {
    display: inline-block;
    background: #fff8f3;
    border: 1px solid #f5b27a;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #e07320;
    margin: 0 0 16px;
}

/* ── Benefits list ───────────────────────────────────────────────────────── */
.cbb-plan-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex: 1;
}

.cbb-plan-benefits li {
    font-size: 14px;
    color: #374151;
    padding: 6px 0 6px 22px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    line-height: 1.5;
}

.cbb-plan-benefits li:last-child {
    border-bottom: none;
}

.cbb-plan-benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #f58235;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* ── Add to Cart button ──────────────────────────────────────────────────── */
.cbb-plan-cart-form {
    margin-top: auto;
}

.cbb-plan-btn {
    display: block;
    width: 100%;
    background: #f58235;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    letter-spacing: .3px;
    transition: background .2s, transform .1s;
}

.cbb-plan-btn:hover {
    background: #e07320;
}

.cbb-plan-btn:active {
    transform: scale(.98);
}
