/* Product catalogue (zoho/products.php, js/catalogue.js), in the website's brand colours
   (assets/css/site-theme.css). */
:root {
  --brand: #65152b;
  --brand-dark: #4d0f20;
  --brand-tint: #f6eef0;
  --page: #eef0f2; /* platinum */
  --paper: #ffffff;
  --ink: #2d2d2d;
  --muted: #6a6a6a;
  --line: #dfe2e6;
  --danger: #b3261e;
  --staff: #1f5f8b;
  --staff-tint: #e8f1f8;
  --radius: 14px;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }
html { font-size: 15px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.45 "Roboto", system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

.cat-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 14px; }

/* ---------- Header ---------- */
.cat-head { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.cat-head-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.cat-logo { min-width: 0; }
.cat-logo img { display: block; height: 36px; width: auto; max-width: 100%; }
.cat-head-actions { display: flex; align-items: center; gap: 8px; }
.cat-icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--brand); font-size: 1.1rem; }
.cat-icon-btn:hover { background: var(--brand-tint); }
/* Login: a quiet link at the end of the page (customers don't need it) */
.cat-login-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; border: 0; background: none; padding: 0 8px; font-size: .85rem; color: var(--muted); }
.cat-login-btn:hover { color: var(--brand); text-decoration: underline; }
.cat-staff-chip { white-space: nowrap; border: 0; border-radius: 20px; padding: 6px 12px; font-size: .87rem; font-weight: 500; background: var(--staff-tint); color: var(--staff); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Category / search ---------- */
/* Stays under the header while the products scroll (header: 60px + its 1px border) */
.cat-tools { position: sticky; top: 61px; z-index: 9; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; padding: 16px 0 10px; background: var(--page); }
/* The page colour reaches over .cat-wrap's side padding, so cards don't show there */
.cat-tools::before { content: ''; position: absolute; z-index: -1; inset: 0 -14px; background: var(--page); }
.cat-select { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 34px 6px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; }
.cat-select:hover, .cat-select.open { border-color: var(--brand); }
.cat-select.open > i { transform: translateY(-50%) rotate(180deg); }
.cat-select > i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cat-select-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cat-select b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-search { display: flex; align-items: center; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 0 8px 0 14px; overflow: hidden; }
.cat-search:focus-within { border-color: var(--brand); }
.cat-search > i { color: var(--muted); }
.cat-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0 10px; height: 50px; }

/* Drop-down lists: categories (wide, under the category box), sort and vendor (under their button) */
.cat-menu-anchor { position: relative; min-width: 0; }
.cat-menu-anchor > .cat-select { width: 100%; }
.cat-menu { position: absolute; z-index: 15; display: grid; gap: 2px; padding: 8px; background: var(--paper); border-radius: 14px; box-shadow: 0 14px 36px rgba(45, 45, 45, .18); }
.cat-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left; white-space: nowrap; }
.cat-menu button:hover { background: var(--brand-tint); }
.cat-menu button.on { background: var(--brand); color: #fff; font-weight: 500; }
.cat-menu-categories { top: 74px; /* right under the category box (16px padding + 52px + 6px), over the search row on phones */ left: 0; right: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 8px; padding: 10px; }
.cat-menu-categories button { white-space: normal; }
.cat-menu-below { top: calc(100% + 6px); left: 0; min-width: 100%; }
.cat-menu-end { left: auto; right: 0; min-width: 200px; }
.cat-menu-scroll { max-height: 320px; overflow-y: auto; min-width: 260px; }

/* ---------- Staff filters ---------- */
.cat-staffbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border-radius: 12px; background: var(--staff-tint); }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid #c9dbe8; border-radius: 17px; background: var(--paper); color: var(--ink); font-size: .87rem; }
.cat-chip.on { background: var(--staff); border-color: var(--staff); color: #fff; }
.cat-chip-field input { width: 52px; border: 0; outline: none; background: none; color: inherit; }
.cat-chip-field input::placeholder { color: inherit; opacity: .6; }
.cat-vendor span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-vendor .bi-chevron-down { font-size: .75rem; }
.cat-chip-clear { border: 0; background: none; color: inherit; padding: 0; display: inline-flex; font-size: 1.1rem; }

/* ---------- Brands and sort ---------- */
.cat-filterbar { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; border-bottom: 1px solid var(--line); }
/* One row of whole names: those that don't fit go to the caret's list (fitBrands() in catalogue.js) */
.cat-brands { display: flex; column-gap: 20px; min-width: 0; overflow: hidden; }
.cat-brands > button, .cat-brands-more { flex-shrink: 0; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); white-space: nowrap; }
.cat-brands-anchor { flex-shrink: 0; }
.cat-brands > button:hover, .cat-brands-more:hover { color: var(--ink); }
.cat-brands > button.on, .cat-brands-more.on { color: var(--ink); font-weight: 500; border-bottom-color: var(--brand); }
.cat-brands-more { display: inline-flex; align-items: center; gap: 6px; }
.cat-brands-more span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.cat-brands-more i { flex-shrink: 0; font-size: .75rem; }
.cat-menu-count { margin-left: auto; font-size: .8rem; opacity: .6; }
.cat-sort { margin-left: auto; flex-shrink: 0; }
.cat-sort-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); font-weight: 500; white-space: nowrap; }
.cat-sort-btn:hover { color: var(--brand); }
.cat-sort-btn i { font-size: .75rem; color: var(--muted); }

