/* Catalog page ("Plantillas"): warm background, header with back button, search pill and occasion chips.
   Loaded after the storefront sheets so it only refines them; typography keeps text-style.css. */

/* Shared round back button (catalog and account panel). */
.back-round {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #fbe3bb;
  text-decoration: none;
  background:
    linear-gradient(#2a1230e6, #2a1230e6) padding-box,
    linear-gradient(140deg, #fbe3bb, #ff8cc4 60%, #b892ff) border-box;
  box-shadow: 0 8px 20px #0c061c66, 0 0 0 5px #f6c98a0f;
  transition: transform .2s ease, box-shadow .2s ease;
}
.back-round svg { width: 21px; height: 21px; filter: drop-shadow(0 0 5px #f6c98a99); }
.back-round:hover { transform: translateX(-2px); box-shadow: 0 10px 24px #0c061c80, 0 0 0 7px #f6c98a1f, 0 0 20px #ff8cc444; }
.back-round:focus-visible { outline: 3px solid #f6c98a; outline-offset: 4px; }
.back-sep { flex: none; width: 1px; height: 52px; background: linear-gradient(180deg, transparent, #f6c98a66, #ff8cc455, transparent); }

/* Same warm sky as the home hero, a touch deeper so the cards stand out. */
#main-content #home-view #templates {
  background:
    radial-gradient(ellipse 70vw 80vh at 85% 0, #f2a65a6b, transparent 70%),
    linear-gradient(160deg, #250c28, #511a42 60%, #36112f);
  background-attachment: fixed, scroll;
}

/* Header row: back button, title and the draft shortcut. */
#templates .catalog-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 26px;
  padding-bottom: 22px;
}
#templates .catalog-head::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, #f6c98a00, #f6c98a80 12%, #ff8cc480 50%, #b892ff40 80%, #b892ff00);
}
#templates .catalog-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
#main-content #templates #templates-heading {
  display: inline-block;
  margin: 0;
  padding: 0 6px 4px 0;
  color: transparent;
  background: linear-gradient(100deg, #fff8f3 0%, #fbe3bb 28%, #f6c98a 55%, #ff9fb8 82%, #ff6fae 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 14px #ff8cc433);
}
#templates .catalog-subtitle { margin: 2px 0 0; color: #cdb8cc; }
#templates .resume-draft {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  max-width: 100%;
  padding: 0 18px 0 14px;
  border: 1px solid #6b4570aa;
  border-radius: 999px;
  color: #fbe3bb;
  font-weight: 700;
  text-decoration: none;
  background: #2a123099;
  transition: border-color .2s ease, background .2s ease;
}
#templates .resume-draft[hidden] { display: none; }
#templates .resume-draft:hover { border-color: #f6c98a; background: #351a3b; }
#templates .resume-draft svg { width: 18px; height: 18px; flex: none; }
#templates .resume-draft .resume-cover { width: 34px; height: 34px; flex: none; margin-left: -8px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #f6c98a66; }
#templates .resume-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Controls sit directly on the background: no surrounding box. */
#templates .catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 16px;
  margin: 0 0 30px;
  padding: 0;
  border: 0;
  background: none;
}
#templates .catalog-controls[hidden] { display: none; }
#templates .catalog-search { grid-column: 1; margin: 0; }
#templates .catalog-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#templates .catalog-search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  height: 58px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#24102af2, #24102af2) padding-box,
    linear-gradient(120deg, #f6c98a77, #ff8cc466 50%, #b892ff55) border-box;
  box-shadow: 0 14px 32px #0000004d, inset 0 1px 0 #ffffff12;
  transition: box-shadow .2s ease, background .2s ease;
}
#templates .catalog-search-field:focus-within {
  background:
    linear-gradient(#2c1333f2, #2c1333f2) padding-box,
    linear-gradient(120deg, #fbe3bb, #ff8cc4 50%, #b892ff) border-box;
  box-shadow: 0 14px 32px #0000004d, 0 0 0 5px #f6c98a1a, 0 0 26px #ff8cc433;
}
#templates .catalog-search-field > svg {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 50%;
  color: #2b0f2e;
  background: linear-gradient(135deg, #fbe3bb, #f6c98a 50%, #ff9fb8);
  box-shadow: 0 4px 14px #ff6fae40;
}
#templates .catalog-search input { flex: 1; min-height: 100%; padding: 0; color: #fff8f3; font-size: 1rem; }
#templates .catalog-search input:focus { outline: none; }
#templates .catalog-search input::placeholder { color: #a892a8; }
#templates .search-key {
  flex: none;
  margin-right: 8px;
  padding: 4px 9px;
  border: 1px solid #4a2a50;
  border-radius: 8px;
  color: #b39fb2;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  background: #ffffff08;
}

/* Availability is a small switch, shown only while some template is in preparation. */
#templates .availability-filter { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 10px; color: #e3d2ef; font-weight: 650; cursor: pointer; }
#templates .availability-filter[hidden] { display: none; }
#templates .availability-filter input {
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border: 1px solid #6b4570;
  border-radius: 999px;
  background: #3a2042;
  cursor: pointer;
  appearance: none;
  transition: background .2s ease;
}
#templates .availability-filter input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #b39fb2; transition: transform .2s ease, background .2s ease; }
#templates .availability-filter input:checked { border-color: transparent; background: linear-gradient(110deg, #fbe3bb, #ff9fb8); }
#templates .availability-filter input:checked::after { transform: translateX(18px); background: #2b0f2e; }

/* Occasion chips: icon, short name and count. */
#main-content #templates .occasion-filters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
#main-content #templates .occasion-filters button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 8px 0 14px;
  border: 1px solid #4a2a50;
  border-radius: 999px;
  color: #e3d2ef;
  font-size: .92rem;
  font-weight: 700;
  background: #2a1230b3;
}
#main-content #templates .occasion-filters button[hidden] { display: none; }
#main-content #templates .occasion-filters button:not([aria-pressed="true"]):hover { border-color: #6b4570; background: #351a3b; }
#main-content #templates .occasion-filters svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #c9a3e6; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s ease; }
#main-content #templates .occasion-filters button:hover svg { stroke: #fbe3bb; }
#main-content #templates .filter-count { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; color: #d8c3d6; font-size: .76rem; font-weight: 800; background: #ffffff10; }
#main-content #templates .occasion-filters button[aria-pressed="true"] {
  border-color: transparent;
  color: #2b0f2e;
  background: linear-gradient(110deg, #fbe3bb, #f6c98a 45%, #ff9fb8);
  box-shadow: 0 10px 24px #ff6fae40;
}
#main-content #templates .occasion-filters button[aria-pressed="true"] svg { stroke: #2b0f2e; }
#main-content #templates .occasion-filters button[aria-pressed="true"] .filter-count { color: #fbe3bb; background: #2b0f2e; }
/* The count line stays for screen readers; the chips already show the numbers. */
#templates #catalog-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Cards float a little higher over the warmer background. */
#templates .template-card { box-shadow: 0 18px 40px #0000005c, inset 0 0 0 1px #ffffff0a; }

@media (max-width: 680px) {
  .back-round { width: 44px; height: 44px; }
  .back-sep { height: 44px; }
  #templates .catalog-head { gap: 14px; }
  #templates .catalog-title { gap: 12px; }
  #templates .catalog-subtitle { display: none; }
  #templates .resume-draft { justify-content: center; width: 100%; min-height: 44px; font-size: .9rem; }
  #templates .catalog-controls { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #templates .catalog-search-field { height: 54px; }
  #templates .search-key { display: none; }
  #templates .availability-filter { grid-column: 1; grid-row: auto; justify-self: start; }
  #main-content #templates .occasion-filters {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding: 2px 16px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 36px), transparent);
    mask: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 36px), transparent);
  }
  #main-content #templates .occasion-filters::-webkit-scrollbar { display: none; }
  #main-content #templates .occasion-filters button { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .back-round, #templates .catalog-search-field, #templates .availability-filter input, #templates .availability-filter input::after { transition: none; }
  .back-round:hover { transform: none; }
}
