/* ── Boat Booking Plugin – Frontend Styles ── */

:root {
    --bb-primary:   #0066cc;
    --bb-success:   #1a8a4a;
    --bb-danger:    #cc2200;
    --bb-warning:   #e68a00;
    --bb-bg:        #f8f9fa;
    --bb-border:    #dee2e6;
    --bb-text:      #212529;
    --bb-muted:     #6c757d;
    --bb-radius:    10px;
    --bb-shadow:    0 2px 12px rgba(0,0,0,.08);
}

#cb-wrap { max-width: 780px; margin: 0 auto; font-family: inherit; color: var(--bb-text); }
#cb-wrap * { box-sizing: border-box; }

/* ── Steps indicator ──────────────────────────────── */
.cb-steps {
    display: flex;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--bb-border);
    padding-bottom: 12px;
    gap: 4px;
}
.cb-step {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
    color: var(--bb-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -14px;
    transition: .2s;
}
.cb-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--bb-border);
    color: var(--bb-muted);
    font-weight: 700;
    font-size: 12px;
    margin-right: 5px;
}
.cb-step.active         { color: var(--bb-primary); border-bottom-color: var(--bb-primary); }
.cb-step.active span    { background: var(--bb-primary); color: #fff; }
.cb-step.completed      { color: var(--bb-success); }
.cb-step.completed span { background: var(--bb-success); color: #fff; }

/* ── Panel ────────────────────────────────────────── */
.cb-panel { animation: bb-fadein .3s ease; }
.cb-panel h3 { margin: 0 0 16px; font-size: 1.2rem; }
.hidden { display: none !important; }

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

/* ── Back button ──────────────────────────────────── */
.cb-back {
    background: none; border: none; padding: 0;
    color: var(--bb-primary); cursor: pointer;
    font-size: 14px; margin-bottom: 12px;
    display: inline-flex; align-items: center; gap: 4px;
}
.cb-back:hover { text-decoration: underline; }

/* ── Calendar ─────────────────────────────────────── */
  #cb-calendar {
    background: #fff;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    box-shadow: var(--bb-shadow);
    overflow: hidden;
    max-width: 480px;
}
.cb-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bb-primary);
    color: #fff;
    padding: 12px 16px;
}
.cb-cal-nav button {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: .15s;
}
.cb-cal-nav button:hover { background: rgba(255,255,255,.35); }
  #cb-cal-title { font-weight: 700; font-size: 1rem; }

