.globalsearch {
    position: relative;
    max-width: 740px;
}

.globalsearch-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
}

.globalsearch-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-top: none;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
    z-index: 999;
}

.globalsearch-results-inner {
    display: flex;
    gap: 0;
    min-height: 520px; /* enough for 4 items */
}

.globalsearch-list-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.globalsearch-results.has-summary .globalsearch-list-wrap {
    flex: 0 0 55%;
    border-right: 1px solid #f1f1f1;
}

.globalsearch-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 520px; /* shows ~4 items before scroll */
    overflow-y: auto;
    flex: 1 1 auto;
}

.globalsearch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f3f3;
    min-height: 116px;
}

.globalsearch-item:last-child {
    border-bottom: none;
}

.globalsearch-item.is-active,
.globalsearch-item:hover {
    background: #f6f6f6;
}

.globalsearch-thumb {
    flex: 0 0 auto;
}

.globalsearch-thumb img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
}

.globalsearch-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.globalsearch-title {
    font-size: 12px;
    font-weight: 600;
    color: #222;
    line-height: 1.25;
}

.globalsearch-price {
    font-size: 13px;
    color: #666;
}

.globalsearch-summary {
    flex: 1 1 45%;
    padding: 16px 18px;
    transition: opacity 0.15s ease;
}

.globalsearch-summary.is-empty {
    opacity: 0;
    pointer-events: none;
}

.globalsearch-summary-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.globalsearch-summary-image img {
    width: 100%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
}

.globalsearch-summary-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

.globalsearch-summary-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.35;
}

.globalsearch-summary-price {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.globalsearch-summary-stock {
    font-size: 13px;
    color: #2d7a2d;
}

.globalsearch-summary .button,
.globalsearch-summary a.button,
.globalsearch-summary a.add_to_cart_button,
.globalsearch-summary .globalsearch-summary-cart {
    display: inline-block;
    padding: 10px 14px;
    background: #79b530;
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
}

.globalsearch-no-results {
    padding: 12px;
    font-size: 14px;
    color: #666;
}

.globalsearch-see-all {
    padding: 10px 12px;
    border-top: 1px solid #f1f1f1;
    text-align: center;
}

.globalsearch-see-all a {
    color: #1a4dab;
    text-decoration: none;
    font-weight: 600;
}

.globalsearch-see-all a:hover {
    text-decoration: underline;
}

.globalsearch-results.is-custom {
    padding: 8px 0;
}

.globalsearch-history,
.globalsearch-empty {
    padding: 10px 14px;
}

.globalsearch-history-title,
.globalsearch-empty-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    margin-bottom: 8px;
}

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

.globalsearch-history-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #222;
}

.globalsearch-history-item.is-product {
    display: flex;
    align-items: center;
    gap: 10px;
}

.globalsearch-history-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    background: #ffffff;
    flex: 0 0 auto;
}

.globalsearch-history-text {
    display: block;
    line-height: 1.2;
}

.globalsearch-history-item:hover {
    background: #f6f6f6;
}

.globalsearch-empty-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.globalsearch-empty-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f2f2f2;
    color: #222;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.globalsearch-empty-link:hover {
    background: #e8e8e8;
}

@media (max-width: 980px) {
    .globalsearch-results-inner {
        flex-direction: column;
        min-height: 0;
    }
    .globalsearch-results.has-summary .globalsearch-list-wrap {
        flex: 1 1 auto;
        border-right: none;
        border-bottom: 1px solid #f1f1f1;
    }
    .globalsearch-summary {
        padding: 14px;
    }
}

@media (max-width: 640px) {
    .globalsearch {
        max-width: 100%;
    }
    .globalsearch-thumb img {
        width: 90px;
        height: 90px;
    }
}
