:root {
  --bg-opacity: 1.0;
}

body {
  font-family: 'Varela Round', Helvetica, sans-serif;
  min-height: 100vh;
  background-color: #fff1f8;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('/images/yarn-bg.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: var(--bg-opacity, 0.85);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.25s ease;
}

#content {
  max-width: min(1000px, 90vw);
  margin: 0 auto;
  padding-top: 84px;
}

header,
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

header.has-shadow,
header.is-scrolled,
.site-header.has-shadow,
.site-header.is-scrolled {
  background: rgba(255, 241, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: min(1000px, 90vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 10px 0;
  min-height: 64px;
  box-sizing: border-box;
}

nav {
  text-align: right;
}

header nav {
  vertical-align: middle;
  display: inline-block;
}

nav a {
  display: inline-block;
  color: #000;
  padding: 8px 16px;
  border-radius: 24px;
  text-decoration: none;
}

nav a:hover {
  color: #000;
  background: #ddd;
}

nav a.selected {
  color: #fff;
  background: #000;
}

h1 img {
  width: 70vw;
  max-width: 300px;
}

header h1,
.site-header h1 {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 1.35rem;
}

header h1 a,
.site-header h1 a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111;
}

header h1 img.icon,
.site-header h1 img.icon {
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 50%;
  margin-left: 0;
}

.header-title-text {
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-brand {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.header-brand.hidden-title {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
}

.header-brand.visible-title {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.tagline {
  text-align: center;
  font-weight: bold;
}

paypal-cart-button {
  border: 2px solid #f6b37e;
  border-radius: 6px;
}

@media (max-width: 600px) {
  #content {
    padding-top: 76px;
  }

  .header-inner {
    padding: 8px 0;
    min-height: 56px;
  }

  header h1,
  .site-header h1 {
    font-size: 1.1rem;
  }

  header h1 img.icon,
  .site-header h1 img.icon {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
  }

  header h1 a,
  .site-header h1 a {
    gap: 8px;
  }
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0;
}

.spacer {
  flex: 1;
}

.logo-large {
  text-align: center;
}

.subpage-title {
  margin-left: 8px;
}

.callout {
  font-size: 3.5rem;
  color: #444;
  margin-bottom: 48px;
  font-weight: 500;
  text-align: center;
}

a.big {
  text-decoration: none;
  color: #fff;
  background-color: #000;
  border-radius: 24px;
  padding: 8px 24px;
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 500;
}

button.primary {
  text-decoration: none;
  color: #fff;
  background-color: #000;
  border-radius: 24px;
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 12px 28px;
  box-shadow: 0 4px 4px #00000052;
}

a.primary {
  text-decoration: none;
  color: #fff;
  background-color: #000;
  border-radius: 24px;
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 12px 28px;
  box-shadow: 0 4px 4px #00000052;
}

footer {
  text-align: center;
  margin-top: 64px;
  margin-bottom: 32px;
  color: var(--wa-color-text-quiet, #666);
}

footer a {
  color: var(--wa-color-text-link, #d34817);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

footer a:hover {
  color: var(--wa-color-brand-on-normal, var(--wa-color-brand-30, #a83207));
  text-decoration: underline;
}

footer a:focus-visible {
  outline: 2px solid var(--wa-color-focus, #ff6b00);
  outline-offset: 2px;
  border-radius: 2px;
}

.product-card {
  margin-bottom: 12px;
}

.icon-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  padding: 20px;
  margin: 24px auto;
  max-width: 600px;
  flex-wrap: wrap;
}

.icon-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #333333;
  background-color: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.icon-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Brand Colors on Hover */
.icon-link.etsy:hover { color: #F16127; }
.icon-link.ravelry:hover { color: #BF3026; }
.icon-link.instagram:hover { color: #E1306C; }
.icon-link.facebook:hover { color: #1877F2; }
.icon-link.pinterest:hover { color: #E60023; }
.icon-link.lovecrafts:hover { color: #FF0066; }

.icon-link svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-link.pinterest svg,
.icon-link.facebook svg,
.icon-link.ravelry svg,
.icon-link.etsy svg {
  fill: currentColor;
  stroke: none;
}

.icon-link.etsy svg {
  width: 20px;
  height: 20px;
}

.icon-expand {
  display: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.icon-expand:hover {
  color: #111111;
}

@media (max-width: 600px) {
  .icon-row {
    gap: 12px;
    padding: 12px 0;
  }

  .icon-link {
    width: 44px;
    height: 44px;
  }

  .icon-link svg {
    width: 22px;
    height: 22px;
  }

  .icon-link.etsy svg {
    width: 18px;
    height: 18px;
  }

  /* On mobile: show first 3 icons and the expand button on one row */
  .icon-row:not(.is-expanded) .icon-link:nth-child(n+4):not(.icon-expand) {
    display: none;
  }

  .icon-row:not(.is-expanded) .icon-expand {
    display: inline-flex;
  }

  /* When expanded: reveal all icons and hide the expand button */
  .icon-row.is-expanded .icon-link:not(.icon-expand) {
    display: inline-flex;
    animation: fadeInIcon 0.25s ease forwards;
  }

  .icon-row.is-expanded .icon-expand {
    display: none !important;
  }
}

@keyframes fadeInIcon {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}