.cb-cal-legend {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    font-size: 12px;
    background: #f0f4f8;
    border-bottom: 1px solid var(--bb-border);
}
.cb-cal-legend span::before {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.l-avail::before  { background: #28a745; }
.l-partial::before{ background: #fd7e14; }
.l-full::before   { background: #dc3545; }

  #cb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}
.cb-cal-dow {
    padding: 6px 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--bb-muted);
    background: #f8f9fa;
    border-bottom: 1px solid var(--bb-border);
}
.cb-cal-day {
    padding: 10px 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: .15s;
    position: relative;
}
.cb-cal-day.empty   { cursor: default; }
.cb-cal-day.past    { color: #ccc; cursor: default; }
.cb-cal-day.avail   { color: #155724; }
.cb-cal-day.avail:hover { background: #d4edda; border-color: #28a745; border-radius: 6px; }
.cb-cal-day.partial { color: #856404; }
.cb-cal-day.partial:hover { background: #fff3cd; border-color: #ffc107; border-radius: 6px; }
.cb-cal-day.full    { color: #721c24; cursor: default; }
.cb-cal-day.selected {
    background: var(--bb-primary) !important;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 700;
}
.cb-cal-day.today::after {
    content: '';
    display: block;
    width: 4px; height: 4px;
    background: var(--bb-primary);
    border-radius: 50%;
    margin: 2px auto 0;
}
.cb-cal-day.avail.today::after { background: #155724; }

/* ── Time slots ───────────────────────────────────── */
.cb-chosen-date { font-weight: 600; color: var(--bb-primary); margin-bottom: 12px; }

  #cb-time-slots,   #cb-duration-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.cb-slot {
    padding: 8px 16px;
    border: 2px solid var(--bb-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    transition: .15s;
}
.cb-slot:hover   { border-color: var(--bb-primary); color: var(--bb-primary); }
.cb-slot.selected { border-color: var(--bb-primary); background: var(--bb-primary); color: #fff; }
.cb-slot.dur-slot { min-width: 120px; }
.cb-slot .dur-price { display: block; font-size: 12px; font-weight: 700; opacity: .85; }

/* ── Price preview ────────────────────────────────── */
.cb-price-box {
    background: linear-gradient(135deg, #0066cc, #0044aa);
    color: #fff;
    border-radius: var(--bb-radius);
    padding: 16px 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: var(--bb-shadow);
}

/* ── Booking summary ──────────────────────────────── */
  #cb-booking-summary {
    background: #eef4ff;
    border: 1px solid #c5d8f7;
    border-radius: var(--bb-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
}
  #cb-booking-summary strong { color: var(--bb-primary); }

/* ── Form fields ──────────────────────────────────── */
.cb-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 540px) { .cb-field-row { grid-template-columns: 1fr; } }

.cb-field { margin-bottom: 16px; }
.cb-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--bb-text);
}
.cb-field input,
.cb-field select,
.cb-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--bb-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .15s;
    background: #fff;
    font-family: inherit;
}
.cb-field input:focus,
.cb-field select:focus,
.cb-field textarea:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,.1);
}
.req { color: var(--bb-danger); }

/* ── Buttons ──────────────────────────────────────── */
.cb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    text-decoration: none;
    gap: 6px;
}
.cb-btn-primary {
    background: var(--bb-primary);
    color: #fff;
}
.cb-btn-primary:hover { background: #0052a3; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,102,204,.3); }
.cb-btn-primary:disabled { background: #aac4e4; cursor: not-allowed; transform: none; box-shadow: none; }
.cb-btn-next { margin-top: 8px; }

/* ── Error message ────────────────────────────────── */
.cb-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--bb-danger);
    margin-bottom: 16px;
    font-size: 14px;
}

/* ── Spinner ──────────────────────────────────────── */
.cb-spinner-wrap { text-align: center; padding: 60px 20px; }
.cb-spinner {
    width: 48px; height: 48px;
    border: 5px solid #e0e0e0;
    border-top-color: var(--bb-primary);
    border-radius: 50%;
    animation: bb-spin .8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes bb-spin { to { transform: rotate(360deg) } }

/* ── Result screens ───────────────────────────────── */
.cb-result {
    text-align: center;
    padding: 48px 24px;
    border-radius: var(--bb-radius);
    max-width: 520px;
    margin: 0 auto;
}
.cb-result-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
}
.cb-result h2 { font-size: 1.5rem; margin-bottom: 12px; }
.cb-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.cb-error   { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; }

.cb-receipt {
    text-align: left;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 2;
}
.cb-note { font-size: 13px; opacity: .85; }

/* ── Loading overlay ──────────────────────────────── */
.cb-loading { position: relative; pointer-events: none; opacity: .6; }

/* ── Skipper radio cards ──────────────────────────────── */
.cb-skipper-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 520px) { .cb-skipper-options { grid-template-columns: 1fr; } }

.cb-radio-card {
    display: block;
    border: 2px solid var(--bb-border);
    border-radius: var(--bb-radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: .15s;
    background: #fff;
    position: relative;
}
.cb-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.cb-radio-card:hover       { border-color: var(--bb-primary); }
.cb-radio-card.selected    { border-color: var(--bb-primary); background: #eef4ff; }
.cb-radio-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 5px;
}
.cb-radio-desc {
    display: block;
    font-size: 12px;
    color: var(--bb-muted);
    line-height: 1.5;
}

/* ── Duration breakdown ───────────────────────────────── */
.dur-breakdown {
    display: block;
    font-size: 11px;
    color: var(--bb-muted);
    margin-top: 2px;
}

/* ── Price detail (in price box) ─────────────────────── */
.cb-price-detail {
    font-size: 13px;
    font-weight: 400;
    opacity: .8;
    margin-left: 6px;
}

/* ── Step intro text ─────────────────────────────────── */
.cb-step-intro { color: var(--bb-muted); margin-bottom: 20px; }

/* ── Big skipper cards (Step 1) ──────────────────────── */
.cb-skipper-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}
@media (max-width: 560px) { .cb-skipper-cards { grid-template-columns: 1fr; } }

.cb-skipper-card {
    border: 3px solid var(--bb-border);
    border-radius: 14px;
    padding: 24px 20px;
    cursor: pointer;
    text-align: center;
    transition: .2s;
    background: #fff;
    position: relative;
}
.cb-skipper-card:hover { border-color: var(--bb-primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,102,204,.12); }
.cb-skipper-card.selected { border-color: var(--bb-primary); background: #eef4ff; box-shadow: 0 6px 20px rgba(0,102,204,.15); }

.cb-skipper-card-icon  { font-size: 40px; margin-bottom: 10px; line-height: 1; }
.cb-skipper-card-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.cb-skipper-card-desc  { font-size: 13px; color: var(--bb-muted); line-height: 1.8; }
.cb-skipper-extra      { color: var(--bb-primary); font-weight: 600; }

.cb-skipper-card-check {
    position: absolute;
    top: 12px; right: 14px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--bb-primary);
    color: #fff;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: .2s;
}
.cb-skipper-card.selected .cb-skipper-card-check { opacity: 1; }

/* ── Price overview table (Step 1) ───────────────────── */
.cb-price-table {
    background: #f8f9fa;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.cb-price-table h4 { margin: 0 0 12px; font-size: 14px; color: var(--bb-muted); text-transform: uppercase; letter-spacing: .5px; }
.cb-price-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cb-price-table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid var(--bb-border); font-weight: 700; color: var(--bb-text); }
.cb-price-table td { padding: 6px 8px; border-bottom: 1px solid #eee; }
.cb-price-table td small { color: var(--bb-muted); }
.cb-price-table tr:last-child td { border-bottom: none; }

/* ── Skipper badge on calendar step ──────────────────── */
.cb-skipper-badge {
    display: inline-block;
    background: #eef4ff;
    border: 1px solid #c5d8f7;
    color: var(--bb-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ── Deposit / payment breakdown ─────────────────────── */
.cb-deposit-note {
    margin-top: 10px;
    font-size: 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 10px 14px;
    color: #5d4037;
}
.cb-summary-payment {
    margin-top: 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #5d4037;
    line-height: 1.9;
}

/* ── Mobile calendar fix ── */
@media (max-width: 768px) {
      #cb-cal-grid {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        width: 100% !important;
    }
    .cb-cal-day, .cb-cal-dow {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        font-size: 13px;
    }
      #cb-calendar {
        overflow: visible !important;
        max-width: 100% !important;
    }
}

/* ── Mobile price box fix ── */
@media (max-width: 600px) {
    .cb-price-box {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        font-size: 1rem !important;
        padding: 14px 16px !important;
        gap: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .cb-price-box .cb-price-detail {
        font-size: 12px !important;
        margin-left: 0 !important;
    }
    .cb-deposit-note {
        font-size: 13px !important;
        margin-top: 8px !important;
    }
}

/* ── Price info card (mobile-friendly) ── */
.cb-price-box {
    display: block !important;
    font-size: 14px !important;
    padding: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.cb-pi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 15px;
}
.cb-pi-time { font-weight: 600; font-size: 16px; }
.cb-pi-divider {
    border-top: 1px solid rgba(255,255,255,0.3);
    margin: 8px 0;
}
.cb-pi-deposit {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 8px 10px !important;
    margin-top: 4px;
    font-size: 16px;
}
.cb-pi-port {
    padding: 6px 10px !important;
    opacity: 0.9;
}

/* Combo cards */
.cb-combo-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin: 1.5rem 0; }
.cb-combo-card { border: 2px solid #e8e4df; border-radius: 12px; padding: 1.25rem; text-align: center; cursor: pointer; transition: border-color .2s, box-shadow .2s; position: relative; }
.cb-combo-card:hover { border-color: #E8845A; }
.cb-combo-card.selected { border-color: #E8845A; box-shadow: 0 4px 16px rgba(232,132,90,.2); }
.cb-combo-card-quads { font-size: 1.8rem; font-weight: 700; color: #E8845A; margin-bottom: .25rem; }
.cb-combo-card-label { font-size: .82rem; color: #5A5A5A; margin-bottom: .5rem; line-height: 1.4; }
.cb-combo-card-price { font-size: 1.4rem; font-weight: 700; color: #2C2C2C; }
.cb-combo-card-check { position: absolute; top: .5rem; right: .75rem; color: #E8845A; font-size: 1.1rem; opacity: 0; }
.cb-combo-card.selected .cb-combo-card-check { opacity: 1; }
@media(max-width:600px){ .cb-combo-cards { grid-template-columns: 1fr; } }
