/* Arto Wholesale (b2b.arto.ae) — brand stylesheet.
 *
 * Brand values are copied verbatim from the staff portal's templates/base.html
 * (--arto-green #c0b561 / --arto-green-dark #a89e4e / --arto-dark #231f20,
 * Merriweather Sans, Bootstrap 5.3.3) so the two surfaces read as one company.
 * This file lives in the b2b blueprint's own static folder — the portal's
 * static/ and templates/ are never touched, and this stylesheet is served only
 * on the b2b host (endpoint b2b_public.static).
 *
 * Tone is the arto.ae storefront rather than the portal: warmer paper, more air
 * around the type, softer cards. The palette and header treatment are the
 * portal's.
 */

:root {
  --arto-green:      #c0b561;   /* portal --arto-green      */
  --arto-green-dark: #a89e4e;   /* portal --arto-green-dark */
  --arto-dark:       #231f20;   /* portal --arto-dark       */
  --arto-paper:      #faf9f6;   /* storefront warm paper    */
  --arto-line:       #eceae2;
  --arto-muted:      #8a8778;
}

body {
  background: var(--arto-paper);
  font-family: 'Merriweather Sans', sans-serif;
  color: var(--arto-dark);
}

/* ── Header: the portal's olive bar, with the Arto logo ──────────────────────
   The logo SVG renders white, so it must only ever sit on the olive bar. */
.navbar {
  background: var(--arto-green) !important;
  box-shadow: 0 1px 12px rgba(35, 31, 32, .10);
}
.navbar .navbar-brand,
.navbar .nav-link            { color: #fff !important; }
.navbar .nav-link:hover      { color: rgba(255, 255, 255, .78) !important; }
.navbar .nav-link.active     { color: #fff !important; font-weight: 600; }
.navbar-toggler              { border-color: rgba(255, 255, 255, .5); }
.navbar-toggler-icon         { filter: brightness(0) invert(1); }
.navbar-toggler:focus        { box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .35); }

.navbar-brand                { display: flex; align-items: center; gap: .55rem; }
.navbar-brand img            { height: 40px; width: auto; }
.navbar-brand .brand-word {
  color: #fff;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .82rem;
  padding-left: .55rem;
  border-left: 1px solid rgba(255, 255, 255, .45);
}

/* Cart count sits ON the olive bar, so it inverts: white pill, olive digits. */
.cart-count-pill {
  background: #fff;
  color: var(--arto-green-dark);
  border-radius: 999px;
  padding: 0 .45rem;
  font-size: .72rem;
  font-weight: 700;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-arto,
.btn-arto:active {
  background: var(--arto-green);
  border-color: var(--arto-green);
  color: #fff;
  font-weight: 600;
}
.btn-arto:hover,
.btn-arto:focus {
  background: var(--arto-green-dark);
  border-color: var(--arto-green-dark);
  color: #fff;
}
.btn-arto:focus-visible {
  box-shadow: 0 0 0 .25rem rgba(192, 181, 97, .40);
}

/* Replaces Bootstrap's btn-outline-dark (black) everywhere on the b2b site. */
.btn-outline-arto {
  border-color: var(--arto-green);
  color: var(--arto-dark);
  background: transparent;
  font-weight: 600;
}
.btn-outline-arto:hover,
.btn-outline-arto:focus {
  background: var(--arto-green);
  border-color: var(--arto-green);
  color: #fff;
}
.btn-outline-arto:disabled,
.btn-outline-arto.disabled {
  border-color: var(--arto-line);
  color: var(--arto-muted);
  opacity: 1;
}
.btn-outline-arto:focus-visible {
  box-shadow: 0 0 0 .25rem rgba(192, 181, 97, .40);
}

/* Any stray Bootstrap primary picks up the brand rather than Bootstrap blue. */
.btn-primary,
.btn-primary:active {
  background: var(--arto-green);
  border-color: var(--arto-green);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--arto-green-dark);
  border-color: var(--arto-green-dark);
  color: #fff;
}

/* ── Links, cards, forms, tables ─────────────────────────────────────────── */
a               { color: var(--arto-green-dark); }
a:hover         { color: var(--arto-green); }
.text-arto      { color: var(--arto-green-dark) !important; }

.card {
  border: 1px solid var(--arto-line);
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(35, 31, 32, .05);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--arto-green);
  box-shadow: 0 0 0 .2rem rgba(192, 181, 97, .25);
}
.form-check-input:checked {
  background-color: var(--arto-green);
  border-color: var(--arto-green);
}

