/**
 * CartFlows Showcase - V3 listing.
 *
 * Ported from the showcase mockup. Everything is scoped under .cfsv3 so the
 * listing can sit on a page next to the older showcase markup without either
 * one restyling the other.
 */

.cfsv3 {
  --cfsv3-ink: #1a1a2e;
  --cfsv3-body: #5b5f73;
  --cfsv3-line: #ece5df;
  --cfsv3-cream: #fdefe8;
  --cfsv3-cream-2: #fff8f4;
  --cfsv3-orange: #f16334;
  --cfsv3-orange-dark: #d6501f;
  --cfsv3-orange-tint: #fde7dd;
  --cfsv3-radius: 14px;
  --cfsv3-shadow: 0 2px 6px rgba(26, 26, 46, 0.06);
  --cfsv3-shadow-lg: 0 18px 40px rgba(26, 26, 46, 0.14);
  --cfsv3-columns: 3;

  color: var(--cfsv3-body);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cfsv3 *,
.cfsv3 *::before,
.cfsv3 *::after {
  box-sizing: border-box;
}

/* Themes style bare buttons, and those styles reach in here.
 *
 * Astra gives every button a percentage margin, which pulls the pagination row
 * apart across the container, and a brand coloured background on :hover and
 * :focus, which turned the category pills blue. Its hover selector outweighs a
 * single class, so every button below has to state its own background for both
 * states rather than only saying what changes. */
.cfsv3 button {
  margin: 0;
}

.cfsv3 .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.cfsv3-notice {
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  font-size: 15px;
}

/* ---------- Search ---------- */

.cfsv3-search {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--cfsv3-line);
  border-radius: var(--cfsv3-radius);
  padding: 6px;
  box-shadow: var(--cfsv3-shadow);
}

.cfsv3-search-icon {
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: #a7abb8;
}

.cfsv3 input.cfsv3-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  box-shadow: none;
  background: none;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  padding: 12px 6px 12px 16px;
  color: var(--cfsv3-ink);
}

.cfsv3 input.cfsv3-search-input:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

.cfsv3 .cfsv3-search-input::placeholder {
  color: #a7abb8;
  opacity: 1;
}

.cfsv3-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.cfsv3-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--cfsv3-cream);
  color: var(--cfsv3-orange-dark);
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}

.cfsv3-filter-toggle:hover,
.cfsv3-filter-toggle:focus {
  background: var(--cfsv3-cream);
  color: var(--cfsv3-orange-dark);
}

.cfsv3-filter-toggle[aria-expanded="true"],
.cfsv3-filter-toggle[aria-expanded="true"]:hover,
.cfsv3-filter-toggle[aria-expanded="true"]:focus {
  background: var(--cfsv3-orange);
  color: #fff;
}

/* ---------- Category pills ---------- */

.cfsv3-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 22px 0 4px;
  scrollbar-width: none;
}

.cfsv3-categories::-webkit-scrollbar {
  display: none;
}

.cfsv3-pill {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--cfsv3-line);
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--cfsv3-body);
  white-space: nowrap;
  cursor: pointer;
  /* Restated so the pill measures the same whichever element carries it: a
     theme's link styling would otherwise underline it and stretch the row. */
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

/* Only the border and the text change on hover. The background is restated
   because the theme's button:hover would otherwise fill the pill. */
.cfsv3-pill:hover,
.cfsv3-pill:focus {
  background: #fff;
  border-color: var(--cfsv3-orange);
  color: var(--cfsv3-ink);
}

.cfsv3-pill.is-active,
.cfsv3-pill.is-active:hover,
.cfsv3-pill.is-active:focus {
  background: var(--cfsv3-ink);
  border-color: var(--cfsv3-ink);
  color: #fff;
}

/* ---------- Layout ---------- */

.cfsv3-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: flex-start;
  padding-top: 36px;
}

.cfsv3-results {
  min-width: 0;
}

