/* ========== Pages: samples ==========
   samples (/samples): the $10 sample kit (printed catalog + 4 door samples) and its request form
   (js/samples.js). Loaded only by samples.html, after brand.css. Every selector is scoped under
   the page body class, and the form reuses the site's own parts: .form-group, .form-control,
   .form-error, .form-check, .order-gate-choice / .order-gate-option, .hp-field, .feature,
   .spec-list, .faq-list, .callout. Nothing here changes another page. */

/* the header button for this page carries .active (aria-current="page"): no underline bar
   under a filled button (main.css draws one under every .active nav link) */
.pg-samples nav ul.nav-menu li a.btn-primary.active::after { content: none; }

/* breadcrumbs open the centred hero text, one step above the running head (as /pricing) */
.pg-samples .page-hero .breadcrumbs ol { justify-content: center; margin: 0 0 20px 0; }

/* ---------- What is in the kit: one centred specification column ---------- */
.pg-samples .samples-kit { max-width: 60em; margin: 0 auto; }

.pg-samples .samples-kit dd a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.pg-samples .samples-kit dd a:hover { color: var(--text-body); }

.pg-samples .samples-kit-note {
    max-width: 60rem;                  /* the list's 60em at 16px: the note starts under the list's left edge */
    margin: 16px auto 0 auto;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-body);
}

/* ---------- How it works: three white cards (an ordered list) ---------- */
.pg-samples .samples-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
}

.pg-samples .samples-steps > li { margin: 0; }

@media (max-width: 1024px) {
    .pg-samples .samples-steps { grid-template-columns: minmax(0, 1fr); max-width: 40em; margin: 0 auto; gap: 20px; }
}

/* ---------- The form: a white card with a hairline edge (the site's form card) ---------- */
.pg-samples .samples-fallback { margin: 40px auto 0 auto; }

.pg-samples .samples-fallback[hidden],
.pg-samples .samples-card[hidden],
.pg-samples .samples-form[hidden],
.pg-samples .samples-done[hidden],
.pg-samples .samples-billing[hidden],
.pg-samples .samples-error[hidden] { display: none; }

.pg-samples .samples-card {
    max-width: 52em;
    margin: 0 auto;
    padding: 40px;
    background: var(--paper);
    border: 1px solid var(--hair);
    text-align: left;
}

.pg-samples .samples-group {
    min-width: 0;
    margin: 0 0 40px 0;
    padding: 0;
    border: 0;
}

/* a group title reads as the card's own subhead: caps on an Ink rule */
.pg-samples .samples-group-title {
    display: block;
    width: 100%;
    padding: 12px 0 0 0;
    margin: 0 0 20px 0;
    border-top: var(--rule-major);
    font-weight: 600;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
}

.pg-samples .samples-group-note { margin: -8px 0 20px 0; max-width: none; }

.pg-samples .samples-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
}

/* city, state and ZIP on one row from 1024 px ("District of Columbia" shows whole in the state select);
   below that the city takes its own row (see the media queries at the end) */
.pg-samples .samples-grid-addr { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr); }

.pg-samples .samples-form .form-group { margin: 0 0 20px 0; }

/* a Rust frame always comes with its message: samples.js marks a wrong field (aria-invalid). The
   browser's own :user-invalid frame (brand.css) is held back here, as it also frames the billing
   fields the moment they appear after an earlier submit, with no message under them */