/* ---------- Results bar ---------- */
.cat-summary { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; color: var(--muted); }
.cat-summary b { color: var(--ink); }
.cat-stock-total { margin-left: auto; color: #c4c4c4; font-size: .7rem; }
.cat-link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 500; text-decoration: underline; }
.cat-summary .cat-link { margin-left: 6px; }
.cat-alt { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 16px; padding: 5px 12px; background: var(--brand-tint); color: var(--brand); font-size: .87rem; font-weight: 500; }
.cat-alt:hover { background: #eddde2; }

/* ---------- Product grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cat-card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
.cat-card:hover { border-color: #d9c9cd; box-shadow: 0 14px 30px rgba(77, 15, 32, .1); }
/* The photo fills its square (the viewer shows it whole) */
.cat-img { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-bottom: 1px solid var(--line); /* parts white photos from the text */ background: radial-gradient(circle at 50% 40%, #fff 0%, #fff 40%, #eeeae5 100%); /* a soft studio light behind transparent photos */ cursor: zoom-in; overflow: hidden; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-badge { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cat-video { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(45, 45, 45, .8); color: #fff; text-decoration: none; }
.cat-video:hover { background: #d81f1f; }
.cat-body { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 16px; flex: 1; }
.cat-brand { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.cat-title { margin: 0; font-size: .95rem; font-weight: 400; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; /* two lines, so prices line up */ }
.cat-sku { font-size: .73rem; color: var(--muted); }
.cat-price { margin-top: auto; padding-top: 6px; font-size: 1.25rem; font-weight: 700; color: var(--brand); letter-spacing: -.01em; }
.cat-card .cat-price { color: var(--ink); }
.cat-add { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: 10px; border: 1px solid var(--brand); border-radius: 22px; background: none; color: var(--brand); font-size: .93rem; font-weight: 500; }
.cat-add:hover { background: var(--brand); color: #fff; }
/* Quantity stepper: on a card once added, and in the cart */
.cat-qty { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 10px; border-radius: 22px; background: var(--brand); color: #fff; font-size: .93rem; font-weight: 500; }
.cat-qty button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.cat-qty button:hover { background: rgba(255, 255, 255, .14); }
.cat-qty-small { margin: 0; min-height: 36px; background: var(--brand-tint); color: var(--brand); }
.cat-qty-small button { width: 36px; height: 36px; }
.cat-qty-small button:hover { background: #eddde2; }
.cat-qty-small span { min-width: 18px; text-align: center; }

/* ---------- Cart ---------- */
.cat-cart-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid var(--brand); border-radius: 19px; background: var(--paper); color: var(--brand); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.cat-cart-btn:hover { background: var(--brand-tint); }
.cat-cart-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.cat-drawer-bg { justify-content: flex-end; align-items: stretch; padding: 0; }
.cat-drawer { width: 100%; max-width: 420px; display: flex; flex-direction: column; background: var(--paper); }
.cat-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.cat-drawer-head h2 { margin: 0; font-size: 1.15rem; font-weight: 500; }
.cat-cart-empty { margin: auto; padding: 24px; text-align: center; color: var(--muted); }
.cat-cart-empty i { font-size: 2rem; color: var(--brand); }
.cat-cart-list { flex: 1; overflow-y: auto; margin: 0; padding: 0 20px; list-style: none; }
.cat-cart-list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cat-cart-list img { width: 60px; height: 60px; flex-shrink: 0; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.cat-cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-cart-title { font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-cart-price { font-weight: 700; }
.cat-drawer-foot { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.cat-drawer-foot p { margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.cat-drawer-foot .cat-link { align-self: center; }
.cat-cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.cat-cart-total b { font-size: 1.3rem; }
.cat-send { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 24px; font-size: 1rem; }

/* Loading placeholders */
.cat-skeleton .cat-img, .cat-skeleton .cat-body span { background: linear-gradient(90deg, #f1eeec 25%, #faf8f7 50%, #f1eeec 75%) 0 0 / 200% 100%; animation: cat-shimmer 1.2s linear infinite; }
.cat-skeleton .cat-body span { height: 12px; border-radius: 6px; margin-top: 6px; }
.cat-skeleton .cat-body span:nth-child(2) { width: 80%; }
.cat-skeleton .cat-body span:nth-child(3) { width: 40%; height: 18px; }
@keyframes cat-shimmer { to { background-position: -200% 0; } }

/* Empty and error */
.cat-note { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; text-align: center; color: var(--muted); }
.cat-note i { font-size: 2rem; color: var(--brand); }
.cat-note p { margin: 0; }
.cat-btn { border: 0; border-radius: 20px; padding: 8px 18px; background: var(--brand); color: #fff; font-weight: 500; }
.cat-btn:hover:not(:disabled) { background: var(--brand-dark); }
.cat-btn:disabled { opacity: .6; }

/* Showroom card, after the products */
/* Full width: details on the left, directions on the right (stacked on phones) */
.cat-visit { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: center; margin-top: 28px; padding: 18px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.cat-visit h2 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.cat-visit p { margin: 0; color: var(--muted); font-size: .93rem; }
.cat-visit a { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--brand); font-weight: 500; text-decoration: none; }
.cat-visit a:hover { text-decoration: underline; }

/* End of the page: login / logout, version */
.cat-wrap.cat-foot { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 32px; padding: 16px 14px 32px; border-top: 1px solid var(--line); } /* over .cat-wrap's padding, phones too */
.cat-version { font-size: .75rem; color: var(--muted); }


/* ---------- Dialogs ---------- */
.cat-modal-bg { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(24, 17, 19, .5); }
.cat-dialog h2 { margin: 0; font-size: 1.15rem; font-weight: 500; }
.cat-dialog { width: 100%; max-width: 360px; background: var(--paper); border-radius: 18px; padding: 20px; }
.cat-dialog h2 i { color: var(--staff); }
.cat-dialog p { margin: 6px 0 12px; color: var(--muted); font-size: .9rem; }
.cat-dialog input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.cat-dialog input:focus { border-color: var(--brand); }
.cat-dialog .cat-error { color: var(--danger); margin: 8px 0 0; }
.cat-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 16px; }

/* ---------- Image viewer ---------- */
.cat-viewer { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: rgba(24, 17, 19, .92); }
.cat-viewer figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: min(900px, 100%); }
.cat-viewer img { max-width: 100%; max-height: calc(100vh - 200px); border-radius: 16px; background: #fff; object-fit: contain; }
.cat-viewer figcaption { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .96); }
.cat-viewer figcaption b { font-weight: 500; font-size: 1.05rem; }
.cat-viewer-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.cat-viewer-line .cat-price { padding-top: 2px; }
.cat-viewer-close { position: absolute; top: 14px; right: 14px; }
.cat-viewer-close, .cat-viewer-nav { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.2rem; }
.cat-viewer-close:hover, .cat-viewer-nav:hover:not(:disabled) { background: var(--brand); }
.cat-viewer-nav:disabled { opacity: .25; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  html { font-size: 14px; }
  .cat-wrap { padding: 0 10px; }
  .cat-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Brands and sort: a smaller, tighter row */
  .cat-brands { column-gap: 14px; }
  .cat-brands > button, .cat-brands-more { padding: 8px 0; font-size: .87rem; }
  .cat-sort-btn { min-height: 36px; font-size: .87rem; }
  .cat-filterbar { margin-bottom: 8px; }
  /* One slim row each, the label sitting on the box's top border */
  .cat-visit { display: block; padding: 18px 20px 8px; }
  .cat-tools { gap: 8px; padding: 9px 0 4px; /* just clear of the label on the box's top border */ }
  .cat-tools::before { inset: 0 -10px; }
  .cat-select { min-height: 40px; padding: 4px 30px 4px 12px; border-radius: 10px; }
  .cat-select-label { position: absolute; top: -7px; left: 9px; padding: 0 4px; font-size: .6rem; line-height: 12px; background: linear-gradient(var(--page) 50%, var(--paper) 50%); }
  .cat-select.open .cat-select-label { color: var(--brand); }
  .cat-search { min-height: 40px; border-radius: 10px; }
  .cat-search input { height: 38px; }
  .cat-menu-categories { top: 55px; /* under the 40px category box (9px padding + 40px + 6px) */ }
  .cat-summary { gap: 6px 10px; margin: 0 0 8px; font-size: .93rem; }
  .cat-alt { padding: 3px 10px; font-size: .8rem; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-body { padding: 10px 10px 12px; }
  .cat-price { font-size: 1.1rem; }
  .cat-menu-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 6px; padding: 8px; }
  .cat-menu-categories button { padding: 5px 10px; }
  .cat-viewer { padding: 10px; }
  .cat-viewer-nav { position: absolute; bottom: 24px; }
  .cat-viewer-nav.prev { left: 16px; }
  .cat-viewer-nav.next { right: 16px; }
  .cat-viewer figure { margin-bottom: 64px; }
}
