/* ================================================================
   BLUE BINS — Floating Booking Widget
   Appears on all pages except homepage, cart & checkout.
   Namespaced: .bbf-*
   ================================================================ */

/* ── Base variables (mirror homepage tokens) ───────────────────── */
.bbf-widget {
  --bbf-navy:   #0A1628;
  --bbf-blue:   #1B6FE8;
  --bbf-sky:    #3B9EFF;
  --bbf-green:  #22C55E;
  --bbf-border: #E8EDF5;
  --bbf-grey:   #F7F8FA;
  --bbf-muted:  #64748B;
  --bbf-radius: 14px;
  --bbf-shadow: 0 8px 40px rgba(10,22,40,.18);
  --ff-display: 'Sora', system-ui, sans-serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;
  font-family: var(--ff-body);

  /* Fixed positioning */
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Toggle button (always visible) ────────────────────────────── */
.bbf-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--bbf-blue) 0%, #0d3b8e 100%);
  color: #ffffff;
  border: none;
  border-radius: 32px;
  padding: 14px 22px 14px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--ff-display);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(27,111,232,.45);
  transition: transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  outline-offset: 3px;
}

.bbf-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(27,111,232,.55);
}

.bbf-toggle:active {
  transform: translateY(0);
}

.bbf-toggle__icon {
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bbf-toggle__label { transition: opacity .15s ease; }

.bbf-toggle__x {
  display: none;
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  opacity: .85;
}

/* When panel is open: swap label → ✕ */
.bbf-widget--open .bbf-toggle__label { display: none; }
.bbf-widget--open .bbf-toggle__x     { display: block; }

/* ── Panel (slides up from above the button) ────────────────────── */
.bbf-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 370px;
  background: #ffffff;
  border-radius: var(--bbf-radius);
  box-shadow: var(--bbf-shadow);
  overflow: hidden;

  /* Collapsed state */
  opacity: 0;
  transform: translateY(14px) scale(.97);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.bbf-widget--open .bbf-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Panel header ───────────────────────────────────────────────── */
.bbf-panel__header {
  background: var(--bbf-navy);
  color: #ffffff;
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bbf-panel__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(27,111,232,.1);
  color: var(--bbf-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bbf-panel__title {
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.bbf-panel__sub {
  font-size: 12px;
  color: rgba(255,255,255,.60);
  margin-top: 2px;
}

/* ── Form body ──────────────────────────────────────────────────── */
.bbf-form {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Label rows */
.bbf-label {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--ff-display);
  color: var(--bbf-navy);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.bbf-sub-label {
  display: block;
  margin: 2px 0 -1px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bbf-navy);
  font-family: var(--ff-display);
}

.bbf-step-summary {
  display: none;
  border: 1px solid var(--bbf-border);
  background: #f8fbff;
  color: var(--bbf-navy);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.35;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bbf-step-summary::before {
  content: '✓';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bbf-group.bbf-step-collapsed .bbf-step-summary {
  display: flex;
}

.bbf-step-summary__text {
  font-weight: 600;
  flex: 1;
}

.bbf-step-summary__edit {
  border: 1px solid var(--bbf-border);
  background: #fff;
  color: var(--bbf-blue);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}

.bbf-group.bbf-step-collapsed .bbf-label,
.bbf-group.bbf-step-collapsed .bbf-inline-row,
.bbf-group.bbf-step-collapsed .bbf-size-grid,
.bbf-group.bbf-step-collapsed .bbf-waste-grid,
.bbf-group.bbf-step-collapsed .bbf-message {
  display: none;
}

.bbf-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--bbf-blue);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Waste type grid (2×2) ──────────────────────────────────────── */
.bbf-waste-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bbf-waste-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  background: var(--bbf-grey);
  border: 1.5px solid var(--bbf-border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--ff-display);
  color: var(--bbf-navy);
  transition: border-color .2s ease, background .2s ease, color .2s ease;
  text-align: center;
  line-height: 1.2;
}

.bbf-waste-btn__icon { font-size: 18px; }

.bbf-waste-btn:hover {
  border-color: var(--bbf-blue);
  background: rgba(27,111,232,.05);
  color: var(--bbf-blue);
}

.bbf-waste-btn.selected {
  border-color: var(--bbf-blue);
  background: rgba(27,111,232,.08);
  color: var(--bbf-blue);
}

.bbf-inline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.bbf-input {
  width: 100%;
  appearance: none;
  background: var(--bbf-grey);
  border: 1.5px solid var(--bbf-border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--ff-body);
  color: var(--bbf-navy);
  transition: border-color .2s ease;
  outline: none;
  box-sizing: border-box;
}

.bbf-input:focus {
  border-color: var(--bbf-blue);
  box-shadow: 0 0 0 3px rgba(27,111,232,.12);
}

.bbf-lookup-btn {
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--ff-display);
  background: linear-gradient(135deg, var(--bbf-blue) 0%, #0d3b8e 100%);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.bbf-message {
  margin: 4px 0 0;
  font-size: 12px;
  min-height: 16px;
}

.bbf-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bbf-size-card {
  border: 1.5px solid var(--bbf-border);
  border-radius: 10px;
  background: var(--bbf-grey);
  padding: 8px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bbf-size-card.selected {
  border-color: var(--bbf-blue);
  box-shadow: 0 0 0 3px rgba(27,111,232,.12);
}

.bbf-size-card__media {
  width: 100%;
  height: 58px;
  background: #e9edf4;
  border-radius: 8px;
  overflow: hidden;
  display: block;
}

.bbf-size-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bbf-size-card__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--bbf-navy);
}

/* ── Select / dropdown ──────────────────────────────────────────── */
.bbf-select-wrap {
  position: relative;
}

.bbf-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bbf-muted);
  pointer-events: none;
  font-size: 13px;
}

.bbf-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bbf-grey);
  border: 1.5px solid var(--bbf-border);
  border-radius: 10px;
  padding: 11px 36px 11px 14px;
  font-size: 14px;
  font-family: var(--ff-body);
  color: var(--bbf-navy);
  cursor: pointer;
  transition: border-color .2s ease;
  outline: none;
}

