body:has(.search-layout) {
  --storefront-page-background: #f6f7f8;
}

.search-results .product-card-discount,
.search-preview-results .product-card-discount {
  color: var(--storefront-danger-emphasis);
}

.product-card-fields {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  pointer-events: none;
}

.product-grid article[data-product-card] {
  position: relative;
}

.product-grid article[data-product-card] h2 {
  text-align: center;
}

article > .product-card-fields {
  top: 1rem;
  right: 1rem;
  left: 1rem;
}

.product-card-fields a {
  pointer-events: auto;
  text-decoration: none;
}

.product-card-badge {
  border-radius: var(--radius-sm);
  background: var(--storefront-primary-subtle);
  color: var(--storefront-primary);
  padding: 0.25rem 0.50rem;
  font-size: calc(12px + var(--font-bump));
  line-height: 1.35;
  text-transform: capitalize;
}

.product-card-badge[data-product-card-field-text="sale"] {
  background: #fff4cc;
  color: #806000;
}

.product-card-badge[data-product-card-field-visible="virtual-try-on"] {
  background: #f1f4f4;
  color: var(--storefront-text-strong);
  text-transform: none;
}

.product-card-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.6rem;
  flex-wrap: wrap;
}

.product-card-footer {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.product-grid article .product-card-footer > .product-card-pricing {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  flex: 0 0 auto;
  gap: 2px 0.45rem;
  white-space: nowrap;
}

.product-card-footer .product-card-discount {
  grid-column: 1 / -1;
}

.product-card-footer .product-card-swatches {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
  min-width: 0;
  gap: 8px;
  margin: -4px 0;
  padding: 4px;
  overflow-x: auto;
}

.product-card-shipping {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  order: 1;
  margin-left: auto;
  border-radius: var(--radius-sm);
  background: var(--storefront-primary-subtle);
  color: var(--storefront-text-strong);
  padding: 0.25rem 0.40rem;
  font-size: calc(14px + var(--font-bump));
  line-height: 1;
  pointer-events: auto;
}

.product-card-age-group {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 0.45rem;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--storefront-primary);
  padding: 0.25rem 0.40rem;
  font-size: calc(14px + var(--font-bump));
  font-weight: bold;
  line-height: 1.35;
}

.product-card-age-group[hidden] {
  display: flex;
  visibility: hidden;
}

.product-card-shipping i,
.product-card-age-group i {
  font-size: 1.1em;
}

.dfo-pd-tool {
  margin: 0 0 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--storefront-border);
  border-radius: var(--radius-sm);
  background: var(--storefront-surface);
  text-align: center;
}

.dfo-pd-tool-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: #4ab2f1;
}

.dfo-pd-tool-result {
  margin: 1rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.dfo-pd-tool-result:empty {
  display: none;
}

.dfo-pd-tool-consent {
  margin: 1rem 0 0;
  font-size: calc(12px + var(--font-bump));
  color: var(--storefront-text-muted, var(--storefront-text));
}

@media (max-width: 640px) {
  .search-results .product-grid,
  .product-merchandising .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  article > .product-card-fields {
    top: 10px;
    right: 10px;
    left: 10px;
    flex-wrap: wrap;
  }

  .product-card-badge {
    font-size: 9px;
    padding: 3px 5px;
  }

  .product-card-age-group {
    font-size: 10px;
  }
}

.header-badge-shopper-approved {
  display: none;
  flex: 0 0 auto;
}

.header-badge-shopper-approved img {
  display: block;
  height: 48px;
  width: auto;
  border-radius: 4px;
}

@media (min-width: 1024px) {
  .header-badge-shopper-approved {
    display: block;
  }
}

/* Checkout SMS opt-in: the consent text and status line up under the checkbox label. */
.checkout-sms-optin .checkout-hint {
  margin: 0 0 6px 30px;
  font-size: calc(12px + var(--font-bump));
}

.checkout-sms-status {
  font-weight: 600;
  color: var(--storefront-text);
}

.checkout-sms-status.is-error {
  color: var(--storefront-danger-emphasis);
}

/* Contact lens prescription: how it reaches us, on the product page and after checkout. */
.cl-rx-heading {
  margin: 20px 0 0;
  font-size: calc(16px + var(--font-bump));
  font-weight: 700;
  line-height: 1.4;
  color: var(--storefront-heading);
}

.cl-rx {
  margin: 8px 0 0;
}

.cl-rx-options {
  display: grid;
  gap: 8px;
}

.cl-rx-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--storefront-border);
  border-radius: var(--radius);
  background: var(--storefront-surface);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.cl-rx-option:hover {
  border-color: color-mix(in srgb, var(--storefront-primary) 45%, var(--storefront-border));
}

