/* User-supplied wordmarks replace the tiny favicon treatment on story cards. */
#w2r-concept .w-shop-selected-count[hidden],
#w2r-concept .w-shop-visit[hidden] { display: none !important; }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo .w-shop-image { background: #fff; }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo .w-shop-logo {
  inset: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Keep the live selection count prominent and on a single line at every card width. */
#w2r-concept .w-shop-story-card .w-shop-selected-count {
  white-space: nowrap;
  line-height: 1.2;
  font-size: clamp(14px, 1.35vw, 16px);
}
/* Align the name and description across each row, including cards without finds. */
#w2r-concept .w-shop-story-card .w-shop-front-body { justify-content: flex-start; }
#w2r-concept .w-shop-story-card .w-shop-hint { margin-top: auto; }
/* On three-column rows, reserve a fixed gap above the action and pin every
   live selection count to the same baseline, regardless of description length. */
@media (min-width: 1051px) {
  #w2r-concept .w-shop-story-card .w-shop-selected-count:not([hidden]) { margin-top: auto; }
  #w2r-concept .w-shop-story-card .w-shop-front-body:has(.w-shop-selected-count:not([hidden])) .w-shop-hint { margin-top: 12px; }
}
@media (max-width: 1050px) {
  #w2r-concept .w-shop-story-card .w-shop-selected-count { font-size: 14px; }
}
@media (max-width: 619px) {
  #w2r-concept .w-shop-story-card .w-shop-selected-count { font-size: clamp(12px, 4vw, 14px); }
}

/* Give the mobile faces the same name/badge hierarchy and button layout. */
@media (max-width: 1050px) {
  #w2r-concept .w-shop-story-card .w-shop-meta,
  #w2r-concept .w-shop-story-card .w-shop-back-meta {
    align-items: flex-start;
    flex-wrap: nowrap;
    column-gap: 5px;
    white-space: normal;
  }
  #w2r-concept .w-shop-story-card .w-shop-name,
  #w2r-concept .w-shop-story-card .w-shop-back h3 {
    flex: 0 0 auto;
    min-width: min-content;
    max-width: calc(100% - 90px);
    line-height: 25px;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
  #w2r-concept .w-shop-story-card .w-shop-separator {
    flex: 0 0 auto;
    margin-top: 2.5px;
  }
  #w2r-concept .w-shop-story-card .sd-regions {
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-content: flex-start;
    min-width: 0;
    max-width: none;
    white-space: normal;
  }
  #w2r-concept .w-shop-story-card .w-shop-short-description { margin-top: 16px; }
  #w2r-concept .w-shop-story-card .w-shop-back-meta { margin-top: 22px; margin-bottom: 0; }
  #w2r-concept .w-shop-story-card .w-shop-back p { margin: 15px 0 0; }
  #w2r-concept .w-shop-story-card .w-shop-back-actions {
    display: grid;
    grid-template-rows: 44px 44px;
    align-self: stretch;
    justify-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
  }
  #w2r-concept .w-shop-story-card .w-shop-visit {
    grid-row: 1;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    text-align: center;
  }
  #w2r-concept .w-shop-story-card .w-shop-official {
    display: flex;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 1px solid #c7d8eb;
    border-radius: 12px;
    background: #e8f1fb;
    color: #17395b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
  }
  #w2r-concept .w-shop-story-card .w-shop-visit:not([hidden]) + .w-shop-official { grid-row: 2; }
  #w2r-concept .w-shop-story-card .w-shop-official:hover {
    background: #f5f9ff;
    color: #17395b;
    text-decoration: none;
  }
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo .w-shop-logo img {
  display: block;
  width: 100%;
  height: 100%;
  flex: 0 1 auto;
  object-fit: contain;
  object-position: center;
  transform: none;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo .w-shop-logo-label { display: none; }
#w2r-concept .w-shop-story-card .w-shop-logo-wordmark {
  color: #161616;
  font-family: Georgia, serif;
  font-size: clamp(28px, 2.8vw, 42px);
  letter-spacing: -.055em;
  white-space: nowrap;
}
#w2r-concept .w-shop-story-card.brand-rag-bone .w-shop-image { background: #252323; }
#w2r-concept .w-shop-story-card:is(.brand-net-a-porter,.brand-luisaviaroma) .w-shop-image { background: #000; }
#w2r-concept .w-shop-story-card.brand-tommy-hilfiger-usa .w-shop-image { background: #1d294e; }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-tommy-hilfiger-usa .w-shop-logo { inset: 10px 18px; }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.w-shop-existing-logo.brand-tommy-hilfiger-usa .w-shop-logo img {
  object-fit: contain;
  transform: scale(1.08);
}
#w2r-concept .w-shop-story-card.brand-mango-outlet-usa .w-shop-image,
#w2r-concept .w-shop-story-card.brand-mango-outlet-europe .w-shop-image { background: #fff; }
#w2r-concept .w-shop-story-card:is(.brand-mango-outlet-usa,.brand-mango-outlet-europe) .w-shop-logo {
  flex-direction: column;
}
#w2r-concept .w-shop-story-card:is(.brand-mango-outlet-usa,.brand-mango-outlet-europe) .w-shop-logo img {
  width: 100%;
  height: 116px;
  flex: 0 0 116px;
  object-fit: cover;
  object-position: center 52%;
}
#w2r-concept .w-shop-story-card .w-shop-outlet-word {
  margin-top: -18px;
  color: #f4ad88;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .28em;
  line-height: 1;
}
#w2r-concept .w-shop-story-card .w-shop-name-line { display: block; }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-longchamp .w-shop-logo img { transform: scale(1.7); }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-rag-bone .w-shop-logo { inset: 0; }
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-rag-bone .w-shop-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(4.15);
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo:is(.brand-net-a-porter,.brand-luisaviaroma) .w-shop-logo img { transform: scale(2.5); }
#w2r-concept .w-shop-story-card.brand-bestsecret .w-shop-logo img { object-fit: cover; transform: scale(2.1); }