table thead th {
  background: #f0f0ee;
  font-size: .88rem;
  border-bottom-color: var(--arto-line);
}

.badge-arto { background: var(--arto-green); color: #fff; }

/* Extra-small button (self-service action rows) — Bootstrap 5 has no btn-xs. */
.btn-xs { padding: .12rem .5rem; font-size: .74rem; border-radius: 5px; line-height: 1.4; }

/* ── Storefront furniture ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(180deg, #fffdf7 0%, var(--arto-paper) 100%);
  border: 1px solid var(--arto-line);
  border-radius: 16px;
  padding: 3.5rem 1.5rem;
}
.hero h1        { letter-spacing: -.01em; }
.hero .rule {
  width: 64px;
  height: 3px;
  background: var(--arto-green);
  border-radius: 2px;
  margin: 1.25rem auto 0;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--arto-muted);
}

.prod-thumb {
  height: 150px;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(135deg, #efece1, #e2ddca);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--arto-green-dark);
}
/* Image variant: fit the whole photo inside a uniform frame (never crop the
   subject) on a neutral background. */
.prod-thumb--img {
  background: #fbfbfa;
  padding: 8px;
  overflow: hidden;
}
.prod-thumb--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* ── Category browse — editorial storefront style ─────────────────────────────
   Large full-bleed square photo, then the category name + arrow centred beneath
   it (mirrors the arto.ae "Collections" strip). No card border or shadow. */
.cat-link            { display: block; text-decoration: none; color: var(--arto-dark); }
.cat-link:hover      { color: var(--arto-dark); }
.cat-photo {
  aspect-ratio: 1 / 1;
  background: #f4f2ec;
  border-radius: 4px;
  overflow: hidden;
}
.cat-photo img {
  width: 100%; height: 100%;
  object-fit: cover;               /* atmospheric hero fill, like the storefront */
  display: block;
  transition: transform .35s ease;
}
.cat-link:hover .cat-photo img { transform: scale(1.045); }
.cat-photo-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700; color: var(--arto-green-dark);
  background: linear-gradient(135deg, #efece1, #e2ddca);
}
.cat-label {
  text-align: center;
  font-weight: 600;
  padding: .85rem 0 .25rem;
}
.cat-arrow           { display: inline-block; transition: transform .2s ease; }
.cat-link:hover .cat-arrow { transform: translateX(4px); }

/* ── Category product listing — editorial storefront (mirrors arto.ae) ────────── */
.cat-back        { display: inline-block; color: var(--arto-muted); margin-bottom: .5rem; }
.cat-back:hover  { color: var(--arto-green-dark); }
.cat-hero-title  { font-weight: 700; font-size: 2.4rem; letter-spacing: -.01em; margin: 0 0 .15rem; }
.cat-hero-sub    { color: var(--arto-muted); font-size: 1.05rem; margin: 0 0 1.25rem; }

.cat-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .55rem 0 1.4rem;
  border-bottom: 1px solid var(--arto-line);
  margin-bottom: 1.6rem;
}
.cat-sort        { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.cat-sort select {
  border: none; background: transparent; font: inherit; color: var(--arto-dark);
  font-weight: 500; padding: .2rem 1.2rem .2rem .2rem; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238a8778' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .25rem center;
}
.cat-sort select:focus-visible { outline: 2px solid var(--arto-green); outline-offset: 2px; }
.cat-count       { color: var(--arto-muted); font-size: .92rem; }

.prod-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem 1.4rem;
}
@media (min-width: 576px)  { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px)  { .prod-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .prod-grid { grid-template-columns: repeat(6, 1fr); } }

