/* Pallet Lane — Ovasta Seeds shop UI (Cautionfield)
   Fixed: sticky offset, transform stagger conflicts, gate clipping,
   mast nesting, mobile dock wrap, CTA width, contrast. */
.page-a99-pallet {
  --pl-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pl-nav-offset: 96px;
  --pl-wood: #c4a574;
  --pl-wood-deep: #8f6d3f;
  --pl-wood-mid: #a88452;
  background:
    linear-gradient(180deg, #d5dde4 0%, var(--cf-field) 28%, #e2e8ee 100%);
}

.pl-mast {
  width: min(100% - 32px, var(--cf-max));
  margin: 24px auto 16px;
  padding: 28px 24px 22px;
  background: var(--cf-asphalt);
  color: #F4F7F8;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 var(--cf-cone);
  position: relative;
  overflow: hidden;
}
.pl-mast::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--cf-signal) 0 8px,
    var(--cf-asphalt) 8px 16px
  );
}
.pl-kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cf-tape);
}
.pl-mast h1 {
  margin: 0 0 10px;
  font-family: var(--cf-font-display);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.08;
  color: var(--cf-signal);
}
.pl-mast > p {
  margin: 0;
  max-width: 54ch;
  color: #D5DEE4;
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 500;
}

.pl-yard {
  width: min(100% - 32px, var(--cf-max));
  margin: 0 auto 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sticky load dock — clear Yard Stake nav */
.pl-dock {
  position: sticky;
  top: var(--pl-nav-offset);
  z-index: 45;
  background: var(--cf-surface);
  border: 3px solid var(--cf-asphalt);
  box-shadow: 4px 4px 0 var(--cf-asphalt);
  overflow: visible;
}
.pl-dock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--cf-asphalt);
  color: #fff;
}
.pl-search {
  display: flex;
  flex: 1 1 240px;
  min-width: min(100%, 200px);
}
.pl-search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 2px solid var(--cf-signal);
  background: #1C2228;
  color: #fff;
  padding: 0 12px;
  font-weight: 600;
}
.pl-search input::placeholder { color: var(--cf-placeholder); }
.pl-search button {
  flex: 0 0 auto;
  border: 2px solid #000;
  border-left: 0;
  background: var(--cf-tape);
  color: var(--cf-asphalt);
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
.pl-search button:hover { filter: brightness(1.06); }
.pl-count {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #C5D0D6;
  white-space: nowrap;
}
.pl-count strong {
  font-family: var(--cf-font-display);
  color: var(--cf-signal);
  font-size: 1.2rem;
  margin-right: 4px;
}
.pl-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cf-tape);
}
.pl-sort select {
  min-height: 44px;
  border: 2px solid var(--cf-signal);
  background: #1C2228;
  color: #fff;
  padding: 0 10px;
  font-weight: 700;
  max-width: 140px;
}
.pl-lanes {
  display: inline-flex;
  border: 2px solid var(--cf-signal);
  margin-left: auto;
}
.pl-lane-btn {
  min-width: 38px;
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--cf-signal);
  background: transparent;
  color: var(--cf-signal);
  font-weight: 800;
  cursor: pointer;
}
.pl-lane-btn:last-child { border-right: 0; }
.pl-lane-btn.is-active,
.pl-lane-btn:hover {
  background: var(--cf-signal);
  color: var(--cf-asphalt);
}

