.category-hero-section {
  padding: 64px 0 12px;
}

.category-hero {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .88fr);
  align-items: center;
  gap: 54px;
  padding: 48px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 28px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .18);
}

.category-hero-copy {
  max-width: 560px;
}

.category-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--rose2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1px;
}

.category-eyebrow::before {
  content: '';
  width: 30px;
  height: 2px;
  background: var(--rose);
  border-radius: 999px;
}

.category-hero h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.2;
  letter-spacing: -1.2px;
}

.category-hero h2 strong {
  color: var(--rose2);
}

.category-hero-copy p {
  max-width: 520px;
  margin: 0 0 28px;
  color: var(--text2);
  font-size: 14px;
  line-height: 2;
}

.category-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.category-primary-action,
.category-secondary-action {
  min-height: 46px;
  padding: 0 21px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.category-primary-action {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 12px 30px rgba(196, 92, 138, .24);
}

.category-primary-action:hover {
  background: var(--rose2);
  transform: translateY(-2px);
}

.category-primary-action img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.category-secondary-action {
  color: var(--text);
  border: 1px solid var(--border2);
  background: var(--bg3);
}

.category-secondary-action:hover {
  border-color: rgba(196, 92, 138, .35);
}

.category-hero-visual {
  min-height: 300px;
  position: relative;
  direction: ltr;
}

.category-hero-card {
  position: absolute;
  overflow: hidden;
  border-radius: 22px;
  border: 7px solid var(--bg2);
  background: var(--bg3);
  box-shadow: 0 22px 56px rgba(0, 0, 0, .26);
}

.category-hero-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.category-hero-card:nth-child(1) {
  width: 61%;
  aspect-ratio: 1;
  left: 20%;
  top: 0;
  z-index: 3;
}

.category-hero-card:nth-child(2) {
  width: 43%;
  aspect-ratio: 1;
  left: 0;
  bottom: 0;
  z-index: 2;
  transform: rotate(-5deg);
}

.category-hero-card:nth-child(3) {
  width: 43%;
  aspect-ratio: 1;
  right: 0;
  bottom: 2%;
  z-index: 1;
  transform: rotate(5deg);
}

.free-designs-hero-section {
  padding: 20px 0 18px;
}

.free-designs-hero {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .82fr);
  align-items: center;
  gap: 44px;
  padding: 44px 48px;
  overflow: hidden;
  border: 1px solid rgba(196, 92, 138, .3);
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 20%, rgba(232, 184, 90, .16), transparent 30%),
    radial-gradient(circle at 92% 80%, rgba(196, 92, 138, .24), transparent 34%),
    linear-gradient(135deg, #121019 0%, #17111b 45%, #111824 100%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .28);
}

.free-designs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .16;
  background-image:
    linear-gradient(90deg, transparent 49.5%, rgba(255, 255, 255, .09) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(255, 255, 255, .07) 50%, transparent 50.5%);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, #000, transparent 74%);
}

.free-designs-hero::after {
  content: '';
  position: absolute;
  width: 330px;
  height: 330px;
  left: -120px;
  bottom: -180px;
  z-index: -1;
  border: 1px dashed rgba(232, 184, 90, .3);
  border-radius: 50%;
}

.free-hero-copy {
  max-width: 600px;
}

.free-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 7px 12px;
  color: #ffe6a5;
  border: 1px solid rgba(232, 184, 90, .28);
  border-radius: 999px;
  background: rgba(232, 184, 90, .1);
  font-size: 11px;
  font-weight: 800;
}

.free-hero-kicker::before {
  content: '✦';
  color: #e8b85a;
}

.free-designs-hero h2 {
  margin: 0 0 15px;
  color: #fff;
  font-size: clamp(34px, 4.8vw, 62px);
  line-height: 1.12;
  letter-spacing: -1.4px;
}

.free-designs-hero h2 strong {
  color: #f083b5;
}

.free-hero-copy > p {
  max-width: 570px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, .66);
  font-size: 13.5px;
  line-height: 2;
}

.free-hero-points {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.free-hero-points span {
  padding: 6px 10px;
  color: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  font-size: 10.5px;
}

.free-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.free-hero-action {
  min-height: 48px;
  padding: 0 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, #c45c8a, #a3456f);
  box-shadow: 0 13px 32px rgba(196, 92, 138, .3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  transition: transform .18s ease, filter .18s ease;
}

.free-hero-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.free-hero-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
}

.free-hero-count strong {
  color: #e8b85a;
  font-size: 24px;
}

.free-hero-visual {
  min-height: 270px;
  position: relative;
  direction: ltr;
}

.free-preview-card {
  position: absolute;
  width: 54%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, .92);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
}

.free-preview-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.free-preview-card span {
  position: absolute;
  left: 9px;
  bottom: 9px;
  padding: 5px 9px;
  color: #fff;
  border-radius: 999px;
  background: #c45c8a;
  box-shadow: 0 5px 16px rgba(196, 92, 138, .4);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
}

.free-preview-card:nth-child(1) { left: 23%; top: 0; z-index: 3; transform: rotate(-2deg); }
.free-preview-card:nth-child(2) { left: 0; bottom: 0; z-index: 1; transform: rotate(-8deg); }
.free-preview-card:nth-child(3) { right: 0; bottom: 2%; z-index: 2; transform: rotate(8deg); }

