.amaral-search-container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }

.search-header { margin-bottom: 40px; border-bottom: 2px solid var(--bg-secondary); padding-bottom: 20px; }
.search-title { font-size: 32px; font-weight: 700; color: var(--brand-dark); margin: 0 0 10px 0; }
.search-subtitle { font-size: 16px; color: var(--text-dark); opacity: 0.8; margin: 0; }

.search-main-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }

.search-sidebar { background: var(--white); border: 1px solid var(--bg-secondary); border-radius: 12px; padding: 30px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); position: sticky; top: 20px; }
.search-sidebar-title { font-size: 20px; font-weight: 700; color: var(--brand-dark); margin-bottom: 20px; border-bottom: 2px solid var(--bg-secondary); padding-bottom: 10px; }
.search-sidebar-list { list-style: none; padding: 0; margin: 0; }
.search-sidebar-list li { margin-bottom: 12px; }
.search-sidebar-list a { text-decoration: none; font-size: 16px; font-weight: 500; color: var(--text-dark); display: flex; justify-content: space-between; transition: color 0.3s ease; }
.search-sidebar-list a:hover, .search-sidebar-list a.active { color: var(--brand-light); font-weight: 700; }
.search-sidebar-list .count { color: #9ca3af; font-size: 14px; }
.search-clear-btn { display: block; text-align: center; background: var(--bg-secondary); color: var(--text-dark); padding: 10px 0; border-radius: 8px; text-decoration: none; font-weight: 600; margin-top: 30px; transition: background 0.3s ease, color 0.3s ease; }
.search-clear-btn:hover { background: var(--danger, #ff4d4d); color: var(--white); }

.search-products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; align-items: start; }

.custom-related-card { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.04); display: flex; flex-direction: column; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid var(--bg-secondary); }
.custom-related-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.custom-related-image-link { display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-secondary); }
.custom-related-image-link img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.custom-related-card:hover .custom-related-image-link img { transform: scale(1.05); }
.custom-related-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.custom-related-title-link { text-decoration: none; margin-bottom: 10px; }
.custom-related-title-link h3 { font-size: 16px; font-weight: 600; color: var(--text-dark); margin: 0; transition: color 0.3s ease; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.custom-related-title-link:hover h3 { color: var(--brand-light); }
.custom-related-price { font-size: 18px; font-weight: 700; color: var(--brand-dark); margin-bottom: 20px; flex-grow: 1; }
.custom-related-price del { color: #9ca3af; font-size: 14px; font-weight: 400; margin-right: 8px; }
.custom-related-price ins { text-decoration: none; }
.custom-related-btn { display: block; background: var(--bg-secondary); color: var(--text-dark); padding: 12px 0; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background 0.3s ease, color 0.3s ease; width: 100%; border: none; cursor: pointer; }
.custom-related-btn:hover, .custom-related-btn:focus, .custom-related-btn:active { background: var(--brand-light) !important; color: var(--white) !important; text-decoration: none; outline: none; }

@media (max-width: 1024px) {
    .search-main-layout { grid-template-columns: 1fr; gap: 30px; }
    .search-sidebar { position: relative; top: 0; }
    .search-products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .search-products-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .search-title { font-size: 26px; }
}
@media (max-width: 480px) {
    .search-products-grid { grid-template-columns: 1fr; gap: 15px; }
}

/* O GRID DE PRODUTOS PRECISA TER O ALIGN-ITEMS COMO STRETCH */
.search-products-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; 
    align-items: stretch; /* <--- ISSO FORÇA A ALTURA IGUAL NA LINHA */
}

/* O CARD PRECISA TER HEIGHT: 100% E DISPLAY: FLEX COM FLEX-DIRECTION: COLUMN */
.custom-related-card { 
    height: 100%; /* <--- ISSO FAZ O CARD OCUPAR O ESPAÇO TOTAL DO GRID */
    display: flex; 
    flex-direction: column; 
    background: var(--white); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.04); 
    text-align: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    border: 1px solid var(--bg-secondary); 
}

/* O CONTEÚDO PRECISA CRESCER COM FLEX-GROW: 1 */
.custom-related-content { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; /* <--- ISSO EMPURRA O BOTÃO LÁ PRA BAIXO */
}

/* O BOTÃO PRECISA DE MARGIN-TOP: AUTO PARA FICAR COLADO NA BASE */
.custom-related-btn { 
    margin-top: auto;
    display: block; 
    background: var(--bg-secondary); 
    color: var(--text-dark); 
    padding: 12px 0; 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 600; 
    transition: background 0.3s ease, color 0.3s ease; 
    width: 100%; 
    border: none; 
    cursor: pointer; 
}