* { box-sizing: border-box; }
body { font-family: Arial, Helvetica, sans-serif; margin: 0; background: #f8f9fa; color: #1a1a1a; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
header { background: #1F3B57; color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.brand { font-weight: bold; font-size: 20px; letter-spacing: 1px; }
.tagline { font-size: 12px; opacity: .8; }
nav a { color: #fff; text-decoration: none; margin-left: 18px; font-size: 14px; opacity: .9; }
nav a:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  nav a { margin-left: 0; }
}
main.wrap { padding: 28px 20px 60px; }
h1 { color: #1F3B57; font-size: 22px; margin-bottom: 4px; }
.sub { color: #6b7280; font-size: 13px; margin-bottom: 20px; }
.group-title { color: #1F3B57; font-weight: bold; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; margin: 28px 0 8px; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
th { background: #1F3B57; color: #fff; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
.price { text-align: right; font-weight: 600; white-space: nowrap; }
.onreq { color: #9ca3af; font-style: italic; font-size: 13px; }
.btn { display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid #1F3B57; background: #1F3B57; color: #fff; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn.secondary { background: #fff; color: #1F3B57; }
.btn.small { padding: 4px 10px; font-size: 12px; }
form.inline { display: inline; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], textarea, select {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit;
}
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.auth-card { max-width: 380px; margin: 40px auto; }
.error { color: #b91c1c; font-size: 13px; margin-bottom: 12px; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-Under-review-up-to-2-business-days { background: #f3f4f6; color: #4b5563; }
.status-Confirmed { background: #dbeafe; color: #1d4ed8; }
.status-In-production { background: #fef3c7; color: #92400e; }
.status-Ready-to-ship { background: #ede9fe; color: #6d28d9; }
.status-Shipped { background: #d1fae5; color: #047857; }
.meta { color: #9ca3af; font-size: 12px; }
.flow-diagram { display: flex; align-items: stretch; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.flow-step { flex: 1; min-width: 150px; background: #fafafa; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; }
.flow-step strong { color: #1F3B57; font-size: 13px; }
.flow-arrow { display: flex; align-items: center; justify-content: center; color: #C08A3E; font-size: 20px; font-weight: bold; }
@media (max-width: 700px) {
  .flow-diagram { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); padding: 2px 0; }
}
.empty { color: #9ca3af; padding: 30px 0; text-align: center; }
a.link { color: #C08A3E; }

/* ---- Catalogue: filters (left) + catalogue (right); live selection
   lives under the filters, in the same left column ---- */
.cat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .cat-layout { grid-template-columns: 1fr; } .cat-sidebar { position: static !important; max-height: none !important; } }

.cat-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
/* Table view's columns don't reflow on a narrow phone -- scroll sideways
   inside the results area instead of breaking the whole page's layout. */
#cat-results, #cart-items { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cat-filters, .selection-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; flex-shrink: 0; }
.cat-filters h3, .selection-panel h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; margin: 18px 0 8px; }
.cat-filters h3:first-child, .selection-panel h3:first-child { margin-top: 0; }
.cat-filters summary { cursor: pointer; font-weight: bold; color: #1F3B57; margin-bottom: 8px; }

.facet-list { max-height: 280px; overflow: auto; padding-right: 2px; }
.facet-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; }
.facet-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; overflow: hidden; }
.facet-row label span.lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-count { color: #9ca3af; font-size: 12px; flex-shrink: 0; }
.price-range { display: flex; gap: 8px; align-items: center; }
.price-range input { width: 100%; padding: 6px 8px; font-size: 13px; }
.filters-clear { font-size: 12px; color: #C08A3E; background: none; border: none; cursor: pointer; padding: 0; margin-top: 10px; text-decoration: underline; }
.toggle-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.cat-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cat-toolbar .search-box { flex: 1; min-width: 180px; }
.cat-count { color: #6b7280; font-size: 13px; white-space: nowrap; }
.view-toggle { display: flex; border: 1px solid #1F3B57; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.view-toggle button { border: none; background: #fff; color: #1F3B57; padding: 7px 12px; font-size: 12px; cursor: pointer; }
.view-toggle button.active { background: #1F3B57; color: #fff; }
select.sort-select { width: auto; flex-shrink: 0; }

.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.product-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 5px; }
.product-card .pc-group { font-size: 10px; color: #C08A3E; text-transform: uppercase; letter-spacing: .3px; }
.product-card .pc-name { font-weight: 600; font-size: 14px; color: #1a1a1a; line-height: 1.3; }
.product-card .pc-meta { font-size: 12px; color: #9ca3af; }
.product-card .pc-price { font-weight: 700; color: #1F3B57; margin-top: 6px; }
.product-card .pc-foot { margin-top: auto; padding-top: 10px; }

.group-block { grid-column: 1 / -1; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid #1F3B57; background: #fff; color: #1F3B57; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.stepper button:hover { background: #f0f4f8; }
.stepper .qty { min-width: 20px; text-align: center; font-weight: 600; font-size: 13px; }
.stepper .qty-input { width: 74px; padding: 3px 4px; text-align: center; font-weight: 600; font-size: 13px; border: 1px solid #d1d5db; border-radius: 4px; }
.unit-select { width: auto; display: inline-block; margin-top: 4px; padding: 3px 6px; font-size: 12px; }
.stepper.below-min .qty-input, .stepper.below-min .qty { border-color: #b91c1c; color: #b91c1c; }
.min-qty-warning { color: #b91c1c; font-size: 11px; margin-top: 4px; max-width: 220px; line-height: 1.4; }

/* ---- Clippy-style onboarding helper ---- */
#clippy-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; }
#clippy-toggle { width: 48px; height: 48px; border-radius: 50%; border: none; background: #fdf6ea; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.2); padding: 0; }
#clippy-toggle:hover { background: #f7ecd4; }
@keyframes clippy-bounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-6px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }
#clippy-wrap.clippy-bounce #clippy-toggle { animation: clippy-bounce .6s ease; }
@keyframes clippy-blink { 0%, 88%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.12); } }
.clippy-eyes { transform-origin: center; transform-box: fill-box; }
#clippy-bubble { position: absolute; right: 0; bottom: 60px; width: 260px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
#clippy-bubble.clippy-hidden { display: none; }
#clippy-icon { margin-bottom: 8px; }
#clippy-text { font-size: 13px; line-height: 1.5; color: #1a1a1a; margin-bottom: 12px; }
#clippy-actions { display: flex; justify-content: flex-end; gap: 8px; }
#clippy-ask-row { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
#clippy-ask-input { flex: 1; padding: 6px 8px; font-size: 12px; border: 1px solid #d1d5db; border-radius: 6px; }
#clippy-answer { font-size: 12px; line-height: 1.5; color: #1a1a1a; margin-top: 8px; }
#clippy-answer.clippy-answer-error { color: #b91c1c; font-style: italic; }
@media (max-width: 500px) { #clippy-bubble { width: 220px; } }

.selection-line { display: flex; justify-content: space-between; align-items: flex-start; font-size: 13px; padding: 9px 0; border-bottom: 1px solid #f0f0f0; gap: 6px; }
.selection-line .sl-name { font-weight: 600; }
.selection-line .sl-meta { color: #9ca3af; font-size: 11px; }
.selection-line .sl-remove { color: #b91c1c; background: none; border: none; cursor: pointer; font-size: 11px; padding: 0; text-decoration: underline; }
.selection-empty { color: #9ca3af; font-size: 13px; padding: 24px 0; text-align: center; }
.selection-total { display: flex; justify-content: space-between; font-weight: 700; color: #1F3B57; padding-top: 12px; margin-top: 6px; border-top: 2px solid #1F3B57; font-size: 14px; }
.selection-panel .btn { width: 100%; text-align: center; margin-top: 12px; }

/* ---- Detail panel (right-side drawer, opened from a catalogue item) ---- */
.detail-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 99; }
.detail-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-panel { position: fixed; top: 0; right: 0; height: 100vh; width: min(440px, 92vw); background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .25s ease; z-index: 100; overflow-y: auto; padding: 26px; }
.detail-panel.open { transform: translateX(0); }
.detail-close { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; padding: 4px 8px; }
.detail-panel h2 { color: #1F3B57; font-size: 19px; margin: 24px 0 6px; padding-right: 20px; }
.detail-meta { color: #6b7280; font-size: 13px; margin-bottom: 14px; }
.detail-price { font-weight: 700; color: #1F3B57; font-size: 17px; margin-bottom: 18px; }
.detail-desc { font-size: 14px; line-height: 1.65; color: #1a1a1a; }
.detail-desc.missing { color: #9ca3af; font-style: italic; }
.detail-drawing { margin: 14px 0; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; background: #fafafa; }
.detail-drawing img { width: 100%; height: auto; display: block; }

/* ---- Document quickview panel (right-side drawer, /my-offers + /admin/offers) ---- */
.doc-panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 99; }
.doc-panel-backdrop.open { opacity: 1; pointer-events: auto; }
.doc-panel { position: fixed; top: 0; right: 0; height: 100vh; width: min(760px, 96vw); background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .25s ease; z-index: 100; display: flex; flex-direction: column; }
.doc-panel.open { transform: translateX(0); }
.doc-panel-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.doc-panel iframe { flex: 1; border: none; width: 100%; }
.pc-name[data-view-detail], .view-link { cursor: pointer; }
.pc-name[data-view-detail]:hover, .view-link:hover { color: #1F3B57; text-decoration: underline; }
.view-link { color: #1F3B57; text-decoration: underline; text-decoration-style: dotted; font-size: 13px; }