/* ---------- Sidebar ---------- */

.cfsv3-sidebar {
  position: sticky;
  top: 32px;
  border: 1px solid var(--cfsv3-line);
  border-radius: var(--cfsv3-radius);
  padding: 22px;
}

.cfsv3-group {
  margin-bottom: 26px;
}

.cfsv3-group:last-child {
  margin-bottom: 0;
}

.cfsv3 .cfsv3-group-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cfsv3-body);
  margin: 0 0 14px;
  line-height: 1.3;
}

.cfsv3 .cfsv3-group-title label {
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.cfsv3-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 14px;
  color: var(--cfsv3-ink);
  cursor: pointer;
}

.cfsv3 .cfsv3-radio input {
  accent-color: var(--cfsv3-orange);
  width: 15px;
  height: 15px;
  margin: 0;
  flex-shrink: 0;
}

.cfsv3 select.cfsv3-sort {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--cfsv3-line);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--cfsv3-ink);
  background: #fff;
  height: auto;
}

/* ---------- Grid ---------- */

.cfsv3-grid {
  display: grid;
  grid-template-columns: repeat(var(--cfsv3-columns), minmax(0, 1fr));
  gap: 26px;
}

.cfsv3-grid:empty {
  display: none;
}

/* ---------- Card ---------- */

.cfsv3-card {
  border: 1px solid var(--cfsv3-line);
  border-radius: var(--cfsv3-radius);
  overflow: hidden;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.cfsv3-card[hidden] {
  display: none;
}

.cfsv3-card:hover {
  box-shadow: var(--cfsv3-shadow-lg);
  transform: translateY(-3px);
}

.cfsv3-frame {
  background: #edebe7;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.cfsv3-chrome {
  height: 22px;
  background: #f4f2ef;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-bottom: 1px solid #e4e1dc;
}

.cfsv3-chrome span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d7d3cc;
}

.cfsv3-shot-wrap {
  height: calc(100% - 22px);
  width: 100%;
  position: relative;
}

.cfsv3 img.cfsv3-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: opacity 0.2s;
}

.cfsv3-card:hover .cfsv3-shot {
  opacity: 0;
}

.cfsv3-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  z-index: 3;
}

.cfsv3-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* is-paid covers whatever the paid tier is called; is-pro is the old name. */
.cfsv3-badge.is-paid,
.cfsv3-badge.is-pro {
  background: var(--cfsv3-orange);
  color: #fff;
  text-transform: uppercase;
}

/*
 * Draft, pending, scheduled, private - a template only somebody who can edit
 * one ever sees. Ink rather than the brand orange, because it is not a claim
 * about the template, it is a note that this card is not live yet, and it
 * should not read as a second tier badge sitting next to PRO.
 */
.cfsv3-badge.is-state {
  background: var(--cfsv3-ink);
  color: #fff;
  text-transform: uppercase;
  opacity: 0.92;
}

/* Funnel filmstrip revealed on hover - the signature element. */

.cfsv3-flow-strip {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  pointer-events: none;
}

.cfsv3-card:hover .cfsv3-flow-strip {
  opacity: 1;
  transform: translateY(0);
}

.cfsv3-flow-step {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cfsv3-flow-box {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--cfsv3-line);
  background: #f6f4f1;
}

.cfsv3 .cfsv3-flow-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Two lines are reserved whether or not the label needs them, so a step named
   "Thank You" does not shunt its own thumbnail out of line with the rest. */
.cfsv3-flow-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--cfsv3-body);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.3;
  min-height: 2.6em;
}

.cfsv3-flow-arrow {
  color: #c9c5bf;
  font-size: 13px;
  padding: 0 3px;
  flex-shrink: 0;
  margin-bottom: 16px;
}

.cfsv3-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cfsv3 .cfsv3-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--cfsv3-ink);
  margin: 0 0 6px;
  line-height: 1.35;
}

