:root { --pos-tile-min: 150px; }
/* =====================================================================
   Tess29 brand theme: signature yellow with a light, warm palette.
   White surfaces on a soft cream page, deep-gold accents, and warm
   charcoal text (no black surfaces). Text on yellow is dark charcoal.
   ===================================================================== */
:root {
  --brand: #FFD400;          /* Tess29 yellow */
  --brand-hover: #F5C800;
  --brand-active: #E6B800;
  --brand-deep: #8A6A00;     /* readable "yellow" for text/links on white */
  --brand-50: #FFF8D6;       /* pale yellow tint */
  --brand-100: #FFEFA3;
  --ink: #3A352B;            /* warm charcoal text (softer than black) */
  --ink-2: #5E5747;          /* secondary text */
  --gold: #C99700;           /* deep gold accent for selected states */
  --gold-dark: #A87E00;
  --page: #FAF8F1;           /* warm off-white */
  --line: #ECE6D3;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 255, 212, 0;
  --bs-primary-text-emphasis: #5C4700;
  --bs-primary-bg-subtle: var(--brand-50);
  --bs-primary-border-subtle: var(--brand-100);
  --bs-link-color: var(--brand-deep);
  --bs-link-color-rgb: 138, 106, 0;
  --bs-link-hover-color: #5C4700;
  --bs-link-hover-color-rgb: 92, 71, 0;
  --bs-body-color: var(--ink);
  --bs-border-color: #E4DECB;
  --bs-focus-ring-color: rgba(255, 212, 0, .45);
}
body { background: var(--page); color: var(--ink); }
a { text-underline-offset: 2px; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { font-weight: 700; letter-spacing: -.01em; }

/* Brand wordmark (slab serif like the banner) */
.brand-font { font-family: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif; font-weight: 400; letter-spacing: .5px; }

/* Buttons */
.btn-primary {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--brand-active); --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-disabled-color: #6b6b6b; --bs-btn-disabled-bg: #F3E39A; --bs-btn-disabled-border-color: #F3E39A;
  --bs-btn-focus-shadow-rgb: 255, 212, 0; font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: var(--ink); --bs-btn-border-color: #E0BC00;
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--brand-active); --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-focus-shadow-rgb: 255, 212, 0;
}
/* Strong action buttons: yellow with a gold edge (used for Log in and the phone cart bar) */
.btn-dark, .btn-ink {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--gold);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--gold-dark);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--brand-active); --bs-btn-active-border-color: var(--gold-dark);
  font-weight: 700; box-shadow: 0 2px 0 var(--gold);
}
.btn-success { --bs-btn-bg: #1E7B4F; --bs-btn-border-color: #1E7B4F; --bs-btn-hover-bg: #186641; --bs-btn-hover-border-color: #186641;
  --bs-btn-active-bg: #145737; --bs-btn-disabled-bg: #7FB79A; --bs-btn-disabled-border-color: #7FB79A; }
.btn-outline-success { --bs-btn-color: #1E7B4F; --bs-btn-border-color: #1E7B4F; --bs-btn-hover-bg: #1E7B4F; --bs-btn-hover-border-color: #1E7B4F;
  --bs-btn-active-bg: #1E7B4F; --bs-btn-active-border-color: #1E7B4F; }
.btn-check:checked + .btn-outline-secondary, .btn-outline-secondary.active { background: var(--brand); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.btn-check:checked + .btn-outline-primary { background: var(--brand); border-color: var(--brand); color: var(--ink); }

/* Badges, text and table accents */
.text-bg-primary { background-color: var(--brand) !important; color: var(--ink) !important; }
.text-primary { color: var(--brand-deep) !important; }
.text-success { color: #1E7B4F !important; }
.text-bg-success { background-color: #1E7B4F !important; }
.text-bg-warning { background-color: #FFE066 !important; color: #3D3000 !important; }
.table-primary { --bs-table-bg: var(--brand-50); --bs-table-color: var(--ink); --bs-table-border-color: var(--brand-100); }
.table > thead.table-light th, .table-light { --bs-table-bg: #F6F2E6; --bs-table-color: #4A4433; font-weight: 600; }
.table > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }
.clickable-row { cursor: pointer; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--brand-50); }

/* Forms */
.form-control:focus, .form-select:focus { border-color: #E0BC00; box-shadow: 0 0 0 .22rem rgba(255, 212, 0, .35); }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.form-check-input:focus { border-color: #E0BC00; box-shadow: 0 0 0 .22rem rgba(255, 212, 0, .35); }
.form-switch .form-check-input:focus:not(:checked) { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23E0BC00'/%3e%3c/svg%3e"); }
.input-group-text { background: #F6F2E6; border-color: var(--bs-border-color); }

/* Pagination, dropdowns, alerts */
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-hover-color: var(--ink); --bs-pagination-hover-bg: var(--brand-50);
  --bs-pagination-focus-box-shadow: 0 0 0 .22rem rgba(255,212,0,.35); --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--gold); --bs-pagination-active-color: var(--ink); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--brand); --bs-dropdown-link-active-color: var(--ink);
  --bs-dropdown-border-color: var(--line); box-shadow: 0 8px 24px rgba(26,26,26,.12); }
.alert-info { --bs-alert-bg: var(--brand-50); --bs-alert-border-color: var(--brand-100); --bs-alert-color: #4A3B00; }

/* Cards */
.card { border-color: var(--line); border-radius: .7rem; box-shadow: 0 1px 2px rgba(40, 32, 0, .04); }
.card-header { border-color: var(--line); }
.card-header.bg-body { background: #fff !important; }
.stat-card { border-top: 3px solid var(--brand); transition: box-shadow .15s, transform .15s; }
.stat-card:hover { box-shadow: 0 6px 18px rgba(40, 32, 0, .10); }

/* Navigation bar: white with a yellow accent line */
.brand-navbar { background: #fff; border-top: 4px solid var(--brand); border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(90, 70, 0, .06) !important; }
.brand-navbar .navbar-brand { color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.brand-navbar .navbar-brand:hover { color: var(--ink); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--brand); color: var(--ink); font-size: 1.15rem; line-height: 1; box-shadow: inset 0 -2px 0 var(--gold); }
.brand-word { font-size: 1.35rem; line-height: 1; color: var(--ink); }
.brand-sub { display: block; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: #9A8F72; font-family: system-ui, sans-serif; margin-top: 3px; }
.brand-navbar .nav-link { color: var(--ink-2); border-radius: .45rem; padding: .45rem .65rem !important; white-space: nowrap; }
.brand-navbar .nav-link:hover { color: var(--ink); background: var(--brand-50); }
.brand-navbar .nav-link.active { color: var(--ink) !important; background: var(--brand); font-weight: 600; }
.brand-navbar .navbar-toggler { border-color: var(--line); }
.brand-navbar .user-menu { color: var(--ink-2); }

/* Login: banner-style sunburst */
.login-page { min-height: 100vh;
  background: repeating-conic-gradient(from 0deg at 50% 38%, #FFD400 0deg 6deg, #FFDF3D 6deg 12deg); }
.login-word { font-size: clamp(2.8rem, 9vw, 4rem); color: var(--ink); line-height: 1;
  text-shadow: 3px 3px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff; }
.login-card .btn-ink { padding-top: .7rem; padding-bottom: .7rem; }
.login-tag { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; color: var(--ink); }
.login-card { border: 0; border-radius: 1rem; box-shadow: 0 18px 50px rgba(60, 45, 0, .25); }

/* ---------- product photos ---------- */
.product-photo { width: 120px; height: 120px; object-fit: cover; border-radius: .5rem; border: 1px solid #e7eaf0; background: #fff; flex-shrink: 0; }
.product-photo-preview { max-width: 160px; max-height: 160px; object-fit: cover; border-radius: .5rem; border: 1px solid #e7eaf0; }
.product-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: .4rem; border: 1px solid #e7eaf0; flex-shrink: 0; }
.product-photo-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: #CDBF8A; font-size: 1.4rem; }

/* ---------- POS ---------- */
.pos-body { background: var(--page); }
.sticky-search { position: sticky; top: 66px; z-index: 5; background: var(--page); padding: .25rem 0; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--pos-tile-min), 1fr)); gap: .6rem; padding-bottom: 5.5rem; }
.pos-tile {
  position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: .7rem; padding: 0; overflow: visible;
  transition: transform .05s ease, border-color .15s, box-shadow .15s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.pos-tile-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .7rem .7rem 0 0; background: #f1f3f6; }
.pos-tile-noimg { display: flex; align-items: center; justify-content: center; color: #D9CFA8; background: var(--brand-50) !important; font-size: 2rem; }
.pos-tile-body { display: flex; flex-direction: column; padding: .55rem .7rem .65rem; }
.drawer-bar { border-left: 5px solid var(--brand); }
.qty-btn { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.qty-value { min-width: 36px; text-align: center; font-weight: 700; font-size: 1.15rem; }
.pos-tile:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 4px 14px rgba(60,45,0,.14); }
.pos-tile:active:not(:disabled) { transform: scale(.97); }
.pos-tile.low { box-shadow: inset 0 -4px 0 #F0A500; }
.pos-tile.out, .pos-tile:disabled { opacity: .5; cursor: not-allowed; }
.pos-tile-name { font-weight: 600; line-height: 1.2; margin-bottom: .35rem; overflow-wrap: anywhere; }
.pos-tile-price { font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.pos-tile-stock { font-size: .8rem; color: #6c757d; }
.pos-tile-add { margin-top: auto; padding-top: .35rem; font-size: .85rem; color: #198754; font-weight: 600; }
.pos-tile-count {
  position: absolute; top: -8px; right: -8px; background: var(--brand); color: var(--ink); border: 2px solid #fff; border-radius: 999px;
  min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.pos-cart-lines { max-height: 45vh; overflow-y: auto; }
.qty-group { width: 168px; }
.qty-group input { max-width: 56px; }
@media (min-width: 992px) {
  .pos-cart { position: sticky; top: 80px; }
  .pos-cart-lines { max-height: calc(100vh - 470px); min-height: 80px; }
  .pos-grid { padding-bottom: 1rem; }
}
@media (max-width: 991.98px) {
  .pos-cart-offcanvas.offcanvas-bottom { height: 88vh; border-top-left-radius: 1rem; border-top-right-radius: 1rem; }
  .pos-cart-offcanvas .pos-cart { border: 0; }
  .pos-cart-offcanvas .offcanvas-body { overflow-y: auto; }
}
@media (max-width: 575.98px) { :root { --pos-tile-min: 135px; } .pos-tile { min-height: 110px; } }
.pos-bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); background: rgba(250,248,241,.95); backdrop-filter: blur(4px); border-top: 1px solid var(--line); z-index: 1030; }
.store-label { max-width: 7.5rem; }
.table a, .list-group-item a { color: var(--ink); text-decoration: none; font-weight: 600; }
.table a:hover, .list-group-item a:hover { color: var(--brand-deep); text-decoration: underline; }
.icon-badge { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 1.9rem; box-shadow: 0 0 0 6px var(--brand-50); }
.icon-badge-sm { width: 40px; height: 40px; font-size: 1.25rem; box-shadow: none; flex-shrink: 0; }

/* Logo images (from branding/alternative-app-font) */
.brand-logo { width: 44px; height: 44px; flex-shrink: 0; }
.login-logo { width: min(300px, 78vw); height: auto; filter: drop-shadow(0 6px 14px rgba(90, 70, 0, .18)); }
