/* ============================================
   SEARCH BAR
   ============================================ */

.search-bar {
    margin-bottom: 2rem;
}

@media (max-width: 767px) {
    .search-bar {
        position: sticky;
        top: 64px;
        z-index: 60;
        background: var(--stone-50);
        padding: 1rem 0;
        margin-bottom: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.search-input-wrapper {
    position: relative;
    max-width: 500px;
}

@media (max-width: 767px) {
    .search-input-wrapper {
        margin: 0 auto;
        max-width: 100%;
    }
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--stone-400);
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    font-size: 0.9375rem;
    border: 2px solid var(--stone-200);
    border-radius: 50px;
    background: var(--white);
    color: var(--stone-800);
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.search-input::placeholder {
    color: var(--stone-400);
}

.search-input:focus {
    outline: none;
    border-color: var(--terracotta-500);
    box-shadow: 0 0 0 3px rgba(230, 74, 25, 0.1);
}

.search-input:focus + .search-clear,
.search-input-wrapper:hover .search-icon {
    color: var(--stone-600);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--stone-400);
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: var(--stone-100);
    color: var(--stone-700);
    transform: translateY(-50%) scale(1.1);
}

.search-clear:active {
    transform: translateY(-50%) scale(0.95);
}

.search-clear svg {
    width: 16px;
    height: 16px;
}

/* Estat quan hi ha text */
.search-input:not(:placeholder-shown) {
    border-color: var(--terracotta-500);
    background: rgba(230, 74, 25, 0.02);
}

/* Animació quan apareix resultat */
@keyframes highlight {
    0% { background: rgba(230, 74, 25, 0.1); }
    100% { background: transparent; }
}

.product-card.search-highlight {
    animation: highlight 0.6s ease;
}