.h1 {
    font-family: "Playfair Display", serif;
    font-size: 36px;
    color: var(--brown);
    margin: 18px 0
}

.filters {
    position: sticky;
    top: 64px;
    z-index: 30;
    background: linear-gradient(180deg, #fff7e6, #fff);
    border-top: 1px solid rgba(23, 21, 18, .06);
    border-bottom: 1px solid rgba(23, 21, 18, .06)
}

.filters .row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding: 12px 0
}

.menu {
    position: relative
}

.btn {
    appearance: none;
    border: 1px solid rgba(23, 21, 18, .18);
    background: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer
}

.btn span {
    font-weight: 600
}

.menu.open .list {
    display: block
}

.list {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    background: #fff;
    border: 1px solid rgba(23, 21, 18, .12);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(23, 21, 18, .12);
    padding: 10px;
    min-width: 220px
}

.list label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px
}

.list input {
    accent-color: var(--brown)
}

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto
}

.pill {
    background: #fff;
    border: 1px solid rgba(23, 21, 18, .18);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px
}

.clear {
    background: transparent;
    border: none;
    color: var(--brown);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer
}

.count {
    font-size: 13px;
    opacity: .7;
    margin-left: 6px
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding: 22px 0
}

.card {
    background: #fff;
    border-radius: 18px;
    overflow: visible;
    box-shadow: 0 10px 24px rgba(23, 21, 18, .08);
    cursor: pointer;
    display: flex;
    flex-direction: column
}

.card-media {
    aspect-ratio: 4/3;
    background: #eee center/cover no-repeat;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
}

.card-body {
    padding: 14px
}

.card-title {
    font-weight: 700
}

.swatches {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    position: relative;
    overflow: visible;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .15);
    background: #e9e6dc;
    /* fallback */
    cursor: pointer;
    padding: 0;
    position: relative;
    overflow: visible;
}

.swatch[data-tip]:hover::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 170%;
  transform: translateX(-50%);
  background: rgba(20,18,15,.92);
  color: #fff;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999999;
  opacity: 1;
  visibility: visible;
}

.swatch[data-tip]:hover::before{
  content: "";
  position: absolute;
  left: 50%;
  bottom: 145%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(20,18,15,.92);
  pointer-events: none;
  z-index: 999999;
  opacity: 1;
  visibility: visible;
}

.detail-swatches {
    display: flex;
    gap: 10px;
    overflow: visible;
    position: relative;
    /* space between circles */
    align-items: center;
    flex-wrap: wrap;
    /* prevents overflow on small widths */
    margin-top: 14px;
    /* space BELOW the image/arrows */
}

.tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(23, 21, 18, .12)
}

.card-outer {
    position: relative
}

.drawer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: none;
    align-items: stretch;
    z-index: 60
}

.drawer.open {
    display: flex
}

.panel {
    margin-left: auto;
    background: #fff;
    width: min(560px, 90vw);
    height: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(23, 21, 18, .1)
}

.panel-title {
    font-family: "Playfair Display", serif;
    font-size: 24px;
    color: var(--brown)
}

.panel-body {
    padding: 16px;
    overflow: visible;
}

.detail-hero {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
    background: #eee center/cover no-repeat
}

.detail-hero-wrap {
    display: flex;
    flex-direction: column;
    /* arrows go UNDER the image */
    gap: 12px;
    /* space between image and arrows row */
    margin-bottom: 12px;
    /* space between arrows row and circles */
}

.detail-hero-wrap .detail-hero {
    order: 1;
    /* image first */
}

.detail-hero-wrap .hero-arrows {
    order: 2;
    /* arrows second */
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.hero-arrow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: rgba(255, 255, 255, .85);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 22px;
    line-height: 1;
}

.specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px
}

.specs div {
    background: #fafafa;
    border: 1px solid rgba(23, 21, 18, .06);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 16px
}

.action {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 12px 14px;
    font-weight: 600;
    cursor: pointer
}

.action.primary {
    background: var(--brown);
    color: #fff
}

.action.secondary {
    background: transparent;
    color: var(--brown);
    border: 1.5px solid var(--brown)
}

.swatch:hover {
    transform: translateY(-1px);
}

#detailSwatches .swatch.active {
    outline: 2px solid rgba(0, 0, 0, .35);
    outline-offset: 2px;
}


@media (max-width:1024px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media (max-width:640px) {
    .grid {
        grid-template-columns: 1fr
    }

    .filters {
        top: 56px
    }
}