/* Lift gates */
.pl-gates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--cf-asphalt);
  position: relative;
  z-index: 2;
}
.pl-gate {
  position: relative;
  border-right: 2px solid var(--cf-asphalt);
  min-width: 0;
}
.pl-gate:last-child { border-right: 0; }
.pl-gate-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border: 0;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transform-origin: top center;
  transition: transform 260ms var(--pl-ease), filter 200ms ease;
}
.pl-gate-bar--cone { background: var(--cf-cone); color: var(--cf-on-cone); }
.pl-gate-bar--tape { background: var(--cf-tape); color: var(--cf-asphalt); }
.pl-gate-bar--signal { background: var(--cf-signal); color: var(--cf-signal-ink); }
.pl-gate-hinge {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #000;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.pl-gate.is-open .pl-gate-bar {
  transform: perspective(420px) rotateX(-14deg);
  filter: brightness(1.05);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.pl-gate-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  z-index: 50;
  padding: 14px;
  background: #fff;
  border: 2px solid var(--cf-asphalt);
  box-shadow: 4px 8px 0 rgba(18, 21, 26, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(320px, 55vh);
  overflow: auto;
  animation: plGateDrop 280ms var(--pl-ease);
}
/* Widen edge panels so they don't clip off-screen */
.pl-gate:first-child .pl-gate-panel {
  left: 0;
  right: auto;
  width: max(100%, 240px);
}
.pl-gate:last-child .pl-gate-panel {
  left: auto;
  right: 0;
  width: max(100%, 240px);
}
.pl-gate-panel[hidden] { display: none !important; }
.pl-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid rgba(20, 24, 26, 0.2);
  background: var(--cf-field);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--cf-ink);
  cursor: pointer;
  line-height: 1.3;
}
.pl-chip span { flex: 1; min-width: 0; word-break: break-word; }
.pl-chip:hover { border-color: var(--cf-cone); }
.pl-chip:has(input:checked),
.pl-chip.is-on {
  border-color: var(--cf-cone);
  background: #fff4ec;
  box-shadow: inset 4px 0 0 var(--cf-cone);
}
.pl-chip input {
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--cf-cone);
  width: 1rem;
  height: 1rem;
}
.pl-note {
  margin: 0;
  font-size: 0.85rem;
  color: #3A4650;
  font-weight: 600;
}
.pl-price-row {
  display: flex;
  gap: 8px;
}
.pl-price-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 2px solid var(--cf-asphalt);
  padding: 0 10px;
  font-weight: 700;
  color: var(--cf-ink);
  background: #fff;
}
.pl-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--cf-asphalt);
  background: var(--cf-cone);
  color: var(--cf-on-cone);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--cf-asphalt);
}
.pl-apply:hover,
.pl-apply:focus-visible {
  background: var(--cf-cone-deep);
  outline: none;
}

.pl-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--cf-field);
  border-top: 2px dashed var(--cf-asphalt);
}
.pl-strip {
  display: inline-flex;
  padding: 5px 10px;
  border: 2px solid #000;
  background: var(--cf-cone);
  color: var(--cf-on-cone);
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 2px 2px 0 #000;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-strip--tape { background: var(--cf-tape); color: var(--cf-asphalt); }
.pl-strip--signal { background: var(--cf-signal); color: var(--cf-signal-ink); }
.pl-clear {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--cf-cone-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Product lane — stagger via margin, not transform (keeps hover clean) */
.pl-lane {
  display: grid;
  gap: 20px 18px;
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pl-lane[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl-lane[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pl-pallet {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--pl-wood);
  border: 3px solid var(--cf-asphalt);
  box-shadow: 4px 4px 0 var(--cf-asphalt);
  overflow: hidden;
  animation: plRollIn 480ms var(--pl-ease) both;
  animation-delay: calc(min(var(--pl-i, 0), 12) * 30ms);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.pl-pallet:nth-child(even) { margin-top: 10px; }
.pl-pallet:hover,
.pl-pallet:focus-within {
  transform: translateY(-5px);
  box-shadow: 7px 9px 0 var(--cf-asphalt);
  z-index: 2;
}
.pl-pallet.is-empty {
  opacity: 0.78;
  filter: grayscale(0.2);
}
.pl-pallet-slats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    var(--pl-wood-mid) 0 12px,
    var(--pl-wood-deep) 12px 16px
  );
  border-top: 2px solid var(--cf-asphalt);
  z-index: 2;
  pointer-events: none;
}
.pl-pallet-stencil {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  min-width: 2em;
  padding: 5px 8px;
  background: var(--cf-signal);
  color: var(--cf-signal-ink);
  border: 2px solid #000;
  font-family: var(--cf-font-display);
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 2px 2px 0 #000;
}
.pl-crate {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 12px 12px 0;
  background: #E8EEF2;
  border: 2px solid var(--cf-asphalt);
  overflow: hidden;
}
.pl-crate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}
.pl-pallet:hover .pl-crate img { transform: scale(1.04); }
.pl-crate-flag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  background: var(--cf-err);
  color: #fff;
  border: 2px solid #000;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}
.pl-pallet-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 26px;
  background: #fff;
  border-top: 2px solid var(--cf-asphalt);
  margin-top: 10px;
  position: relative;
  z-index: 1;
  min-height: 0;
}
.pl-aisle {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cf-text-tape);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-pallet-meta h2 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.pl-pallet-meta h2 a {
  text-decoration: none;
  color: var(--cf-ink);
}
.pl-pallet-meta h2 a:hover,
.pl-pallet-meta h2 a:focus-visible {
  color: var(--cf-text-cone);
  outline: none;
}
.pl-price {
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.pl-price s {
  color: #5A6570;
  font-size: 0.85rem;
  font-weight: 600;
}
.pl-price strong {
  font-family: var(--cf-font-display);
  font-size: 1.3rem;
  color: var(--cf-text-cone);
  letter-spacing: 0.01em;
}
.pl-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  padding: 0 14px;
  border: 2px solid var(--cf-asphalt);
  background: var(--cf-cone);
  color: var(--cf-on-cone);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--cf-asphalt);
  overflow: hidden;
}
.pl-cta span { position: relative; z-index: 1; }
.pl-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 230, 0, 0.45) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 360ms ease;
}
.pl-cta:hover::after,
.pl-cta:focus-visible::after { transform: translateX(120%); }
.pl-cta:focus-visible { outline: 3px solid var(--cf-signal); outline-offset: 2px; }

