/* Accessories page — intro, model filter chips, product grid */

.acc-filter,
.acc-grid-wrap { max-width: 1520px; margin: 0 auto; padding-left: 6vw; padding-right: 6vw; }

/* Banner — built like .vac-hero (styles.css) but shorter, with centred dark text on the light photo */
.acc-hero {
  position: relative; width: 100%; aspect-ratio: 3.4 / 1; max-height: 420px; min-height: 260px;
  overflow: hidden; background: #f7f7f7;
}
/* The photo has no horizontal slack at 3.4:1, so it's zoomed slightly around the centred text
   to push the products out towards the edges (more on mobile, where more of the photo shows) */
.acc-hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 52%;
  transform: scale(1.15); transform-origin: 50% 50%;
}
.acc-hero-fade {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 60%);
}
.acc-hero-copy {
  position: absolute; inset: 0; padding: 0 6vw; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.acc-hero-copy h1 {
  margin: 0; color: var(--ink); font-size: clamp(44px,6.2vw,104px); font-weight: 600;
  letter-spacing: -0.045em; line-height: 0.95;
}
.acc-hero-copy p {
  margin: 14px auto 0; max-width: 520px; text-wrap: balance; color: #555; font-size: 16px; font-weight: 400; letter-spacing: 0.01em; line-height: 1.45;
}

/* Model filter: chips + the item count on the right (above 600px); a custom dropdown at 600px and below */
/* align-items: flex-start + a 40px line keep the count level with the first row of chips when they wrap */
.acc-filter { padding-top: clamp(36px, 4.5vw, 56px); display: flex; align-items: flex-start; gap: 12px 24px; }
.acc-filter-track { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }
.acc-filter-select-wrap { display: none; }
.acc-count { margin: 0 0 0 auto; flex: 0 0 auto; font-size: 13px; font-weight: 400; line-height: 40px; color: rgba(17,17,17,0.55); font-variant-numeric: tabular-nums; }
.acc-chip {
  flex: 0 0 auto; height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(17,17,17,0.16); background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.acc-chip:hover { border-color: var(--ink); }
.acc-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.acc-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Grid */
.acc-grid-wrap { padding-top: clamp(28px, 3.5vw, 40px); padding-bottom: 140px; }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 12px; }
@media (min-width: 768px) {
  .acc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 20px; }
}
@media (min-width: 1100px) {
  .acc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 24px; }
}

.acc-card { display: flex; flex-direction: column; min-width: 0; }
.acc-card-media {
  position: relative; aspect-ratio: 1 / 1; border-radius: 20px; background: #f5f5f7;
  padding: 14%; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* multiply lets photos with white backgrounds blend into the grey tile */
.acc-card-media img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.acc-card-media .media-fallback {
  background: transparent; border-color: rgba(17,17,17,0.12); border-radius: 14px;
}

/* Price is pushed to the bottom so prices line up across a row */
.acc-card-body { display: flex; flex-direction: column; flex: 1 0 auto; padding: 18px 0 0; }
.acc-card-eyebrow {
  margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(17,17,17,0.45);
}
.acc-card-name {
  margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3;
}
.acc-card-fits {
  margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: rgba(17,17,17,0.5);
}
.acc-card-code {
  margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: rgba(17,17,17,0.4);
  font-variant-numeric: tabular-nums;
}
.acc-card-name + .acc-card-code { margin-top: 6px; }
.acc-card-price {
  margin: auto 0 0; padding-top: 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
}

/* Empty state */
.acc-empty { padding: 64px 0 24px; text-align: center; }
.acc-empty[hidden] { display: none; }
.acc-empty-title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.acc-empty-text { margin: 8px 0 0; font-size: 15px; color: rgba(17,17,17,0.55); }
.acc-empty-text a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .acc-chip { transition: none; }
}

/* Phones: the chips wrap awkwardly, so a full-width pill dropdown (button + listbox, accessories.js) replaces
   them. 16px text, no blue anywhere; the menu overlays the grid instead of pushing it down. */
@media (max-width: 600px) {
  .acc-filter { display: block; }
  .acc-filter-track { display: none; }
  .acc-filter-select-wrap { display: block; }
  .acc-filter-label { margin: 0 0 8px; font-size: 13px; font-weight: 400; color: rgba(17,17,17,0.55); }
  .acc-count { margin: 12px 0 0; line-height: 1.4; }

  .acc-dropdown { position: relative; }
  .acc-dropdown-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; height: 48px; margin: 0; padding: 0 20px;
    border: 1px solid #d4d4d4; border-radius: 24px; background: #fff; cursor: pointer;
    color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; text-align: left;
    -webkit-tap-highlight-color: transparent; transition: border-color .2s;
  }
  .acc-dropdown-trigger:focus { outline: none; }
  .acc-dropdown-trigger:focus-visible,
  .acc-dropdown.open .acc-dropdown-trigger { border-color: var(--ink); }
  /* Chevron: a simple 12 x 7 stroke; turns over when open */
  .acc-dropdown-chevron {
    flex: 0 0 auto; width: 12px; height: 7px; transition: transform .2s ease;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 7px;
  }
  .acc-dropdown.open .acc-dropdown-chevron { transform: rotate(180deg); }

  .acc-dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
    margin: 0; padding: 6px; list-style: none; outline: none;
    background: #fff; border: 1px solid #eee; border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    opacity: 0; visibility: hidden; transform: translateY(-4px) scale(0.98); transform-origin: top center;
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  }
  /* Not enough room below the button: open upwards */
  .acc-dropdown.drop-up .acc-dropdown-menu { top: auto; bottom: calc(100% + 8px); transform-origin: bottom center; transform: translateY(4px) scale(0.98); }
  .acc-dropdown.open .acc-dropdown-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .15s ease, transform .15s ease; }

  .acc-dropdown-option {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer;
    color: var(--ink); font-size: 16px; font-weight: 400; letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  }
  /* Hover, pressed and keyboard-active (aria-activedescendant) all use the site's tile grey */
  .acc-dropdown-option:hover,
  .acc-dropdown-option:active,
  .acc-dropdown-option.is-active { background: #f5f5f7; }
  .acc-dropdown-option[aria-selected="true"] { font-weight: 600; }
  .acc-dropdown-option[aria-selected="true"]::after {
    content: ""; flex: 0 0 auto; width: 14px; height: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M1 5l4 4 8-8' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 14px 10px;
  }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .acc-dropdown-trigger, .acc-dropdown-chevron, .acc-dropdown-menu,
  .acc-dropdown.open .acc-dropdown-menu { transition: none; }
  .acc-dropdown-menu, .acc-dropdown.drop-up .acc-dropdown-menu { transform: none; }
}

@media (max-width: 767px) {
  .acc-hero { aspect-ratio: auto; height: 260px; min-height: 0; }
  .acc-hero-media { transform: scale(1.7); }
  .acc-hero-copy p { margin-top: 10px; font-size: 15px; }
  .acc-grid-wrap { padding-bottom: 96px; }
  .acc-card-body { padding: 14px 0 0; }
  .acc-card-eyebrow { font-size: 10px; letter-spacing: 0.12em; margin-bottom: 5px; }
  .acc-card-name { font-size: 15px; }
  .acc-card-fits { font-size: 12px; }
  .acc-card-code { font-size: 11px; }
  .acc-card-price { font-size: 14px; padding-top: 10px; }
}
