/*
 * Buffetfinder plugin — frontend styles.
 * Scoped with .bf- prefix to avoid theme conflicts.
 */

:root {
    --bf-orange: #FF6B1A;
    --bf-cream:  #faf7f2;
    --bf-ink:    #1a1a1a;
    --bf-muted:  #6b6b6b;
    --bf-border: #e8e3d8;
    --bf-radius: 12px;
}

.bf-listing, .bf-detail, .bf-dashboard, .bf-wizard,
.bf-auth, .bf-favorites, .bf-categories {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 16px;
    color: var(--bf-ink);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.bf-listing__head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 4px; }
.bf-listing__head p  { color: var(--bf-muted); margin: 0 0 24px; }

/* Filters */
.bf-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
    gap: 10px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius);
    margin-bottom: 20px;
}
.bf-filters input, .bf-filters select {
    padding: 10px 12px;
    border: 1px solid var(--bf-border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
@media (max-width: 720px) {
    .bf-filters { grid-template-columns: 1fr 1fr; }
    .bf-filters button { grid-column: span 1; }
}

/* Grid / cards */
.bf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.bf-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.bf-card {
    display: block;
    background: #fff;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.bf-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.bf-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.bf-card h3  { margin: 12px 14px 4px; font-size: 1.05rem; }
.bf-card p   { margin: 0 14px 14px; color: var(--bf-muted); font-size: .9rem; }

.bf-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius);
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}
.bf-tile:hover { background: var(--bf-cream); }
.bf-tile__name  { font-weight: 700; font-size: 1.1rem; }
.bf-tile__count { color: var(--bf-muted); font-size: .85rem; }

.bf-empty, .bf-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--bf-muted);
    background: var(--bf-cream);
    border-radius: var(--bf-radius);
}

/* Pagination */
.bf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
}

/* Detail */
.bf-detail__head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-bottom: 28px; }
@media (max-width: 720px) { .bf-detail__head { grid-template-columns: 1fr; } }
.bf-detail__image { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--bf-radius); }
.bf-detail__sub   { color: var(--bf-muted); margin: 8px 0 16px; }
.bf-tag { display: inline-block; padding: 4px 10px; background: var(--bf-cream); border-radius: 999px; font-size: .8rem; margin-right: 6px; text-decoration: none; color: inherit; }
.bf-detail__info dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; }
.bf-detail__info dt { font-weight: 600; }

/* Reservation form */
.bf-reservation-form, .bf-auth__form, .bf-wizard__form {
    display: grid;
    gap: 14px;
    max-width: 520px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius);
}
.bf-reservation-form label, .bf-auth__form label, .bf-wizard__form label {
    display: grid;
    gap: 4px;
    font-size: .9rem;
    font-weight: 600;
}
.bf-reservation-form input, .bf-reservation-form textarea, .bf-reservation-form select,
.bf-auth__form input, .bf-wizard__form input, .bf-wizard__form textarea {
    padding: 10px 12px;
    border: 1px solid var(--bf-border);
    border-radius: 8px;
    font: inherit;
}
.bf-reservation-form__when { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bf-policy { color: var(--bf-muted); }
.bf-form__msg { min-height: 1.2em; margin: 0; }
.bf-form__msg.is-error   { color: #c23; }
.bf-form__msg.is-success { color: #0a7e3a; }
.bf-reservation__success {
    max-width: 520px;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid #bde5c8;
    border-left: 4px solid #0a7e3a;
    border-radius: var(--bf-radius);
}
.bf-reservation__success h3 { margin: 0 0 8px; color: #0a7e3a; }
.bf-reservation__success p  { margin: 0 0 8px; }
.bf-reservation__when { font-size: 1.05rem; }

/* Dashboard */
.bf-dashboard__head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.bf-dashboard__sub  { color: var(--bf-muted); }
.bf-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.bf-kpi { padding: 16px; background: #fff; border: 1px solid var(--bf-border); border-radius: var(--bf-radius); }
.bf-kpi h3 { margin: 0 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bf-muted); }
.bf-kpi p  { margin: 0; font-size: 1.8rem; font-weight: 700; }
.bf-dashboard__section { margin-bottom: 32px; }
.bf-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bf-section-actions { display: flex; gap: 8px; }
.bf-res-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--bf-border); border-radius: var(--bf-radius); overflow: hidden; }
.bf-res-table th, .bf-res-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--bf-border); font-size: .95rem; }
.bf-res-table tr:last-child td { border-bottom: none; }
.bf-res-table select { padding: 4px 6px; font: inherit; }