.cfsv3-card-cat {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cfsv3-orange-dark);
  background: var(--cfsv3-orange-tint);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.cfsv3 .cfsv3-card-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cfsv3-body);
  margin: 8px 0 0;
  min-height: 38px;
}

/* Pin the buttons to the bottom so cards in a row line up, and keep the
   mockup's breathing room under the description whether or not there is one. */
.cfsv3-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.cfsv3 a.cfsv3-btn {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}

.cfsv3 .cfsv3-btn-outline {
  border: 1.5px solid var(--cfsv3-line);
  color: var(--cfsv3-ink);
  background: #fff;
}

.cfsv3 .cfsv3-btn-outline:hover {
  border-color: var(--cfsv3-ink);
  color: var(--cfsv3-ink);
}

.cfsv3 .cfsv3-btn-solid {
  border: 1.5px solid var(--cfsv3-orange);
  color: #fff;
  background: var(--cfsv3-orange);
}

.cfsv3 .cfsv3-btn-solid:hover {
  background: var(--cfsv3-orange-dark);
  border-color: var(--cfsv3-orange-dark);
  color: #fff;
}

/* ---------- Result announcement, for screen readers only ---------- */

/*
 * Off screen rather than display:none or visibility:hidden, either of which
 * would take it out of the accessibility tree and stop it being announced at
 * all - which is the only thing it is here to do.
 */
.cfsv3-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Suggestions, shown in place of an empty grid ---------- */

.cfsv3-fallback[hidden] {
  display: none;
}

.cfsv3-fallback-grid {
  display: grid;
  grid-template-columns: repeat(var(--cfsv3-columns), minmax(0, 1fr));
  gap: 26px;
}

/* ---------- Pagination ---------- */

.cfsv3-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 44px;
}

.cfsv3-pagination:empty {
  display: none;
}

.cfsv3 .cfsv3-page {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
  border: 1.5px solid var(--cfsv3-line);
  background: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--cfsv3-body);
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.cfsv3 .cfsv3-page:hover:not([disabled]):not(.is-active),
.cfsv3 .cfsv3-page:focus:not([disabled]):not(.is-active) {
  background: #fff;
  border-color: var(--cfsv3-orange);
  color: var(--cfsv3-ink);
}

.cfsv3 .cfsv3-page[disabled]:hover,
.cfsv3 .cfsv3-page[disabled]:focus {
  background: #fff;
  color: var(--cfsv3-body);
}

.cfsv3 .cfsv3-page.is-active,
.cfsv3 .cfsv3-page.is-active:hover,
.cfsv3 .cfsv3-page.is-active:focus {
  background: var(--cfsv3-ink);
  border-color: var(--cfsv3-ink);
  color: #fff;
}

.cfsv3 .cfsv3-page.is-wide {
  width: auto;
  padding: 0 16px;
}

.cfsv3 .cfsv3-page[disabled] {
  opacity: 0.45;
  cursor: default;
}

.cfsv3 .cfsv3-page.is-gap,
.cfsv3 .cfsv3-page.is-gap:hover,
.cfsv3 .cfsv3-page.is-gap:focus {
  border-color: transparent;
  background: none;
  cursor: default;
}

/* ---------- Breakpoints follow the mockup ---------- */

@media (max-width: 960px) {
  .cfsv3-layout {
    grid-template-columns: 1fr;
  }

  .cfsv3-filter-toggle {
    display: flex;
  }

  .cfsv3-sidebar {
    position: static;
    display: none;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
  }

  .cfsv3-sidebar.is-open {
    display: flex;
  }

  .cfsv3-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
  }

  .cfsv3-grid,
  .cfsv3-fallback-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cfsv3-grid,
  .cfsv3-fallback-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cfsv3 *,
  .cfsv3 *::before,
  .cfsv3 *::after {
    transition: none !important;
    animation: none !important;
  }
}