.pg-samples .samples-form .form-control:user-invalid:not([aria-invalid="true"]) { border: 1px solid #8C8C8C; padding: 13px 14px; }

.pg-samples .samples-form select.form-control:user-invalid:not([aria-invalid="true"]) { padding-right: 44px; }

/* a select still on its placeholder keeps 16px (brand.css makes it 14px), so iOS does not zoom the page
   when a select (cabinets, timeline, state) is tapped; the grey placeholder colour stays */
.pg-samples .samples-form select.form-control:invalid { font-size: 16px; }

.pg-samples .samples-form textarea.form-control { min-height: 96px; }

/* ---------- The kit picker (samples.js): a tray of 4 slots over 6 style cards, then 4 materials ----------
   The tray stays under the sticky header while the visitor scrolls the cards, so every tap shows
   where it went. A missing sample frames the tray in Rust, with one message under it. */
.pg-samples .kit-tray {
    position: sticky;
    top: 80px;                          /* the header's height (70px on tablets and phones) */
    z-index: 5;
    margin: 0 0 16px 0;
    padding: 14px 16px 12px 16px;
    background: var(--paper);
    border: 1px solid var(--hair);
}

.pg-samples .kit-tray:focus { outline: none; }

.pg-samples .kit-tray:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.pg-samples .kit-tray[aria-invalid="true"] { border: 2px solid var(--rust); padding: 13px 15px 11px 15px; }

.pg-samples .kit-tray .form-error { display: block; margin: 8px 0 0 0; }

.pg-samples .kit-tray.is-nudged { animation: kit-nudge 0.4s ease; }

.pg-samples .kit-tray-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    max-width: none;
    margin: 0 0 10px 0;
    font-size: 13px;
    line-height: 1.4;
}

.pg-samples .kit-tray-label {
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
}

.pg-samples .kit-count { color: var(--text-body); text-align: right; }

.pg-samples .kit-tray.is-ready .kit-count { color: var(--ink); font-weight: 600; }

.pg-samples .kit-full-note {
    max-width: none;
    margin: 8px 0 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink);
}

.pg-samples .kit-full-note[hidden] { display: none; }

.pg-samples .kit-slots {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.pg-samples .kit-slot { position: relative; min-width: 0; margin: 0; }

.pg-samples .kit-slot-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 92px;
    overflow: hidden;
    background: var(--band);
    border: 1px solid var(--hair);
}

.pg-samples .kit-slot.is-empty .kit-slot-box { background: var(--paper); border: 1px dashed #B5B5B5; }

.pg-samples .kit-slot-num { font-size: 20px; font-weight: 500; color: #767676; }

.pg-samples .kit-slot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.2);              /* the door's middle, with the frame at its sides */
}

.pg-samples .kit-slot.is-new .kit-slot-box { animation: kit-pop 0.32s 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) both; }

.pg-samples .kit-slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    border-radius: 50%;
    font: 400 18px/1 var(--font-text);
    cursor: pointer;
}

.pg-samples .kit-slot-remove:hover { background: #444; }

.pg-samples .kit-slot-remove:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.pg-samples .kit-slot-name {
    display: block;
    margin: 6px 0 0 0;
    font-size: 12px;
    line-height: 1.3;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-samples .kit-slot.is-empty .kit-slot-name { color: var(--text-soft); }

.pg-samples .kit-slot-short { display: none; }

/* the 6 style cards, front view: Shaker frames on one row, Slab and the finger pulls on the next */
.pg-samples .kit-styles {
    list-style: none;
    margin: 0 0 32px 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pg-samples .kit-styles > li { margin: 0; min-width: 0; }

.pg-samples .kit-style {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    background: var(--paper);
    border: 1px solid var(--hair);
    border-radius: 0;
    font: inherit;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}


.pg-samples .kit-style:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.pg-samples .kit-style.is-picked { border-color: var(--ink); }

/* picked or checked: a second 1px Ink line inside the border (brand.css allows no box-shadow) */
.pg-samples .kit-style.is-picked::after,
.pg-samples .kit-material.is-checked::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--ink);
    pointer-events: none;
}

.pg-samples .kit-style:active { transform: scale(0.98); }

.pg-samples .kit-style-media {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #FFFFFF;
}

.pg-samples .kit-style-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.18);
    transition: transform 0.5s ease;
}


.pg-samples .kit-style-text {
    display: block;
    flex: 1 1 auto;
    padding: 10px 12px 12px 12px;
    border-top: 1px solid var(--hair);
}

.pg-samples .kit-style-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.pg-samples .kit-style-desc {
    display: block;
    margin: 4px 0 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-body);
}

/* + on a card not yet in the kit; the count once it is */
.pg-samples .kit-style-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 15px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
}

