/* ============================================================================
   American Jane — Design-wall tray
   A fixed bottom strip of swatches for everything in the cart. Site-wide.
   ========================================================================== */

#aj-design-wall {
  --cream:    #FAF3E2;
  --paper:    #FFFDF8;
  --ink:      #3B2F28;
  --ink-soft: #6B5D50;
  --line:     #E7DCC4;
  --red:      #C1392B;

  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: var(--paper);
  border-top: 3px solid var(--line);
  box-shadow: 0 -6px 20px rgba(59, 47, 40, 0.14);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transform: translateY(0);
  transition: transform 220ms ease;
}
/* hidden (slid down) when the cart is empty */
#aj-design-wall.is-empty { transform: translateY(100%); }

#aj-design-wall .aj-tray-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* heading block */
#aj-design-wall .aj-tray-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding-right: 0.9rem;
  border-right: 1px solid var(--line);
}
#aj-design-wall .aj-tray-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  white-space: nowrap;
}
#aj-design-wall .aj-tray-count {
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.35em;
  border-radius: 1em;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#aj-design-wall .aj-tray-count:empty { display: none; }

/* expand toggle — only shown when the swatch row overflows its width */
#aj-design-wall .aj-tray-toggle {
  margin-left: 0.4rem;
  width: 1.8rem;
  height: 1.8rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.85rem;
  display: none;
  transition: transform 180ms ease, color 120ms ease;
}
#aj-design-wall.can-expand .aj-tray-toggle { display: inline-flex; align-items: center; justify-content: center; }
#aj-design-wall .aj-tray-toggle:hover { color: var(--ink); }
#aj-design-wall.is-expanded .aj-tray-toggle { transform: rotate(180deg); }
/* expanded: wrap every swatch into a scrollable grid instead of one scrolling row */
#aj-design-wall.is-expanded .aj-tray-items {
  flex-wrap: wrap;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 42vh;
}

/* the swatch row — scrolls horizontally when it overflows */
#aj-design-wall .aj-tray-items {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
#aj-design-wall .aj-tray-item { flex: 0 0 auto; }
#aj-design-wall .aj-tray-swatch { position: relative; width: 52px; height: 52px; }
#aj-design-wall .aj-tray-swatch a {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
#aj-design-wall .aj-tray-item:hover .aj-tray-swatch a {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(59, 47, 40, 0.22);
}
#aj-design-wall .aj-tray-swatch img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* quantity stepper — overlays the bottom of the swatch, only on hover */
#aj-design-wall .aj-tray-stepper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 0;
  background: rgba(28, 20, 16, 0.72);
  opacity: 0;
  transition: opacity 120ms ease;
}
#aj-design-wall .aj-tray-item:hover .aj-tray-stepper { opacity: 1; }
#aj-design-wall .aj-tray-dec,
#aj-design-wall .aj-tray-inc {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
#aj-design-wall .aj-tray-dec:hover,
#aj-design-wall .aj-tray-inc:hover { background: #fff; color: var(--ink); }
#aj-design-wall .aj-tray-q { min-width: 1em; text-align: center; font-size: 0.68rem; font-weight: 700; color: #fff; }

/* touch devices can't hover — keep the stepper visible */
@media (hover: none) {
  #aj-design-wall .aj-tray-stepper { opacity: 1; }
}

/* checkout button */
#aj-design-wall .aj-tray-checkout {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--red);
  padding: 0.6rem 1.3rem;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease;
}
#aj-design-wall .aj-tray-checkout:hover { background: #a62f23; }

/* Responsive */
@media (max-width: 600px) {
  #aj-design-wall .aj-tray-inner { gap: 0.6rem; padding: 0.4rem 0.6rem; }
  #aj-design-wall .aj-tray-head { padding-right: 0.5rem; }
  #aj-design-wall .aj-tray-title { font-size: 0.95rem; }
  #aj-design-wall .aj-tray-item a { width: 44px; height: 44px; }
  #aj-design-wall .aj-tray-checkout { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
}
