/* Storefront styling.

   Every colour below comes from a custom property, and base.html emits a
   second :root block per request carrying the customer's own palette (see
   app/theming.py). The values here are the Sierra defaults that a site
   without a theme falls back to -- they are not the Sierra dashboard's
   styling, which lives in staff.css.

   Semantic colours (flash messages, the approval badge, required-field
   asterisks) are deliberately NOT themed. Red must mean error on every
   storefront, including the one whose brand colour is red. */
:root {
  --body-bg: #F6F8FB;
  --content-bg: #FFFFFF;
  --text: #1B2733;
  --text-muted: #5B6B7C;
  --link: #03326A;
  --link-hover: #00294F;
  --primary: #03326A;
  --on-primary: #FFFFFF;
  --btn-bg: #03326A;
  --btn-text: #FFFFFF;
  --btn-border: #03326A;
  --btn-hover-bg: #00294F;
  --btn-hover-text: #FFFFFF;
  --btn-hover-border: #00294F;
  --header-bg: #FFFFFF;
  --header-text: #1B2733;
  --header-rule: #6B9338;
  --nav-bg: #FFFFFF;
  --nav-link: #03326A;
  --nav-link-hover: #00294F;
  --nav-border: #E7E7E7;
  --nav-active: #FFFFFF;
  --footer-bg: #000000;
  --footer-text: #AAAAAA;
  --price: #1B2733;
  --border: #D9E1EA;
  --panel-head-bg: #03326A;
  --panel-head-text: #FFFFFF;
  --panel-bg: #FFFFFF;
  --panel-text: #333333;
  --card-bg: #FFFFFF;
  --card-border: #D9E1EA;
  --card-text: #1B2733;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--body-bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* The header carries the CUSTOMER's logo, and most of those are dark artwork
   that would vanish on a dark bar -- so it defaults to white and the accent
   rule underneath does the branding. Sites that set their own header colour
   get it; theming.py guarantees the logo-adjacent text stays legible on it. */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.25rem; background: var(--header-bg); color: var(--header-text);
  border-bottom: 3px solid var(--header-rule);
}
.topbar img { max-height: 46px; max-width: 260px; width: auto; display: block; }
.brand-name { font-weight: 600; letter-spacing: .01em; color: var(--primary); font-size: 1.1rem; }
.topnav { display: flex; align-items: center; gap: 1rem; }
.who { color: var(--text-muted); font-size: .9rem; }
.linklike {
  background: none; border: 0; color: var(--link); text-decoration: underline;
  cursor: pointer; font: inherit; padding: 0;
}
.topbar .linklike { color: var(--nav-link); font-weight: 600; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.back { display: inline-block; margin-bottom: .75rem; color: var(--link); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }

.card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 1.25rem; margin: 1rem 0; color: var(--card-text);
}
.card-narrow { max-width: 420px; margin: 3rem auto; }

label { display: block; margin: .875rem 0 .25rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--border);
  border-radius: 6px; font: inherit; background: var(--content-bg); color: var(--text);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.req { color: #b3261e; }

.btn-primary {
  margin-top: 1.25rem; width: 100%; padding: .6rem 1rem;
  border: 1px solid var(--btn-border);
  border-radius: 6px; background: var(--btn-bg); color: var(--btn-text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn-primary:hover {
  background: var(--btn-hover-bg); color: var(--btn-hover-text);
  border-color: var(--btn-hover-border);
}

/* Not themed on purpose -- see the note at the top of this file. */
.flash { padding: .65rem .85rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-error { background: #fdecea; border: 1px solid #f5c6c2; color: #8c1d18; }
.flash-message, .flash-info { background: #eef4fb; border: 1px solid #cfe0f2; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1rem; }
.chips li {
  background: var(--content-bg); border: 1px solid var(--border); border-radius: 999px;
  padding: .25rem .75rem; font-size: .875rem;
}

.grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.tile {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 10px; overflow: hidden;
}
.tile a { display: block; padding: .85rem; color: var(--card-text); text-decoration: none; }
.tile img { width: 100%; height: 120px; object-fit: contain; display: block; margin-bottom: .5rem; }
.tile-name { font-weight: 600; font-size: .925rem; }
.tile:hover { border-color: var(--primary); }

.fields { display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.prices { width: 100%; border-collapse: collapse; }
.prices th, .prices td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
.prices th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.price, .prices td.price { color: var(--price); font-weight: 600; }

.split { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.split .card { margin: 1rem 0 0; }
.hint { margin: .25rem 0 0; font-size: .8rem; color: var(--text-muted); }
.proof {
  min-height: 180px; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#f2f5f8 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--border); border-radius: 8px; padding: 1rem;
}
.proof img { max-width: 100%; height: auto; box-shadow: 0 1px 6px rgba(0,0,0,.18); background:#fff; }

.cart-table td { vertical-align: top; }
.actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.25rem; }
.btn-primary.inline { width: auto; display: inline-block; margin: 0; text-decoration: none; }
.linklike.danger { color: #b3261e; }
.summary { list-style: none; padding: 0; margin: 0; }
.summary li { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.total { margin-top: .75rem; font-size: 1.05rem; }
select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--border);
  border-radius: 6px; font: inherit; background: var(--content-bg); color: var(--text);
}
.status { font-size: .8rem; padding: .15rem .5rem; border-radius: 999px; background: #eef4fb; }
.status-pending_approval { background: #fff4e5; }
.status-submitted { background: #e8f5e9; }
.status-denied { background: #fdecea; }
.topnav a { color: var(--nav-link); text-decoration: none; font-size: .9rem; font-weight: 600; }
.topnav a:hover { color: var(--nav-link-hover); text-decoration: underline; }

/* Approvals. The count badge stays amber everywhere: it means "waiting on
   you", and that shouldn't change meaning per storefront. */
.badge {
  display: inline-block; min-width: 1.15rem; padding: 0 .35rem; margin-left: .2rem;
  border-radius: 999px; background: #f0a202; color: #1a1a1a;
  font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.3rem;
}
.approval-item { padding: 1rem 0; border-top: 1px solid var(--border); }
.approval-item:first-of-type { border-top: 0; }
.approval-item h2 { font-size: 1.05rem; margin: 0 0 .2rem; }
.approval-item th { text-align: left; font-weight: 600; width: 12rem; color: var(--text-muted); }

/* Customer-authored notices (Pressero "Instructions"). Deliberately quiet --
   these carry real information (Sunbelt's catalogue link, Oakmont's shipping
   warning) but must not compete with the page's own heading. The tint is
   neutral grey rather than a tint of the brand colour, because it has to sit
   under a red, green, gold, blue or orange accent without clashing. */
.site-note {
  margin: 0 0 1.1rem; padding: .8rem 1rem;
  background: #f4f5f7; border-left: 4px solid var(--primary);
  border-radius: 0 6px 6px 0; font-size: .93rem; line-height: 1.55; color: var(--text);
}
.site-note p { margin: 0 0 .5rem; }
.site-note p:last-child { margin-bottom: 0; }
.site-note a { color: var(--link); font-weight: 600; }