.pg-samples .kit-style.is-picked .kit-style-badge { background: var(--ink); color: var(--paper); }

.pg-samples .kit-styles.is-full .kit-style:not(.is-picked) { opacity: 0.5; }

.pg-samples .kit-styles.is-full .kit-style:not(.is-picked) .kit-style-badge { visibility: hidden; }

/* the preferred materials: 5 checkbox cards, one or more (the order gate's pattern: samples.js keeps
   .is-checked in step with the boxes; :has() does the same where it is supported) */
.pg-samples .kit-materials { min-width: 0; margin: 0 0 24px 0; padding: 0; border: 0; }

.pg-samples .kit-materials-title {
    display: block;
    padding: 0;
    margin: 0 0 6px 0;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
}

.pg-samples .kit-materials-note { margin: 0 0 12px 0; max-width: none; }

.pg-samples .kit-material-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.pg-samples .kit-material-list > li { margin: 0; min-width: 0; }

.pg-samples .kit-material {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--paper);
    border: 1px solid var(--hair);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* the box itself is kept for keyboards and screen readers; the card shows its state */
.pg-samples .kit-material input {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}


.pg-samples .kit-material:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

@supports not selector(:has(*)) {
    .pg-samples .kit-material:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
}

.pg-samples .kit-material.is-checked { border-color: var(--ink); }

.pg-samples .kit-material-media {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--band);
}

.pg-samples .kit-material-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pg-samples .kit-material-text {
    display: block;
    flex: 1 1 auto;
    padding: 10px 12px 12px 12px;
    border-top: 1px solid var(--hair);
}

.pg-samples .kit-material-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.pg-samples .kit-material-desc {
    display: block;
    margin: 4px 0 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-body);
}

/* an empty square; Ink with a tick once picked */
.pg-samples .kit-material-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    border: 1px solid var(--ink);
    pointer-events: none;
}

.pg-samples .kit-material.is-checked .kit-material-check,
.pg-samples .kit-material:has(input:checked) .kit-material-check { background: var(--ink); }

.pg-samples .kit-material.is-checked .kit-material-check::after,
.pg-samples .kit-material:has(input:checked) .kit-material-check::after {
    content: '';
    width: 7px;
    height: 13px;
    border: solid var(--paper);
    border-width: 0 2px 2px 0;
    transform: translateY(-2px) rotate(45deg);
}

.pg-samples .kit-materials[aria-invalid="true"] .kit-material:not(.is-checked) { border-color: var(--rust); }

.pg-samples .kit-material-list + .form-error { display: block; margin: 8px 0 0 0; }

.pg-samples .kit-material-note {
    max-width: none;
    margin: 10px 0 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink);
}

.pg-samples .kit-material-note[hidden] { display: none; }

/* the photo on its way to the tray */
.kit-ghost {
    position: fixed;
    z-index: 990;                       /* under the sticky header (1000) */
    margin: 0;
    object-fit: cover;
    pointer-events: none;
    transform-origin: center center;
}

@keyframes kit-pop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes kit-nudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@media (max-width: 768px) {
    .pg-samples .kit-tray { top: 70px; }
    .pg-samples .kit-material-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .pg-samples .kit-tray { padding: 10px 10px 8px 10px; margin-left: -10px; margin-right: -10px; }
    .pg-samples .kit-tray[aria-invalid="true"] { padding: 9px 9px 7px 9px; }
    .pg-samples .kit-slots { gap: 8px; }
    .pg-samples .kit-slot-box { height: 64px; }
    .pg-samples .kit-slot-name { font-size: 11px; margin-top: 4px; }
    .pg-samples .kit-slot-long { display: none; }
    .pg-samples .kit-slot-short { display: inline; }
    .pg-samples .kit-slot-remove { width: 24px; height: 24px; top: 3px; right: 3px; font-size: 16px; }
    .pg-samples .kit-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .pg-samples .kit-style-text { padding: 8px 10px 10px 10px; }
    .pg-samples .kit-material-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .pg-samples .kit-material-text { padding: 8px 10px 10px 10px; }
}