.bbf-select:focus {
  border-color: var(--bbf-blue);
  box-shadow: 0 0 0 3px rgba(27,111,232,.12);
}

/* ── Date input ─────────────────────────────────────────────────── */
.bbf-date {
  width: 100%;
  appearance: none;
  background: var(--bbf-grey);
  border: 1.5px solid var(--bbf-border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--ff-body);
  color: var(--bbf-navy);
  transition: border-color .2s ease;
  outline: none;
  box-sizing: border-box;
}

.bbf-date:focus {
  border-color: var(--bbf-blue);
  box-shadow: 0 0 0 3px rgba(27,111,232,.12);
}

/* ── Price preview ──────────────────────────────────────────────── */
.bbf-price-preview {
  display: none;
  background: var(--bbf-navy);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bbf-price-preview[hidden] { display: none !important; }

.bbf-price-label {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  font-family: var(--ff-display);
}

.bbf-price-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--bbf-sky);
  font-family: 'DM Mono', monospace;
  letter-spacing: -.02em;
}

/* ── Submit button ──────────────────────────────────────────────── */
.bbf-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--bbf-blue) 0%, #0d3b8e 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--ff-display);
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
  letter-spacing: .01em;
}

.bbf-submit:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
}

.bbf-submit:disabled {
  background: #c8d1e0;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* ── Hidden groups (shown progressively) ───────────────────────── */
.bbf-group--hidden { display: none; }

/* ── Mobile adjustments ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .bbf-widget {
    bottom: 16px;
    right: 16px;
    left: 16px;
    align-items: flex-end;
  }

  .bbf-panel {
    width: 100%;
    right: 0;
    left: 0;
    bottom: calc(100% + 10px);
    border-radius: 14px;
    position: fixed;
    /* Override absolute to fixed for mobile */
    bottom: 76px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}