.prod-item { display: flex; flex-direction: column; }
.prod-photo {
  position: relative; display: block;
  aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden;
  background: #f4f2ec; margin-bottom: .7rem;
}
.prod-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.prod-photo:hover img { transform: scale(1.04); }
.prod-photo-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 700; color: var(--arto-green-dark);
  background: linear-gradient(135deg, #efece1, #e2ddca);
}
.prod-badge {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(255,255,255,.92); color: var(--arto-dark);
  font-size: .72rem; font-weight: 500; padding: .25rem .6rem; border-radius: 999px;
}
.prod-name {
  text-align: center; font-weight: 600; color: var(--arto-dark);
  text-decoration: none; line-height: 1.3; margin-bottom: .25rem;
}
.prod-name:hover { color: var(--arto-green-dark); }
.prod-price      { text-align: center; margin-bottom: .7rem; }
.prod-price-val  { font-weight: 500; }
.prod-btn        { margin-top: auto; font-weight: 500; }
.prod-add        { margin-top: auto; }
.qty-step {
  display: flex; align-items: center; justify-content: center; gap: 0;
  border: 1px solid var(--arto-line); border-radius: 999px;
  width: fit-content; margin: 0 auto .5rem;
}
.qty-btn {
  border: none; background: transparent; width: 34px; height: 34px;
  font-size: 1.05rem; line-height: 1; color: var(--arto-dark); cursor: pointer;
  border-radius: 999px;
}
.qty-btn:hover { color: var(--arto-green-dark); }
.qty-val {
  width: 42px; text-align: center; border: none; background: transparent;
  font: inherit; font-weight: 600; -moz-appearance: textfield;
}
.qty-val::-webkit-outer-spin-button, .qty-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Product-page attributes (portal-editable spec list). */
.prod-attrs      { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prod-attrs th, .prod-attrs td { padding: .5rem .1rem; border-bottom: 1px solid var(--arto-line); text-align: left; vertical-align: top; }
.prod-attrs th   { font-weight: 600; width: 40%; color: var(--arto-dark); }
.prod-attrs td   { color: var(--arto-muted); }

/* Empty category ('coming soon') state. */
.cat-empty      { padding: 3rem 1rem; }
.cat-empty-mark { font-size: 2.6rem; line-height: 1; margin-bottom: .6rem; }

.badge-cart  { position: relative; top: -8px; left: -4px; font-size: .65rem; }
.excl-vat    { color: var(--arto-muted); font-size: .72rem; }
footer       { color: var(--arto-muted); font-size: .8rem; }
footer img   { height: 26px; opacity: .55; }

/* ── Mobile (≤767px) — same tap-target/zoom rules as the portal ──────────── */
@media (max-width: 767.98px) {
  input[type="text"], input[type="number"], input[type="date"],
  input[type="email"], input[type="password"], input[type="search"],
  input[type="tel"], select, textarea {
    font-size: 16px !important;          /* stop iOS auto-zoom on focus */
  }
  .btn                      { min-height: 42px; }
  .btn-sm                   { min-height: 36px; }
  .navbar-brand img         { height: 32px; }
  .navbar-brand .brand-word { font-size: .72rem; }
  .navbar-nav .nav-link     { padding: .55rem .25rem; }
  .card                     { border-radius: 10px; }
  .hero                     { padding: 2.25rem 1rem; border-radius: 12px; }
  .hero h1                  { font-size: 1.75rem; }
  .prod-thumb               { height: 120px; font-size: 2rem; }
  .alert                    { font-size: .9rem; }
}