/* a card reached by keyboard scrolls clear of the stuck tray (this adds to the header's scroll padding) */
.pg-samples .kit-style { scroll-margin-top: 200px; }

@media (hover: hover) {
    .pg-samples .kit-style:hover { border-color: var(--ink); }
    .pg-samples .kit-style:hover .kit-style-media img { transform: scale(1.26); }
    .pg-samples .kit-material:hover { border-color: var(--ink); }
}

@media (max-width: 600px) {
    .pg-samples .kit-style { scroll-margin-top: 160px; }
}

/* short screens (a phone on its side, a zoomed window): header + a stuck tray would leave almost no
   room for the cards, so the tray stays in place; the card badges still show every pick */
@media (max-height: 560px) {
    .pg-samples .kit-tray { position: static; }
}

@media (prefers-reduced-motion: reduce) {
    .pg-samples .kit-style,
    .pg-samples .kit-style-media img,
    .pg-samples .kit-material { transition: none; }
    .pg-samples .kit-style:hover .kit-style-media img { transform: scale(1.18); }
    .pg-samples .kit-style:active { transform: none; }
}

/* the long part of the color label reads as a note, not as caps */
.pg-samples .samples-label-note {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-body);
}

.pg-samples .samples-field-note {
    margin: 8px 0 0 0;
    max-width: none;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-body);
}

.pg-samples .samples-choice { margin: 0 0 20px 0; }

.pg-samples .samples-same { margin: 0 0 20px 0; font-size: 16px; }

.pg-samples .samples-billing { padding: 4px 0 0 0; }

/* ---------- Submit ---------- */
.pg-samples .samples-group:last-of-type { margin-bottom: 32px; }

.pg-samples .samples-summary {
    max-width: none;
    margin: 0 0 16px 0;
    padding: 12px 0 0 0;
    border-top: var(--rule-major);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
}

.pg-samples .samples-submit { display: block; width: 100%; cursor: pointer; }

.pg-samples .samples-submit:disabled { opacity: 0.6; cursor: wait; }

.pg-samples .samples-error {
    max-width: none;
    margin: 12px 0 0 0;
    padding: 12px;
    border: 2px solid var(--rust);
    font-size: 13px;
    line-height: 1.5;
    color: var(--rust);
}

.pg-samples .samples-error a { color: inherit; text-decoration: underline; }

/* ---------- Request only: the thank-you in place of the form ---------- */
.pg-samples .samples-done-title {
    font-weight: 600;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 16px 0;
}

.pg-samples .samples-done-title:focus { outline: none; }

.pg-samples .samples-done-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.pg-samples .samples-done-text {
    max-width: none;
    margin: 0 0 12px 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
}

.pg-samples .samples-done-text:last-child { margin-bottom: 0; }

/* ---------- The trademark note closes the page content, on a hairline (as /pricing) ---------- */
.pg-samples .ikea-tm { padding: 0 0 80px 0; }

.pg-samples .ikea-tm .mono-note {
    max-width: 48em;
    margin: 0 auto;
    padding: 16px 0 0 0;
    border-top: 1px solid var(--hair);
}

/* ---------- Tablets: the city on its own row, state beside ZIP ---------- */
@media (max-width: 1023px) {
    .pg-samples .samples-grid-addr { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
    .pg-samples .samples-grid-addr .samples-city { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .pg-samples .ikea-tm { padding-bottom: 56px; }
}

/* ---------- Phones: one column, and the form takes the full text width (no card frame), so the kit
   tray (which reaches 10px into the gutter), the 2-column cards and the address fields get the whole
   width from 320 px ---------- */
@media (max-width: 600px) {
    .pg-samples .samples-card { padding: 0; border: 0; background: transparent; }
    .pg-samples .samples-grid,
    .pg-samples .samples-grid-addr { grid-template-columns: minmax(0, 1fr); }
    .pg-samples .samples-form select.form-control,
    .pg-samples .samples-form select.form-control:user-invalid:not([aria-invalid="true"]) { padding-right: 36px; background-position: right 14px center; }
    .pg-samples .samples-group { margin-bottom: 32px; }
}
