/* 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;
  --card-image-bg: #FFFFFF;
}

* { 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; }

/* Product photos. Merchandise is bought by eye, so these get the column the
   proof occupies on personalised products. */
.gallery-main {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; min-height: 200px;
}
.gallery-main img { max-width: 100%; max-height: 420px; height: auto; display: block; }
.gallery-strip {
  list-style: none; display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 0; margin: .75rem 0 0;
}
.gallery-pick {
  padding: 0; border: 2px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer; line-height: 0; overflow: hidden;
}
.gallery-pick img { width: 62px; height: 62px; object-fit: contain; display: block; }
.gallery-pick.is-active { border-color: var(--primary); }
.gallery-pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Per-item approval. An approver can release some lines and decline others,
   so each one gets its own choice rather than a single verdict on the lot. */
.decide-table th:not(:first-child), .decide-table td:not(:first-child) {
  text-align: center; width: 5.5rem;
}
.decide-table input[type=radio] { width: auto; margin: 0; }

/* Impersonation banner. Amber and full width on purpose: this is a Sierra
   employee operating a live storefront as somebody else, and it should be
   impossible to miss or to forget. */
.imp-banner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .6rem;
  background: #f0a202; color: #1a1a1a;
  padding: .5rem 1rem; font-size: .875rem; font-weight: 600;
}
.imp-banner form { margin: 0; }
.imp-banner button {
  border: 1px solid #1a1a1a; background: #1a1a1a; color: #fff;
  border-radius: 5px; padding: .25rem .8rem; font: inherit; cursor: pointer;
}
/* Ordering mode: red rather than amber, because this one can spend the
   customer's money. Two colours the same would put the whole weight of the
   distinction on the wording. */