.cl-rx-option:has(input:checked) {
  border-color: var(--storefront-primary);
  box-shadow: 0 0 0 1px var(--storefront-primary);
  background: var(--storefront-primary-subtle);
}

.cl-rx-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--storefront-primary);
}

.cl-rx-option:has(input[aria-invalid="true"]),
.cl-rx-options:has(input[aria-invalid="true"]) .cl-rx-option {
  border-color: var(--storefront-danger);
}

.cl-rx-option-icon {
  width: 22px;
  font-size: calc(18px + var(--font-bump));
  text-align: center;
  color: var(--storefront-primary);
}

.cl-rx-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cl-rx-option-title {
  font-size: calc(14px + var(--font-bump));
  font-weight: 700;
  line-height: 1.3;
  color: var(--storefront-heading);
}

.cl-rx-option-text {
  font-size: calc(13px + var(--font-bump));
  line-height: 1.4;
  color: var(--storefront-text-muted);
  text-align: left;
}

.cl-rx-panel {
  margin: 12px 0 0;
}

.cl-rx-panel[hidden] {
  display: none;
}

.cl-rx-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 12px 16px;
  border: 1px dashed color-mix(in srgb, var(--storefront-primary) 55%, var(--storefront-border));
  border-radius: var(--radius);
  background: var(--storefront-background-subtle);
  font-size: calc(14px + var(--font-bump));
  font-weight: 600;
  color: var(--storefront-heading);
  cursor: pointer;
}

.cl-rx-file i {
  font-size: calc(20px + var(--font-bump));
  color: var(--storefront-primary);
}

.cl-rx-file:focus-within,
.cl-rx-file:has(input[aria-invalid="true"]) {
  outline: 2px solid var(--storefront-primary);
  outline-offset: 2px;
}

.cl-rx-file:has(input[aria-invalid="true"]) {
  outline-color: var(--storefront-danger);
}

.cl-rx-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cl-rx-file-status {
  margin: 8px 0 0;
  font-size: calc(14px + var(--font-bump));
  font-weight: 600;
  color: var(--storefront-heading);
  overflow-wrap: anywhere;
}

.cl-rx-file-status:empty {
  display: none;
}

.cl-rx-file-status.is-error {
  color: var(--storefront-danger);
}

.cl-rx-file-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: calc(14px + var(--font-bump));
  font-weight: 600;
  color: var(--storefront-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cl-rx-file-remove[hidden] {
  display: none;
}

.cl-rx-fine {
  margin: 0 0 10px;
  font-size: calc(13px + var(--font-bump));
  font-style: italic;
  color: var(--storefront-text-muted);
}

.cl-rx-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.cl-rx-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: calc(14px + var(--font-bump));
  font-weight: 600;
  color: var(--storefront-heading);
}

.cl-rx-field input {
  width: 100%;
  height: 44px;
  margin: 0;
  font-size: calc(15px + var(--font-bump));
  font-weight: 400;
}

/* The storefront's base form rules leave date inputs out. */
.cl-rx-field input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--storefront-border);
  border-radius: var(--radius-sm);
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  color: var(--storefront-heading);
  background: var(--storefront-surface);
}

.cl-rx-field input[aria-invalid="true"] {
  border-color: var(--storefront-danger);
  box-shadow: 0 0 0 1px var(--storefront-danger);
}

.cl-rx-optional {
  font-weight: 400;
  color: var(--storefront-text-muted);
}

.cl-rx-later {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--storefront-warning-subtle);
  font-size: calc(14px + var(--font-bump));
  line-height: 1.5;
  color: var(--storefront-text-strong);
}

.cl-rx-later i {
  margin-top: 3px;
  color: var(--storefront-warning);
}

.cl-rx-page .page-body {
  max-width: 720px;
}

.cl-rx-page p {
  text-align: left;
}

.cl-rx-intro {
  margin: 0 0 12px;
  font-size: calc(15px + var(--font-bump));
  line-height: 1.55;
}

.page-body .cl-rx-lines {
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid var(--storefront-border);
  border-radius: var(--radius);
  list-style: none;
}

.cl-rx-lines li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0;
  padding: 10px 14px;
}

.cl-rx-lines li + li {
  border-top: 1px solid var(--storefront-border-soft);
}

.cl-rx-line-name {
  font-weight: 700;
  color: var(--storefront-heading);
}

.cl-rx-line-meta {
  color: var(--storefront-text-muted);
}

.cl-rx-errors {
  margin: 16px 0 0;
}

.cl-rx-actions {
  margin: 20px 0 0;
}

@media (max-width: 640px) {
  .cl-rx-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