.bf-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 12px; background: #fff; border: 1px solid var(--bf-border); border-radius: var(--bf-radius); }
.bf-chart__bar { flex: 1; min-width: 0; background: var(--bf-orange); border-radius: 4px 4px 0 0; position: relative; }

/* Wizard */
.bf-wizard__steps { display: flex; gap: 8px; padding: 0; margin: 0 0 20px; list-style: none; counter-reset: step; }
.bf-wizard__step { flex: 1; padding: 10px 14px; background: #fff; border: 1px solid var(--bf-border); border-radius: 8px; font-size: .85rem; color: var(--bf-muted); counter-increment: step; }
.bf-wizard__step::before { content: counter(step) '. '; font-weight: 700; color: var(--bf-orange); }
.bf-wizard__step--active { color: var(--bf-ink); border-color: var(--bf-orange); }
.bf-wizard__nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* Auth */
.bf-auth { max-width: 460px; }
.bf-auth__tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.bf-auth__tabs button { flex: 1; padding: 10px; border: 1px solid var(--bf-border); background: #fff; border-radius: 8px; font: inherit; cursor: pointer; }
.bf-auth__tabs button.is-active { background: var(--bf-orange); color: #fff; border-color: var(--bf-orange); }

/* Review */
.bf-review-wrap { margin-top: 40px; }
.bf-rating { display: inline-flex; flex-direction: row-reverse; gap: 2px; border: 0; padding: 0; }
.bf-rating input { position: absolute; opacity: 0; pointer-events: none; }
.bf-rating label { font-size: 2rem; color: #d8d4c8; cursor: pointer; transition: color .1s; }
.bf-rating input:checked ~ label,
.bf-rating label:hover,
.bf-rating label:hover ~ label { color: var(--bf-orange); }

.bf-review { margin-top: var(--space-5); padding: var(--space-5); background: var(--color-surface-2, #faf7f2); border-radius: 12px; border: 1px solid var(--color-border, #eae3d6); }
.bf-review--prompt { padding: var(--space-4) var(--space-5); }
.bf-review .field { margin-top: var(--space-3); }
.bf-review textarea { width: 100%; min-height: 110px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--color-border, #eae3d6); font: inherit; resize: vertical; background: #fff; }
.bf-review input[type="text"] { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--color-border, #eae3d6); font: inherit; background: #fff; }
.bf-review__msg { margin-top: var(--space-3); font-size: var(--fs-small, 0.875rem); min-height: 1.2em; }
.bf-review__msg.is-success { color: #197a3a; }
.bf-review__msg.is-error { color: #b33a1c; }

.bf-reviews__notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin: 0 0 var(--space-4);
  background: rgba(25, 122, 58, 0.06);
  border: 1px solid rgba(25, 122, 58, 0.2);
  border-radius: 10px;
  color: #14532d;
  font-size: 0.88rem;
  line-height: 1.5;
}
.bf-reviews__notice svg { flex-shrink: 0; margin-top: 2px; color: #197a3a; }
.bf-reviews__notice strong { color: #197a3a; margin-right: 0.3em; }
.bf-reviews { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; gap: var(--space-4); }
.bf-reviews__item { padding: var(--space-4) var(--space-5); background: #fff; border: 1px solid var(--color-border, #eae3d6); border-radius: 12px; }
.bf-reviews__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: 6px; }
.bf-reviews__stars { color: var(--bf-orange, #ff7a3d); letter-spacing: 2px; font-size: 1rem; }
.bf-reviews__verified { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 2px 8px; background: rgba(25,122,58,0.12); color: #197a3a; border-radius: 999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.bf-reviews__title { font-weight: 600; margin: 4px 0; }
.bf-reviews__body { margin: 6px 0 0; line-height: 1.55; white-space: pre-wrap; }
.bf-reviews__reply { margin-top: var(--space-3); padding: 10px 14px; background: var(--color-surface-2, #faf7f2); border-left: 3px solid var(--bf-orange, #ff7a3d); border-radius: 0 8px 8px 0; font-size: 0.92rem; }
.bf-reviews__reply p { margin: 4px 0 0; }

/* Callout */
.bf-callout { padding: 16px 20px; background: var(--bf-cream); border-left: 4px solid var(--bf-orange); border-radius: 8px; }

/* Dashboard reservation action cell — compact single-select */
.res-action__select {
    width: 100%;
    min-width: 140px;
    max-width: 180px;
    cursor: pointer;
}

/* Dashboard split: give the reservations table more horizontal room */
@media (min-width: 960px) {
    .split--dash { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) !important; }
}

/* Reservation table: tighter last cell so the select isn't cramped */
.bf-dashboard .table td:last-child,
.bf-dashboard .table th:last-child {
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
}
