/* ============================================================
     SEARCH PAGE v4 — SIDEBAR LAYOUT + MASONRY GRID
     ============================================================ */

  #search-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    max-width: 100%;
    padding: 0 16px 40px 0;
    box-sizing: border-box;
  }

  /* ============================================================
     SIDEBAR
     ============================================================ */
  #search-sidebar {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e8e4df;
    padding: 28px 22px 40px 22px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
  }

  #search-sidebar::-webkit-scrollbar { width: 3px; }
  #search-sidebar::-webkit-scrollbar-track { background: transparent; }
  #search-sidebar::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }

  #search-sidebar h3.sidebar-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 22px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0ece8;
  }

  .sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0ece8;
  }

  .sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }

  .sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #aaa;
    margin: 0 0 10px 0;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-section-title .toggle-icon {
    font-size: 9px;
    color: #ccc;
    transition: transform 0.2s;
  }

  .sidebar-section-title.collapsed .toggle-icon {
    transform: rotate(-90deg);
  }

  .sidebar-section-body {
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .filter-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
  }

  .filter-list li input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #c8a96e;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
  }

  .filter-list li label {
    font-size: 13px;
    color: #555;
    cursor: pointer;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    transition: color 0.15s;
  }

  .filter-list li label:hover { color: #c8a96e; }

  .filter-list li .count {
    font-size: 11px;
    color: #ccc;
    margin-left: auto;
    flex-shrink: 0;
  }

  .sidebar-select {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 3px;
    padding: 7px 10px;
    font-size: 13px;
    color: #555;
    background: #fafafa;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ccc'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
  }

  .price-inputs {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
  }

  .price-inputs input[type="number"] {
    width: 80px;
    border: 1px solid #eee;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 12px;
    color: #555;
    background: #fafafa;
  }

  .price-inputs span { font-size: 11px; color: #ccc; }

  #sidebar-mobile-toggle {
    display: none;
    background: #2b2b2b;
    color: #fff;
    border: none;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    text-align: left;
    margin-bottom: 0;
  }

  /* ============================================================
     ACTIVE FILTER PILLS
     ============================================================ */
  #active-filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    min-height: 28px;
  }

  .active-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: 11px;
    color: #555;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
  }

  .active-filter-pill:hover {
    border-color: #c8a96e;
    background: #fdf8f2;
    color: #333;
  }

  .active-filter-pill .pill-x { font-size: 13px; color: #bbb; line-height: 1; }

  .results-summary { font-size: 13px; color: #888; margin-right: 4px; white-space: nowrap; }
  .results-summary strong { color: #2b2b2b; font-weight: 700; }

  .clear-all-link {
    font-size: 11px;
    color: #c8a96e;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    margin-left: 2px;
  }
  .clear-all-link:hover { color: #a07840; }

  /* ============================================================
     RESULTS AREA
     ============================================================ */
  #search-results {
    flex: 1;
    min-width: 0;
    padding: 0 24px 0 28px;
    box-sizing: border-box;
  }

  #results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 14px 0;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
  }

  #results-header .sort-controls { display: flex; align-items: center; gap: 10px; }

  #results-header .sort-label {
    font-size: 10px;
    color: #aaa;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  #results-header select {
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 5px 28px 5px 8px;
    font-size: 12px;
    color: #555;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ccc'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
  }

  /* ============================================================
     MASONRY GRID
     ============================================================ */
  #artworks-grid {
    columns: 4;
    column-gap: 18px;
  }

  /* ---- CARD ---- */
  .artwork-card {
    break-inside: avoid;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 3px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    display: inline-block;
    width: 100%;
  }

  .artwork-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.10);
    transform: translateY(-2px);
  }

  .artwork-card .card-img-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f3f0;
    line-height: 0;
  }

  .artwork-card .card-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.35s ease;
  }

  .artwork-card:hover .card-img-wrap img { transform: scale(1.04); }

  .artwork-card .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    padding: 32px 12px 12px 12px;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .artwork-card:hover .card-overlay { opacity: 1; }

  .card-overlay-link {
    display: block;
    text-align: center;
    background: rgba(255,255,255,0.95);
    color: #2b2b2b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 7px 10px;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.15s;
  }

  .card-overlay-link:hover { background: #c8a96e; color: #fff; text-decoration: none; }

  /* ---- Card body — REVISED typography ---- */
  .artwork-card .card-body {
    padding: 13px 14px 15px 14px;
  }

  /*
   * ARTIST NAME — now the most prominent text element in the card body.
   * Larger, dark, with a subtle gold underline accent on hover.
   */
  .artwork-card .card-artist {
    font-size: 13px;           /* was 11px */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #2b2b2b;            /* was #aaa — now full dark */
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .artwork-card .card-artist a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
  }

  .artwork-card .card-artist a:hover {
    color: #c8a96e;
    border-bottom-color: #c8a96e;
  }

  /* Artwork title — slightly subordinate to artist but still clear */
  .artwork-card .card-title {
    font-size: 13px;           /* was 15px — intentionally stepped down */
    font-weight: 400;
    color: #555;
    margin: 0 0 8px 0;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-style: italic;        /* italics to visually separate from artist */
  }

  .artwork-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
  }

  .artwork-card .card-title a:hover { color: #c8a96e; }

  /*
   * META LINE — tecnica / supporto · dimensioni · anno
   * Now has its own distinct visual treatment: a fine top rule,
   * darker text, split into two tokens with different weights.
   */
  .artwork-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
    border-top: 1px solid #f0ece8;   /* subtle separator from title */
    padding-top: 8px;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.5;
  }

  /* Tecnica + supporto: bold, dark gold */
  .artwork-card .card-meta .meta-technique {
    font-weight: 700;
    color: #8a6e3e;              /* warm dark gold — distinctive yet refined */
    letter-spacing: 0.3px;
    white-space: nowrap;
  }

  /* Separator dot */
  .artwork-card .card-meta .meta-sep {
    color: #d0c8be;
    margin: 0 5px;
  }

  /* Dimensions + year: medium weight, mid-grey */
  .artwork-card .card-meta .meta-dims {
    font-weight: 600;
    color: #888;
    white-space: nowrap;
  }

  .artwork-card .card-price {
    margin-top: 9px;
    font-size: 14px;
    font-weight: 700;
    color: #2b2b2b;
  }

  .artwork-card .card-price .original-price {
    font-size: 11px;
    color: #ccc;
    text-decoration: line-through;
    margin-right: 4px;
    font-weight: 400;
  }

  /* ---- Pagination ---- */
  #pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #ebebeb;
  }

  #pagination a,
  #pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 13px;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.15s;
  }

  #pagination a:hover { background: #2b2b2b; color: #fff; border-color: #2b2b2b; }

  #pagination span.current {
    background: #2b2b2b;
    color: #fff;
    border-color: #2b2b2b;
    font-weight: 700;
  }

  #pagination .page-dots { border: none; color: #ccc; width: auto; }

  /* ============================================================
     RESPONSIVE
     ============================================================ */
  @media (max-width: 1100px) {
    #artworks-grid { columns: 2; }
    #search-sidebar { width: 260px; min-width: 260px; max-width: 260px; }
  }

  @media (max-width: 900px) {
    #search-layout { flex-direction: column; padding: 0 10px 30px 10px; }
    #search-sidebar {
      width: 100%; max-width: 100%; min-width: 0; max-height: none;
      position: static; border-right: none; border-bottom: 1px solid #e8e4df;
      margin-bottom: 16px; padding: 16px;
    }
    #sidebar-mobile-toggle { display: block; }
    #search-sidebar .sidebar-inner { display: none; }
    #search-sidebar.open > .sidebar-inner { display: block !important; }
    #search-results { padding: 0; }
    #artworks-grid { columns: 2; column-gap: 12px; }
    #search-sidebar h3 { display: none; }
    #search-sidebar.open .sidebar-inner { padding-top: 30px !important; }
    .sidebar-section:first-child { margin-top: 0; }
  }

  @media (max-width: 540px) {
    #artworks-grid { columns: 1; }
  }
    