.active-category-filter {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  width: fit-content;
  color: var(--rose2);
  background: rgba(196, 92, 138, .08);
  border: 1px solid rgba(196, 92, 138, .24);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.card-free-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 9px;
  color: #211409;
  border-radius: 999px;
  background: #e8b85a;
  box-shadow: 0 7px 20px rgba(0, 0, 0, .24);
  font-size: 10px;
  font-weight: 900;
}

.card-price.free {
  color: #d8a846;
  font-size: 17px;
  font-weight: 900;
}

.btn-cart-card.free:not(.in-cart) {
  color: #f0c66e;
  border-color: rgba(232, 184, 90, .3);
  background: rgba(232, 184, 90, .09);
}

.btn-cart-card.free:not(.in-cart):hover {
  color: #201307;
  border-color: #e8b85a;
  background: #e8b85a;
}

.active-category-filter.show {
  display: inline-flex;
}

.active-category-filter button {
  border: 0;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--text2);
  background: var(--bg3);
  font: 11px inherit;
  cursor: pointer;
}

.categories-page {
  min-height: 100vh;
  padding: 118px 0 80px;
}

.categories-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 34px;
}

.categories-intro h1 {
  margin: 6px 0 10px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.2;
  letter-spacing: -1.2px;
}

.categories-intro p {
  max-width: 610px;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.9;
}

.categories-count {
  min-width: 116px;
  padding: 15px 18px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: var(--bg2);
  text-align: center;
}

.categories-count strong {
  display: block;
  color: var(--rose);
  font-size: 27px;
}

.categories-count span {
  color: var(--text2);
  font-size: 11px;
}

.category-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(196, 92, 138, .32);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .2);
}

.category-card-free {
  border-color: rgba(232, 184, 90, .35);
  background: linear-gradient(155deg, rgba(232, 184, 90, .07), var(--bg2) 48%);
}

.category-card-free:hover {
  border-color: rgba(232, 184, 90, .62);
}

.category-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg3);
}

.category-free-badge {
  position: absolute;
  top: 11px;
  right: 11px;
  padding: 5px 9px;
  color: #211409;
  border-radius: 999px;
  background: #e8b85a;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  font-size: 9px;
  font-weight: 900;
}

.category-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease;
}

.category-card:hover .category-card-media img {
  transform: scale(1.04);
}

.category-card-body {
  padding: 17px 17px 18px;
}

.category-card h2 {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 800;
}

.category-card p {
  min-height: 49px;
  margin: 0 0 16px;
  color: var(--text2);
  font-size: 11.5px;
  line-height: 1.8;
}

.category-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
}

.category-card-footer img {
  width: 15px;
  height: 15px;
  opacity: .8;
  filter: invert(56%) sepia(40%) saturate(1044%) hue-rotate(287deg) brightness(90%);
}

.category-back-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 12px;
}

.category-back-link:hover {
  color: var(--rose2);
}

html[data-theme="light"] .category-hero,
html[data-theme="light"] .category-card {
  box-shadow: 0 18px 50px rgba(38, 42, 68, .08);
}

html[data-theme="light"] .free-designs-hero {
  border-color: rgba(168, 71, 117, .24);
  box-shadow: 0 24px 65px rgba(64, 43, 73, .13);
}

@media (max-width: 920px) {
  .category-hero {
    grid-template-columns: minmax(0, 1fr) minmax(290px, .8fr);
    gap: 28px;
    padding: 34px;
  }

  .category-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .free-designs-hero {
    grid-template-columns: minmax(0, 1fr) minmax(270px, .75fr);
    gap: 26px;
    padding: 36px;
  }
}

@media (max-width: 720px) {
  .category-hero-section {
    padding-top: 34px;
  }

  .category-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 27px 22px 22px;
    border-radius: 20px;
  }

  .category-hero h2 {
    font-size: 31px;
  }

  .category-hero-copy p {
    margin-bottom: 21px;
    font-size: 13px;
  }

  .category-hero-visual {
    min-height: 230px;
  }

  .category-hero-card:nth-child(1) {
    width: 55%;
    left: 22.5%;
  }

  .free-designs-hero-section {
    padding-top: 12px;
  }

  .free-designs-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 22px 22px;
    border-radius: 20px;
  }

  .free-designs-hero h2 {
    font-size: 36px;
  }

  .free-hero-visual {
    min-height: 225px;
  }

  .free-preview-card {
    width: 48%;
  }

  .free-preview-card:nth-child(1) {
    left: 26%;
  }

  .categories-page {
    padding-top: 90px;
  }

  .categories-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .categories-count {
    min-width: 0;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
  }

  .categories-count strong {
    font-size: 18px;
  }

  .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .category-card {
    border-radius: 14px;
  }

  .category-card-body {
    padding: 13px;
  }

  .category-card h2 {
    font-size: 13px;
  }

  .category-card p {
    min-height: 0;
    margin-bottom: 11px;
    font-size: 10.5px;
  }
}

@media (max-width: 420px) {
  .category-primary-action,
  .category-secondary-action {
    width: 100%;
  }

  .category-card-grid {
    grid-template-columns: 1fr;
  }

  .category-card-media {
    aspect-ratio: 16 / 10;
  }

  .free-hero-actions,
  .free-hero-action {
    width: 100%;
  }

  .free-hero-count {
    width: 100%;
    justify-content: center;
  }

  .free-hero-visual {
    min-height: 190px;
  }
}
