/* Brands on O4QR (templates/public/brands/*): the directory, brand and company
   pages, the application form. Sits on public.css (the marketing site's look).
   Every page has the same layout (BRANDS-DIRECTORY-PLAN.md D5); the only thing a
   brand changes is --bd-accent, set on .bd-page from its approved accent colour,
   which utils/brand_directory.accent_ok checked for white text. */

.bd-page { --bd-accent: #5a67d8; }
.bd-banner { background: #fff7e0; border-bottom: 1px solid #f0d58c; color: #6b4e00; padding: 10px 0;
    font-size: 15px; text-align: center; }

/* Directory */
.bd-search { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; margin: 0 0 28px; }
.bd-search input, .bd-search select { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); background: #fff; min-width: 0; }
.bd-search button, .bd-btn { font: inherit; font-size: 16px; font-weight: 700; padding: 11px 22px; border: 0;
    border-radius: var(--radius); background: var(--bd-accent); color: #fff; cursor: pointer; text-decoration: none;
    display: inline-block; }
.bd-search button { background: var(--ink); }
.bd-btn:hover { filter: brightness(1.08); }
.bd-btn.is-alt { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.bd-count { color: var(--ink2); font-size: 15px; margin: 0 0 14px; }

.bd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.bd-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-card); overflow: hidden; text-decoration: none; color: inherit;
    transition: box-shadow .15s, transform .15s; }
.bd-card:hover { box-shadow: 0 6px 22px rgba(2, 49, 81, .1); transform: translateY(-2px); }
.bd-card-top { height: 6px; background: var(--bd-accent); }
.bd-card-body { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.bd-card h3 { font-family: var(--f-head); font-size: 20px; font-weight: 400; margin: 0 0 2px; color: var(--ink); }
.bd-by { font-size: 14px; color: var(--ink2); margin: 0 0 8px; }
.bd-card p { font-size: 15px; color: var(--ink2); margin: 0 0 8px; }
.bd-logo { flex: none; width: 64px; height: 64px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bd-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bd-logo.is-big { width: 112px; height: 112px; border-radius: 12px; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.bd-chips li { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--ink); }
.bd-chips.is-regions li { background: #eef6ee; color: #1f5d2c; }
.bd-empty { padding: 40px; text-align: center; color: var(--ink2); background: #fff; border: 1px dashed var(--border);
    border-radius: var(--radius-card); }

/* Brand and company pages */
.bd-hero { position: relative; background: var(--ink); color: #fff; }
.bd-cover { height: 260px; background: var(--ink) center / cover no-repeat; }
.bd-cover.is-none { height: 120px; background: var(--bd-accent); }
.bd-head { display: flex; gap: 22px; align-items: flex-end; margin-top: -56px; padding-bottom: 26px; position: relative; }
.bd-head .bd-logo { box-shadow: 0 4px 18px rgba(0, 0, 0, .18); }
.bd-head h1 { font-family: var(--f-head); font-weight: 300; font-size: 40px; line-height: 1.1; margin: 0 0 4px; color: #fff; }
.bd-head .bd-tag { font-size: 18px; color: var(--on-navy-2); margin: 0; }
.bd-head .bd-by a { color: #fff; }
.bd-head .bd-by { color: var(--on-navy-2); margin: 6px 0 0; }
.bd-strip { background: var(--bd-accent); height: 6px; }

.bd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; padding: 40px 0 64px; }
.bd-main h2, .bd-side h2 { font-family: var(--f-head); font-weight: 400; font-size: 26px; color: var(--ink); margin: 0 0 12px; }
.bd-main section { margin: 0 0 40px; }
.bd-about { font-size: 17px; line-height: 1.6; color: var(--ink2); white-space: pre-line; }

.bd-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bd-product { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.bd-product summary { list-style: none; cursor: pointer; }
.bd-product summary::-webkit-details-marker { display: none; }
.bd-product .bd-pic { aspect-ratio: 1 / 1; background: var(--surface); display: flex; align-items: center;
    justify-content: center; overflow: hidden; }
.bd-product .bd-pic img { width: 100%; height: 100%; object-fit: contain; }
.bd-product .bd-name { padding: 10px 12px; font-weight: 700; color: var(--ink); font-size: 15px; }
.bd-product .bd-more { padding: 0 12px 12px; font-size: 14px; color: var(--ink2); }
/* Open: the whole row, the picture on the left and the name with its details
   beside it (the summary's two children and .bd-more are the grid's items). */
.bd-product[open] { grid-column: 1 / -1; display: grid; grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr; align-items: start; }
.bd-product[open] summary { display: contents; }
.bd-product[open] .bd-pic { grid-column: 1; grid-row: 1 / span 2; }
.bd-product[open] .bd-name { grid-column: 2; grid-row: 1; padding: 16px 16px 4px; font-size: 17px; }
.bd-product[open] .bd-more { grid-column: 2; grid-row: 2; padding: 0 16px 16px; }

.bd-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px; margin: 0 0 18px; }
.bd-panel.is-cta { border-top: 4px solid var(--bd-accent); }
.bd-panel p { font-size: 15px; color: var(--ink2); margin: 0 0 10px; }
.bd-panel .bd-btn { width: 100%; text-align: center; box-sizing: border-box; }
.bd-terms { margin: 8px 0 14px; padding-left: 18px; font-size: 15px; color: var(--ink2); }
.bd-facts { margin: 0; font-size: 15px; }
.bd-facts dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.bd-facts dd { margin: 0; color: var(--ink2); word-break: break-word; }
.bd-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.bd-badge { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #eef4fb; color: var(--ink); }
.bd-others { list-style: none; padding: 0; margin: 6px 0 0; }
.bd-others li { margin: 4px 0; }

/* The application form */
.bd-form { max-width: 720px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card);
    padding: 26px; margin: 0 0 64px; }
.bd-form .bd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bd-field { margin: 0 0 14px; }
.bd-field label { display: block; font-weight: 700; font-size: 14.5px; color: var(--ink); margin: 0 0 5px; }
.bd-field input, .bd-field select, .bd-field textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.bd-field .bd-hint { font-size: 13.5px; color: var(--ink2); margin-top: 4px; }
.bd-phone { display: grid; grid-template-columns: minmax(0, 11em) 1fr; gap: 8px; }
.bd-check { display: flex; gap: 8px; align-items: center; margin: 4px 0; font-weight: 400 !important; }
.bd-check input { width: auto; }
.bd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bd-error { background: #fdecea; color: #8a1f11; padding: 10px 14px; border-radius: var(--radius); margin: 0 0 14px; }
.bd-ok { background: #e9f7ef; color: #1e6b3a; padding: 18px; border-radius: var(--radius-card); margin: 0 0 64px; }

@media (max-width: 860px) {
    .bd-layout { grid-template-columns: 1fr; }
    .bd-search { grid-template-columns: 1fr 1fr; }
    .bd-search input { grid-column: 1 / -1; }
    .bd-head { flex-direction: column; align-items: flex-start; }
    .bd-head h1 { font-size: 30px; }
    .bd-cover { height: 160px; }
    .bd-product[open] { grid-template-columns: 1fr; grid-template-rows: auto; }
    .bd-product[open] .bd-pic, .bd-product[open] .bd-name, .bd-product[open] .bd-more { grid-column: 1; grid-row: auto; }
    .bd-form .bd-row { grid-template-columns: 1fr; }
}
