/* ============================================
   MP SIDE SEARCH v1
   Drawer derecho con tabs Productos / Colecciones / Categorías
   ============================================ */

.mp-side-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.mp-side-search-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mp-side-search {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(85vw, 900px);
    max-width: 100%;
    background: #fff;
    color: #0a0a0a;
    z-index: 9998;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,0.08);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mp-side-search.is-open {
    transform: translateX(0);
}

/* --- Header con input --- */
.mp-side-search__header {
    flex-shrink: 0;
    padding: 24px max(20px, 3vw);
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid #e8e8e8;
}

.mp-side-search__input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #0a0a0a;
}

.mp-side-search__icon {
    color: #0a0a0a;
    flex-shrink: 0;
}

.mp-side-search__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 20px;
    font-weight: 300;
    background: transparent;
    color: #0a0a0a;
    font-family: inherit;
    letter-spacing: 0.01em;
    padding: 4px 0;
}

.mp-side-search__input::placeholder {
    color: #aaa;
}

.mp-side-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.mp-side-search__close {
    background: transparent;
    border: none;
    color: #0a0a0a;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: opacity 0.2s;
}

.mp-side-search__close:hover { opacity: 0.6; }

/* --- Tabs --- */
.mp-side-search__tabs {
    flex-shrink: 0;
    display: flex;
    gap: 28px;
    padding: 0 max(20px, 3vw);
    border-bottom: 1px solid #e8e8e8;
}

.mp-side-search__tab {
    background: transparent;
    border: none;
    padding: 16px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    font-family: inherit;
    position: relative;
    transition: color 0.2s;
}

.mp-side-search__tab:hover { color: #0a0a0a; }

.mp-side-search__tab.is-active {
    color: #0a0a0a;
}

.mp-side-search__tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #0a0a0a;
}

/* --- Body / Results --- */
.mp-side-search__body {
    flex: 1;
    overflow-y: auto;
    padding: 28px max(20px, 3vw);
}

.mp-side-search__empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
    font-weight: 300;
}

.mp-side-search__empty.is-hidden { display: none; }

.mp-side-search__results { display: none; }

.mp-side-search__results.is-visible { display: block; }

.mp-side-search__loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

/* --- Productos --- */
.mp-side-search__products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.mp-side-search__product {
    text-decoration: none;
    color: #0a0a0a;
    display: block;
    position: relative;
}

.mp-side-search__product-img {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 10px;
}

.mp-side-search__product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.mp-side-search__product:hover .mp-side-search__product-img img {
    transform: scale(1.04);
}

.mp-side-search__product-name {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #0a0a0a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-side-search__product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.mp-side-search__product-sku {
    color: #999;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.mp-side-search__product-sku.is-match {
    color: #8B0000;
    font-weight: 600;
}

.mp-side-search__product-price {
    font-size: 12px;
    font-weight: 500;
    color: #0a0a0a;
}

/* --- Términos (colecciones / categorías) --- */
.mp-side-search__terms {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mp-side-search__term {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    padding: 14px 4px;
    border-bottom: 1px solid #f0f0f0;
    color: #0a0a0a;
    transition: background 0.15s, padding 0.15s;
}

.mp-side-search__term:hover {
    background: #fafafa;
    padding-left: 12px;
}

.mp-side-search__term-name {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #0a0a0a;
}

.mp-side-search__term-count {
    font-size: 11px;
    color: #999;
    letter-spacing: 0.02em;
}

/* --- Sin resultados --- */
.mp-side-search__no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 849px) {
    .mp-side-search {
        width: 100%;
    }

    .mp-side-search__header {
        padding: 18px 16px;
        gap: 12px;
    }

    .mp-side-search__input {
        font-size: 17px;
    }

    .mp-side-search__tabs {
        padding: 0 16px;
        gap: 22px;
    }

    .mp-side-search__tab {
        font-size: 12px;
        padding: 14px 0;
    }

    .mp-side-search__body {
        padding: 22px 16px;
    }

    .mp-side-search__products {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
