/* Polish layer: loaded last. Keeps fixes separate from the base stylesheets. */

/* Accessible focus for keyboard users (no change for mouse clicks). */
:focus-visible {
  outline: 2px solid #171916;
  outline-offset: 3px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  border-radius: 2px;
}

/* Long words (e.g. "sweatshirts.") must wrap inside their column instead of spilling past the viewport. */
.campaign,
.campaign-story,
.campaign-story > * {
  min-width: 0;
}
.campaign h1,
.page-top h1,
.catalog-title h1,
.product-buy-panel h1 {
  overflow-wrap: break-word;
}

/* Tablet and phone: one-column hero with a fluid headline that always fits the screen. */
@media (max-width: 950px) {
  .campaign {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  .campaign {
    grid-template-columns: minmax(0, 1fr);
  }
  .campaign h1 {
    font-size: clamp(2.5rem, 12vw, 3.3rem);
    line-height: 1;
    letter-spacing: -.045em;
  }
  .campaign h1 br {
    display: none;
  }
  .campaign-cta,
  .focus-actions .campaign-cta {
    min-height: 44px;
    align-items: center;
  }
  .category-rail a,
  .category-rail button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .product-buy-panel,
  .main-product-image,
  .product-detail > * {
    min-width: 0;
    max-width: 100%;
  }
}

/* Very small phones: keep the page gutter tight but never let content touch the edge. */
@media (max-width: 360px) {
  :root {
    --page: 16px;
  }
  .campaign h1 {
    font-size: 2.3rem;
  }
}

/* Mobile hero cards: keep two-line captions below the photo instead of over it. */
@media (max-width: 650px) {
  .hero-piece {
    padding-bottom: 66px;
  }
  .hero-piece > span {
    left: 5px;
    right: 5px;
    bottom: 8px;
  }
}

/* Error pages and any long code/path text must wrap on small screens. */
code,
pre,
.error-page code {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Mobile sticky add-to-bag bar on product pages. */
.mobile-buy-bar { display: none; }
@media (max-width: 650px) {
  .mobile-buy-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px var(--page) calc(10px + env(safe-area-inset-bottom));
    background: #fffdf9;
    border-top: 1px solid #ddd6ca;
    box-shadow: 0 -6px 18px rgba(23, 25, 22, .08);
  }
  .mobile-buy-bar-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
  }
  .mobile-buy-bar-copy strong {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-buy-bar-copy span {
    font-size: 12px;
    color: #5b5f57;
  }
  .mobile-buy-bar .button {
    min-height: 46px;
    padding: 10px 18px;
    font-size: 13px;
    flex: none;
  }
  body:has(.mobile-buy-bar) {
    padding-bottom: 84px;
  }
}

/* Size guide button (product page and product cards). */
.size-guide-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid #171916;
  border-radius: 999px;
  background: #fff;
  color: #171916;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.size-guide-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.size-guide-button:hover,
.size-guide-button:focus-visible {
  background: #171916;
  color: #fff;
}
.size-info {
  flex-wrap: wrap;
  gap: 10px 14px;
}
.size-info .size-guide-button {
  margin-left: auto;
}
.card-size-guide {
  margin-top: 10px;
  min-height: 34px;
  font-size: 12px;
  padding: 6px 12px;
}

/* Size guide popup. */
.size-guide-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 26px 28px 28px;
  border: 0;
  border-radius: 6px;
  background: #fffdf9;
  color: #171916;
  box-shadow: 0 24px 60px rgba(23, 25, 22, .28);
}
.size-guide-dialog::backdrop {
  background: rgba(23, 25, 22, .55);
}
.size-guide-dialog[open] {
  animation: size-guide-in .22s ease-out;
}
@keyframes size-guide-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.size-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.size-guide-head h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}
.size-guide-head .icon-button {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dedfd9;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.size-guide-head .icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.size-guide-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
}
.size-guide-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.size-guide-steps li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 40px;
  position: relative;
  counter-increment: step;
}
.size-guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #171916;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.size-guide-steps strong {
  font-size: 16px;
}
.size-guide-steps span {
  font-size: 14px;
  line-height: 1.5;
  color: #4d514a;
}
.size-guide-foot {
  margin: 22px 0 0;
  font-size: 14px;
  color: #4d514a;
}
.size-guide-foot a {
  color: #171916;
  text-underline-offset: 3px;
}
@media (max-width: 560px) {
  .size-guide-dialog {
    padding: 20px 18px 22px;
  }
  .size-guide-head h2 {
    font-size: 26px;
  }
  .size-guide-steps {
    grid-template-columns: 1fr;
  }
}