.imp-banner.ordering { background: #c62828; color: #fff; }
.imp-banner.ordering button { border-color: #fff; background: #fff; color: #1a1a1a; }

/* "Ordered before" -- previous personalisations of this product, offered on
   the product page rather than only in order history. */
.again {
  border: 1px solid var(--nav-border); border-radius: 8px;
  padding: .7rem .9rem; margin-bottom: 1rem; background: var(--body-bg);
}
.again-head {
  margin: 0 0 .4rem; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
}
.again-list { list-style: none; margin: 0; padding: 0; }
.again-list li {
  display: flex; justify-content: space-between; gap: .8rem;
  padding: .22rem 0; font-size: .9rem;
}
.again-list a { color: var(--link); text-decoration: none; }
.again-list a:hover { text-decoration: underline; }
.again-list a.is-loaded { font-weight: 700; }
.again-when { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }

/* Category chips are links now, not labels. They read as plain text before,
   which is why nobody could tell the Oakmont catalogue's categories did
   nothing -- there was no route behind them at all. */
.chips a {
  display: inline-block; padding: .35rem .8rem;
  border: 1px solid var(--border, #ddd); border-radius: 999px;
  color: var(--link, #06c); text-decoration: none; font-size: .9rem;
}
.chips a:hover { border-color: var(--primary, #06c); background: var(--card_bg, #fff); }
.crumbs { font-size: .85rem; color: var(--text_muted, #777); margin: 0 0 .35rem; }
.crumbs a { color: var(--link, #06c); }

/* Storefront banner. Pressero's are 1140x471 and every site's is a different
   shape, so the height is capped rather than fixed and the image is allowed to
   letterbox -- a banner cropped to fit is a banner with the customer's message
   cut off. */
.site-banner { margin: 0 0 1.1rem; }
.site-banner img {
  display: block; width: 100%; max-height: 320px;
  object-fit: contain; border-radius: 8px;
}
.banner-caption {
  margin: .4rem 0 0; font-size: .875rem; color: var(--muted, #555);
}

/* Products menu. A <details> rather than script -- see base.html for why.
   The panel is absolutely positioned so opening it does not shove the rest of
   the header sideways, which is what an inline <details> does by default. */
.topnav .menu { position: relative; }
.topnav .menu > summary {
  list-style: none; cursor: pointer; font-size: .9rem; font-weight: 600;
  color: var(--nav-link); user-select: none;
}
.topnav .menu > summary::-webkit-details-marker { display: none; }
.topnav .menu > summary::after { content: " \25BE"; font-size: .8em; }
.topnav .menu[open] > summary { color: var(--nav-link-hover); }
.topnav .menu > ul {
  position: absolute; right: 0; top: 1.9rem; z-index: 40;
  min-width: 13rem; max-height: 70vh; overflow-y: auto;
  margin: 0; padding: .35rem 0; list-style: none;
  background: var(--content-bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.14);
}
.topnav .menu > ul a {
  display: block; padding: .4rem .9rem; font-weight: 500; white-space: nowrap;
}
.topnav .menu > ul a:hover { background: var(--body-bg); }

/* Footer quick links. Muted on purpose: this is the place a customer looks
   when the header did not have what they wanted, not somewhere to compete
   with the catalogue. */
.site-footer {
  margin-top: 3rem; padding: 1.25rem; background: var(--footer-bg);
  color: var(--footer-text);
}
.quick-links {
  max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap;
  gap: .35rem 1.25rem; font-size: .875rem;
}
.quick-links a { color: var(--footer-text); text-decoration: none; }
.quick-links a:hover { color: #fff; text-decoration: underline; }
.footer-note {
  max-width: 1040px; margin: .75rem auto 0; font-size: .8rem; opacity: .75;
}

/* Deliver-to picker at checkout. The "somewhere else" fields are always
   visible rather than revealed by script: the CSP forbids the inline
   JavaScript that would toggle them, and a customer who cannot see the fields
   cannot tell the option exists. */
.ship-to { border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0 0; }
.ship-to legend { font-weight: 600; font-size: .9rem; padding: 0 .35rem; }
.choice { display: flex; align-items: flex-start; gap: .5rem; margin: .35rem 0; font-weight: 400; }
.choice input { width: auto; margin-top: .25rem; }
.new-address { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--border); }

/* The catalogue, laid out as Pressero lays it out -- categories down the left,
   products in their own panel. Read off the live PLF storefront rather than
   invented. */
.catalog { display: grid; gap: 1rem; grid-template-columns: 15rem 1fr; align-items: start; }
@media (max-width: 780px) { .catalog { grid-template-columns: 1fr; } }

.cat-panel {
  background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.cat-panel .panel-head {
  margin: 0; padding: .6rem .9rem; font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; background: var(--body-bg);
  border-bottom: 1px solid var(--border); color: var(--text-muted);
}
.cat-panel ul { list-style: none; margin: 0; padding: .35rem 0; }
.cat-panel li a {
  display: block; padding: .45rem .9rem; font-size: .9rem; text-decoration: none;
}
.cat-panel li a:hover { background: var(--body-bg); }
.cat-panel li.is-current a { font-weight: 700; }

.crumb-panel, .display-panel {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 8px;
}
.crumb-panel { padding: .7rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.crumb-panel .sep { color: var(--text-muted); margin: 0 .35rem; }
.display-panel { padding: 1rem; position: relative; }

/* Two buttons, top right, like theirs. Links rather than script -- see
   home.html for why. */
.view-switch { display: flex; justify-content: flex-end; gap: .3rem; margin-bottom: .8rem; }
.view-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 5px;
  text-decoration: none; color: var(--text-muted); background: var(--content-bg);
  font-size: 1rem; line-height: 1;
}
.view-switch a.is-on {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}

/* List view: one row per item, picture small and on the left. */
.grid.as-list { grid-template-columns: 1fr; }
.grid.as-list .tile a { display: flex; align-items: center; gap: .9rem; }
.grid.as-list .tile img { width: 84px; height: 64px; margin: 0; flex: none; }

/* Tile images sit in a fixed white box, as Pressero's do. Without it the five
   category tiles line up by whatever shape each picture happens to be -- a
   business card is wide, a t-shirt is tall -- and the row reads as ragged
   rather than as a set. */
.tile .shot {
  display: flex; align-items: center; justify-content: center;
  height: 150px; margin-bottom: .6rem; padding: .5rem;
  background: var(--card-image-bg); border: 1px solid var(--border); border-radius: 4px;
}
.tile .shot img { max-width: 100%; max-height: 100%; width: auto; height: auto;
                  margin: 0; display: block; }
.tile a { text-align: center; }
.tile-name { display: block; font-weight: 600; font-size: .925rem; }

/* List view keeps the box, just smaller and beside the name. */
.grid.as-list .tile a { text-align: left; }
.grid.as-list .tile .shot { width: 96px; height: 74px; margin: 0; flex: none; }

/* Two bands, like theirs: the customer's colour carries the logo, the search
   and the basket; the bar under it carries the navigation. Ours was one bar
   doing all of it. */
.utility {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .55rem 1.25rem; background: var(--header-bg);
  border-bottom: 1px solid var(--nav-border);
}
.utility .brand { margin-right: auto; }
/* Everything on the masthead follows the customer's own header colours, not
   the generic link colour: the band is their brand colour, and a link styled
   for a white page can vanish on it. app/theming.py guarantees the pair stays
   legible. */
.utility, .utility a, .utility .who, .utility .linklike { color: var(--header-text); }
.utility .who { font-size: .85rem; }
.utility a { font-size: .85rem; text-decoration: none; }
.utility a:hover { text-decoration: underline; }

.searchbar { display: flex; align-items: center; gap: 0; flex: 1 1 16rem; max-width: 30rem; }
.searchbar input[type=search] {
  flex: 1; padding: .45rem .6rem; font: inherit; color: var(--text);
  background: var(--content-bg); border: 1px solid var(--border);
  border-radius: 6px 0 0 6px; border-right: 0; min-width: 0;
}
.searchbar button {
  padding: .45rem .8rem; font: inherit; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
  border: 1px solid var(--primary); border-radius: 0 6px 6px 0;
}

/* The navigation band under the header. */
.mainnav {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: .55rem 1.25rem; background: var(--nav-bg);
  border-bottom: 3px solid var(--header-rule);
}
.mainnav a, .mainnav .menu > summary {
  color: var(--nav-link); text-decoration: none; font-size: .9rem; font-weight: 600;
}
.mainnav a:hover { color: var(--nav-link-hover); text-decoration: underline; }
.mainnav .menu { position: relative; }
.mainnav .menu > summary { list-style: none; cursor: pointer; user-select: none; }
.mainnav .menu > summary::-webkit-details-marker { display: none; }
.mainnav .menu > summary::after { content: " \25BE"; font-size: .8em; }
.mainnav .menu > ul {
  position: absolute; left: 0; top: 1.9rem; z-index: 40;
  min-width: 13rem; max-height: 70vh; overflow-y: auto;
  margin: 0; padding: .35rem 0; list-style: none;
  background: var(--content-bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.14);
}
.mainnav .menu > ul a { display: block; padding: .4rem .9rem; font-weight: 500; white-space: nowrap; }
.mainnav .menu > ul a:hover { background: var(--body-bg); }

/* Help articles. Narrower measure than a catalogue page: this is prose, and
   prose at full width is prose nobody finishes. */
.help-article { max-width: 46rem; }
.help-article h1 { margin-bottom: .75rem; }
.help-article h2 { margin: 1.6rem 0 .5rem; font-size: 1rem; }
.help-article p, .help-article li { line-height: 1.6; }
.help-article ul { padding-left: 1.2rem; }
.help-article li { margin-bottom: .35rem; }
.help-article code {
  background: var(--body-bg); border: 1px solid var(--border);
  border-radius: 3px; padding: 0 .25rem; font-size: .9em;
}
.help-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.help-list li { padding: .55rem 0; border-bottom: 1px solid var(--border); }

/* No sidebar: the catalogue takes the full width rather than leaving a column
   of empty space where the categories would have been. */
.catalog.full { grid-template-columns: 1fr; }

/* --- the drag overlay on the field editor's proof -------------------------
 *
 * Boxes sit on top of the rendered proof, one per printed field. Dragging one
 * writes back into that field's inch inputs, which stay the thing that is
 * saved -- the picture is an input method, not a second source of truth.
 */
.proof-stage {
  position: relative; display: inline-block; max-width: 100%;
  /* A white card on a white page has no visible edge, so the trim is invisible
     and a field near it looks fine when it is hanging off. The rule and the
     shadow are the page boundary. */
  outline: 1px solid var(--text-muted);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  /* Anything transparent in the artwork shows the board through it rather than
     reading as white. */
  background:
    repeating-conic-gradient(#e9edf2 0% 25%, #ffffff 0% 50%) 50% / 14px 14px;
}
.proof-stage img { display: block; max-width: 100%; height: auto; }
.fbox {
  position: absolute; box-sizing: border-box;
  border: 1px solid var(--primary); background: rgba(3, 50, 106, .10);
  cursor: move; touch-action: none;
}
.fbox.is-current { border-width: 2px; background: rgba(3, 50, 106, .20); }
.fbox .fbox-label {
  position: absolute; left: 0; top: -1.1rem; white-space: nowrap;
  font-size: .68rem; color: var(--primary); background: var(--content-bg);
  padding: 0 .2rem; pointer-events: none;
}
.fbox .fbox-grip {
  position: absolute; right: -4px; bottom: -4px; width: 10px; height: 10px;
  background: var(--primary); cursor: nwse-resize;
}