/* Owner-supplied logos: white backgrounds fill the image area, marks stay centred. */
#w2r-concept .w-shop-story-card.w-shop-supplied-logo:is(.brand-on,.brand-hatstore,.brand-apple,.brand-ixos-official,.brand-childrensalon,.brand-childrensalon-outlet) .w-shop-image {
  background: #fff;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo:is(.brand-on,.brand-hatstore,.brand-apple,.brand-ixos-official,.brand-childrensalon) .w-shop-logo {
  inset: 10% 0;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo:is(.brand-on,.brand-hatstore,.brand-apple,.brand-ixos-official,.brand-childrensalon,.brand-childrensalon-outlet) .w-shop-logo img {
  object-fit: contain;
  object-position: center;
  transform: none;
  border-radius: 0;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-childrensalon-outlet .w-shop-logo {
  inset: 8% 5%;
  flex-direction: column;
  gap: 7px;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-childrensalon-outlet .w-shop-logo img {
  height: calc(100% - 30px);
  min-height: 0;
  flex: 1 1 auto;
}
#w2r-concept .w-shop-story-card.brand-childrensalon-outlet .w-shop-outlet-word {
  flex: 0 0 auto;
  margin: 0;
}
#w2r-concept .w-shop-story-card.w-shop-bestsecret-selection .w-shop-selected-count {
  white-space: normal;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo:is(.brand-hatstore,.brand-apple) .w-shop-front .w-shop-image .w-shop-logo img {
  object-fit: cover;
}
/* Limit the square Apple artwork's crop to its white margins at every width. */
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-apple .w-shop-front .w-shop-image .w-shop-logo img {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 2.2;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-hatstore .w-shop-logo {
  inset: 0 8%;
}
#w2r-concept .w-shop-story-card.w-shop-supplied-logo.brand-hatstore .w-shop-logo img {
  clip-path: inset(1px);
}

/* The Apple card leads to our dedicated order section, independently of Finds. */
#w2r-concept .w-shop-story-card.brand-apple .w-shop-apple-order {
  display: flex;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  box-sizing: border-box;
  border: 1px solid #f4ad88;
  border-radius: 12px;
  background: #f4ad88;
  color: #172d45;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
#w2r-concept .w-shop-story-card.brand-apple .w-shop-apple-order:hover {
  background: #f8bc9e;
  border-color: #f8bc9e;
}
#w2r-concept .w-shop-story-card.brand-apple .w-shop-official {
  grid-row: 2;
}

/* Keep the name and the first region badge on the same top line on desktop. */
@media (min-width: 1051px) {
  #w2r-concept .w-shop-story-card .w-shop-meta,
  #w2r-concept .w-shop-story-card .w-shop-back-meta {
    align-items: flex-start;
    flex-wrap: nowrap;
    white-space: normal;
  }
  #w2r-concept .w-shop-story-card .w-shop-name,
  #w2r-concept .w-shop-story-card .w-shop-back h3 {
    flex: 0 0 auto;
    min-width: min-content;
    max-width: calc(100% - 90px);
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    line-height: 28px;
  }
  #w2r-concept .w-shop-story-card .w-shop-separator { flex: 0 0 auto; margin-top: 4px; }
  #w2r-concept .w-shop-story-card .sd-regions {
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-content: flex-start;
    max-width: none;
    white-space: nowrap;
  }
  #w2r-concept .w-shop-story-card .w-shop-back { padding: 24px 23px 24px; }
  #w2r-concept .w-shop-story-card .w-shop-back-meta { margin: 34px 0 0; }
  #w2r-concept .w-shop-story-card .w-shop-back p { margin: 18px 0 0; }
  #w2r-concept .w-shop-story-card .w-shop-back-actions {
    display: grid;
    grid-template-rows: 48px 48px;
    justify-items: center;
    align-self: stretch;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
  }
  #w2r-concept .w-shop-story-card .w-shop-visit {
    grid-row: 1;
    justify-content: center;
    width: min(100%, 290px);
    min-height: 48px;
    text-align: center;
  }
  #w2r-concept .w-shop-story-card .w-shop-official {
    display: inline-flex;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    width: min(100%, 290px);
    min-height: 48px;
    padding: 9px 12px;
    box-sizing: border-box;
    border: 1px solid #c7d8eb;
    border-radius: 12px;
    background: #e8f1fb;
    color: #17395b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
  }
  #w2r-concept .w-shop-story-card .w-shop-visit + .w-shop-official {
    grid-row: 2;
  }
  #w2r-concept .w-shop-story-card .w-shop-official:hover {
    background: #f5f9ff;
    color: #17395b;
    text-decoration: none;
  }
}