.pl-empty {
  text-align: center;
  padding: 48px 20px;
  border: 3px dashed #5A6570;
  background: rgba(255, 255, 255, 0.85);
}
.pl-empty p {
  margin: 0 0 16px;
  font-weight: 700;
  color: #3A4650;
}

.pl-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding-top: 4px;
}
.pl-page-num {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cf-asphalt);
  background: #fff;
  color: var(--cf-ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--cf-asphalt);
}
.pl-page-num.is-active,
.pl-page-num:hover,
.pl-page-num:focus-visible {
  background: var(--cf-cone);
  color: var(--cf-on-cone);
  outline: none;
}
.pl-page-gap {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  font-weight: 800;
  color: #5A6570;
}

@keyframes plGateDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes plRollIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .pl-lane[data-cols="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .page-a99-pallet { --pl-nav-offset: 80px; }
  .pl-lane[data-cols="4"],
  .pl-lane[data-cols="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-gates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-gate:nth-child(2n) { border-right: 0; }
  .pl-gate:nth-child(-n+2) { border-bottom: 2px solid var(--cf-asphalt); }
  .pl-gate:first-child .pl-gate-panel,
  .pl-gate:last-child .pl-gate-panel,
  .pl-gate .pl-gate-panel {
    left: 0;
    right: 0;
    width: auto;
  }
  .pl-lanes { margin-left: 0; }
  .pl-pallet:nth-child(even) { margin-top: 0; }
}
@media (max-width: 640px) {
  .page-a99-pallet { --pl-nav-offset: 72px; }
  .pl-mast { padding: 24px 16px 18px; margin-top: 16px; }
  .pl-lane,
  .pl-lane[data-cols="2"],
  .pl-lane[data-cols="3"],
  .pl-lane[data-cols="4"] { grid-template-columns: 1fr; gap: 14px; }
  .pl-gates { grid-template-columns: 1fr; }
  .pl-gate {
    border-right: 0;
    border-bottom: 2px solid var(--cf-asphalt);
  }
  .pl-gate:last-child { border-bottom: 0; }
  .pl-gate .pl-gate-panel {
    position: static;
    max-height: none;
    border-width: 0 0 0 0;
    box-shadow: inset 0 2px 0 var(--cf-asphalt);
    animation: none;
  }
  .pl-clear { margin-left: 0; width: 100%; }
  .pl-dock-bar { padding: 10px 12px; }
  .pl-sort { width: 100%; }
  .pl-sort select { flex: 1; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-pallet,
  .pl-gate-bar,
  .pl-cta::after,
  .pl-crate img {
    animation: none !important;
    transition: none !important;
  }
}
