/* main.css: Styles only for this page (index.html). */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { background: var(--surface-page); }

  body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color-text);
  }

  img { display: block; }

  /* ══════════════ Layout ══════════════ */
  .layout {
    display: flex;
    min-height: calc(100vh - 40px);
    height: calc(100vh - 40px);
    overflow: hidden;
    overscroll-behavior: none;
  }

  .layout > .sidebar.sidebar--responsive {
    position: fixed;
    top: 40px;
    left: 0;
    width: 245px;
    height: calc(100vh - 40px);
    min-height: calc(100vh - 40px);
    overflow-y: hidden;
    overscroll-behavior: none;
  }

  .layout > .main {
    margin-left: 245px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior-y: none;
    scrollbar-width: none;
    scrollbar-color: #A2A2A2 transparent;
  }

  .layout > .main:hover {
    scrollbar-width: thin;
  }

  .layout > .main::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .layout > .main:hover::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .layout > .main::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
  }

  .layout > .main:hover::-webkit-scrollbar-thumb {
    background: #A2A2A2;
  }

  .layout > .main::-webkit-scrollbar-track {
    background: transparent;
  }

  .layout > .main:hover::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
  }

  /* ══════════════ Main ══════════════ */
  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  /* ── Hero / Search Banner ── */
  .hero {
    background: var(--surface-page);
    border-bottom: 1px solid var(--surface-border);
    padding: 55px 67px 65px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }

  .hero-deco-grid {
    display: grid;
    grid-template-columns: max-content;
    grid-template-rows: max-content;
    place-items: start;
    line-height: 0;
    flex-shrink: 0;
    animation: heroDecoFloat 3.2s ease-in-out infinite;
    will-change: transform;
  }

  .hero-deco-grid > * { grid-column: 1; grid-row: 1; }

  @keyframes heroDecoFloat {
    0% {
      transform: translateY(-4px);
    }
    50% {
      transform: translateY(4px);
    }
    100% {
      transform: translateY(-4px);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-deco-grid {
      animation: none;
      transform: none;
    }
  }

  .deco-bar-card {
    background: var(--surface-page);
    border: 1.167px solid var(--surface-border);
    border-radius: 8px;
    padding: 11.666px 9.333px;
    display: flex;
    align-items: center;
    gap: 5.833px;
    width: 94.493px;
    height: 34.997px;
  }

  .deco-dot {
    width: 11.666px;
    height: 11.666px;
    border-radius: 11px;
    flex-shrink: 0;
  }

  .deco-bar {
    width: 58.329px;
    height: 11.666px;
    border-radius: 11px;
  }

  .deco-icon-card {
    background: var(--surface-page);
    border: 1.067px solid var(--surface-border);
    border-radius: 7.314px;
    width: 37.331px;
    height: 37.331px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .deco-icon-card img { width: 19.199px; height: 19.199px; }

  .hero-center {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    max-width: 470px;
    width: 470px;
    padding-top: 20px;
    flex-shrink: 0;
  }

  .hero-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    color: var(--text-color-text);
  }

  .hero-title .highlight { color: var(--primary-default); }
  .hero-title .muted { color: var(--text-color-subtext); }

  .search-bar {
    background: var(--surface-search);
    border-radius: 100px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    width: 100%;
  }

  .search-input-btn {
    position: relative;
    width: 390px;
    background: none;
    border: none;
    padding: 0;
  }

  .search-input-btn:focus-within .search-bar {
    box-shadow: 0 0 0 1px var(--primary-default);
  }

  .search-bar img { width: 18px; height: 18px; flex-shrink: 0; }

  .search-bar-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-color-text);
    line-height: 16px;
    text-align: left;
    font-family: 'Inter', sans-serif;
  }

  .search-bar-input::placeholder {
    color: var(--text-color-subtext);
    font-weight: 300;
    opacity: 0.65;
  }

  .search-bar-input::-webkit-search-cancel-button {
    filter: invert(1);
  }

  .search-suggestions {
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    z-index: 30;
  }

  .search-suggestions[hidden] {
    display: none;
  }

  .search-suggestions-panel {
    width: 100%;
    background: var(--surface-suggestion-panel);
    border: 1px solid var(--surface-suggestion-border);
    border-radius: 12px;
    box-shadow: var(--effect-popover-shadow);
    overflow-x: hidden;
    padding: 12px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }

  .search-suggestions-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .search-suggestions-section-title {
    height: 20px;
    display: flex;
    align-items: flex-end;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: normal;
    color: var(--text-color-text);
    opacity: 0.6;
  }

  .search-suggestions-query {
    color: var(--text-color-textlink);
    margin-left: 4px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-collection-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 0 20px;
    width: 100%;
  }

  .search-collection-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: normal;
    color: var(--text-color-text);
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.16s ease, background-color 0.16s ease;
  }

  .search-collection-chip:hover,
  .search-collection-chip:focus-visible {
    border-color: var(--text-color-textlink);
    background: var(--surface-suggestion-hover);
    outline: none;
  }

  .search-collection-chip img {
    width: 16px;
    height: 16px;
  }

  .search-suggestions-list {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .search-suggestion {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 5.5px 20px;
    text-decoration: none;
    color: var(--text-color-text);
  }

  .search-suggestion:hover,
  .search-suggestion.is-active {
    background: var(--surface-suggestion-hover);
  }

  .search-suggestion-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .search-suggestion-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .search-suggestion-thumb {
    display: block;
    width: 67px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--surface-suggestion-thumb-border);
  }

  .search-suggestion-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .search-suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .search-suggestion-title {
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: var(--text-color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-suggestion-meta {
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: var(--text-color-subtext);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-match {
    background: rgba(43, 159, 244, 0.2);
    color: var(--text-color-text);
    padding: 0 1px;
    border-radius: 2px;
  }

  .search-suggestion-price {
    font-size: 14px;
    line-height: normal;
    font-weight: 600;
    color: var(--text-color-text);
    white-space: nowrap;
    margin-left: 12px;
    flex-shrink: 0;
  }

  .search-suggestions-empty {
    margin: 0;
    padding: 6px 20px;
    font-size: 12px;
    line-height: normal;
    color: var(--text-color-subtext);
    text-align: left;
  }

  /* ── Content area ── */
  .content { padding: 30px; }

  .section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color-text);
    line-height: 32px;
    font-family: 'Inter', sans-serif;
  }

  .section-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color-subtext);
    line-height: 18px;
    margin-top: 8px;
  }

  .filter-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 39px;
  }

  .filter-btn--free-paid {
    min-width: 135px;
    justify-content: space-between;
  }

  .free-paid-dropdown-wrap {
    position: relative;
    display: inline-flex;
  }

  .filter-btn--free-paid .chevron {
    transition: transform 0.16s ease;
  }

  .filter-btn--all-templates .chevron {
    transition: transform 0.16s ease;
  }

  .filter-btn--free-paid.is-open .chevron {
    transform: rotate(-90deg);
  }

  .filter-btn--all-templates.is-open .chevron {
    transform: rotate(-90deg);
  }

  .free-paid-dropdown {
    position: absolute;
    left: -1px;
    top: 47px;
    width: 200px;
    z-index: 1305;
  }

  .all-templates-dropdown-wrap {
    position: relative;
    display: inline-flex;
  }

  .all-templates-dropdown {
    position: absolute;
    left: -1px;
    top: 47px;
    width: 200px;
    z-index: 1305;
  }

  .free-paid-dropdown[hidden] {
    display: none;
  }

  .all-templates-dropdown[hidden] {
    display: none;
  }

  .free-paid-dropdown-panel {
    background: #1e1e1e;
    border: 1px solid #343434;
    border-radius: 12px;
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.3), 3px 0 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .all-templates-dropdown-panel {
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.3), 3px 0 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .free-paid-dropdown-title {
    padding: 0 20px;
    height: 20px;
    display: flex;
    align-items: flex-end;
    font-size: 13px;
    line-height: normal;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.6;
  }

  .all-templates-dropdown-title {
    padding: 0 20px;
    height: 20px;
    display: flex;
    align-items: flex-end;
    font-size: 13px;
    line-height: normal;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.6;
  }

  .free-paid-dropdown-options {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .all-templates-dropdown-options {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .free-paid-dropdown-option {
    width: 100%;
    border: none;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5.5px 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: left;
  }

  .all-templates-dropdown-option {
    width: 100%;
    border: none;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5.5px 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: left;
  }

  .free-paid-dropdown-option:hover,
  .free-paid-dropdown-option:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
  }

  .all-templates-dropdown-option:hover,
  .all-templates-dropdown-option:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
  }

  .free-paid-dropdown-option-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: #ffffff;
    white-space: nowrap;
  }

  .all-templates-dropdown-option-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: #ffffff;
    white-space: nowrap;
  }

  .free-paid-dropdown-option-left img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .all-templates-dropdown-option-left img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .free-paid-dropdown-option.is-active .free-paid-dropdown-option-left {
    font-weight: 500;
  }

  .all-templates-dropdown-option.is-active .all-templates-dropdown-option-left {
    font-weight: 500;
  }

  .free-paid-dropdown-count {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    padding: 2px 6px;
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: #ffffff;
    min-width: 22px;
    text-align: center;
  }

  .all-templates-dropdown-count {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    padding: 2px 6px;
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: #ffffff;
    min-width: 22px;
    text-align: center;
  }

  .count-skeleton {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent !important;
    min-width: 22px;
    overflow: hidden;
  }

  .free-paid-dropdown-count.count-skeleton,
  .all-templates-dropdown-count.count-skeleton {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    line-height: 20px;
  }

  .section-count.count-skeleton {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    line-height: 22px;
  }

  .count-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.2) 50%,
      rgba(255, 255, 255, 0.08) 100%
    );
    transform: translateX(-100%);
    animation: countSkeletonShimmer 1.15s ease-in-out infinite;
  }

  @keyframes countSkeletonShimmer {
    to {
      transform: translateX(100%);
    }
  }

  .template-section { margin-bottom: 0; }

  .section-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 39px;
    margin-bottom: 10px;
  }

  .section-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .section-row-left img { width: 14px; height: 14px; }

  .section-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color-text);
    line-height: 24px;
  }

  .section-count {
    background: var(--surface-tag);
    border-radius: 100px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-color-text);
    line-height: 16px;
  }

  .see-all {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-color-textlink);
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    line-height: 18px;
  }

  .see-all img { width: 14px; height: 14px; }

  .product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    row-gap: 15px;
  }

  .product-grid-empty {
    grid-column: 1 / -1;
    min-height: 164px;
    border: 1px dashed var(--surface-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.015);
    text-align: center;
  }

  .product-grid-empty-title {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: var(--text-color-text);
  }

  .product-grid-empty-copy {
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    font-weight: 400;
    color: var(--text-color-subtext);
  }

  @media (max-width: 1180px) {
    .layout > .sidebar.sidebar--responsive {
      width: 225px;
    }

    .layout > .main {
      margin-left: 225px;
    }

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

  @media (max-width: 1000px) {
    .hero-deco-grid {
      display: none;
    }

    .product-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 670px) {
    .layout {
      min-height: calc(100vh - 50px);
      height: calc(100vh - 50px);
    }

    .layout > .sidebar.sidebar--responsive {
      display: none;
    }

    .layout > .main {
      margin-left: 0;
      height: calc(100vh - 50px);
    }

    .hero {
      padding: 30px 20px 8px 20px;
      border-bottom: none;
    }

    .hero-center {
      width: 100%;
      max-width: none;
      padding-top: 5px;
      gap: 12px;
      align-items: stretch;
    }

    .hero-title {
      display: none;
    }

    .search-input-btn {
      width: 100%;
    }

    .search-bar {
      border-radius: 12px;
    }

    .content {
      padding: 20px 16px;
    }

    .filter-row {
      flex-wrap: wrap;
    }

  }

  .divider-wrap {
    display: flex;
    align-items: center;
    height: 21px;
    margin: 15px 0 36px;
  }

  .divider-wrap .line {
    height: 1px;
    width: 100%;
    background: var(--surface-border);
  }

  /* ══════════════ Footer ══════════════ */
  .footer {
    display: flex;
    flex-direction: column;
    padding-top: 35px;
  }

  .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px 20px;
  }

  .footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .footer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
  }

  .footer-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }

  .footer-brand-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color-text);
    line-height: 32px;
  }

  .footer-nav {
    display: flex;
    gap: 25px;
  }

  .footer-nav a {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color-subtext);
    line-height: 18px;
    text-decoration: none;
  }

  .footer-socials {
    display: flex;
    gap: 24px;
    align-items: center;
  }

  .footer-socials a { line-height: 0; }
  .footer-socials img { width: 24px; height: 24px; }

  .footer-border-strip {
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 10px;
    width: 100%;
  }

  .footer-border-strip img {
    height: 10px;
    flex-shrink: 0;
  }

  @media (max-width: 1180px) {
    .footer-nav {
      display: none;
    }
  }

/* ─── Light theme icon adjustments ─── */
[data-theme="light"] .section-row-left img { filter: brightness(0) saturate(100%); }
[data-theme="light"] .search-bar img { filter: brightness(0) saturate(100%); }
[data-theme="light"] .deco-icon-card img { filter: brightness(0) saturate(100%); }

