/* =========================
   INLINE HEADER SEARCH
========================= */

.header_search {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header_search_hold {
    width: 100%;
    max-width: 450px;
    display: flex;
}

.header_search input,
.mobile_search input {
    width: 100%;
    height: var(--header-search-h);
    border: 1px solid #e5e7eb;
    border-right: none;
    padding: 0 15px;
    font-size: 15px;
    border-radius: 10px 0 0 10px;
    transition: .25s;
}

.header_search input:focus,
.mobile_search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .12);
}

.search_btn {
    width: 55px;
    height: var(--header-search-h);
    border: none;
    background: var(--brand);
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .25s;
    position: relative;
}

.search_btn:hover { background: var(--brand-hover); }

.search_btn svg {
    width: 22px;
    height: 22px;
}

/* SVG icon stroke (moved out of the inline <style> in markup) */
.search_btn .cls-1 { stroke: black; fill: transparent; }

.search_btn.active {
    background: var(--danger);
}

.search_btn.active svg { opacity: 0; }

.search_btn.active::after {
    content: "✕";
    position: absolute;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

/* =========================
   MOBILE SEARCH
========================= */

.mobile_search { display: none; }

/* =========================
   SEARCH DROPDOWN OVERLAY
========================= */

.search_dropdown {
    position: fixed;
    top: var(--header-stack);
    left: 0;
    width: 100%;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .3s ease;
    z-index: 1101;
    border-top: 1px solid var(--line);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .08);
    max-height: 80vh;
    overflow-y: auto;
}

.search_active .search_dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search_dropdown_inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 30px 20px 35px;
}

.search_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
    grid-column: 1 / -1;
}

.search_header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.search_header h3 span {
    color: var(--brand);
    background: rgba(255, 122, 0, 0.08);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin-left: 8px;
    font-weight: 600;
}

.search_header .search_count {
    font-size: 13px;
    color: #999;
    font-weight: 400;
}

.search_results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.search_item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    transition: all .3s ease;
}

.search_item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
    border-color: #e0e0e0;
}

.search_item a {
    display: block;
    text-decoration: none;
    color: #111;
    padding: 0;
}

.search_item .product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.search_item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .3s ease;
}

.search_item:hover .product-image img {
    transform: scale(1.05);
}

.search_item .product-info {
    padding: 14px 16px 16px;
    background: #fff;
}

.search_item .product-info .product-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 6px 0;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}

.search_item .product-info .product-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand);
    margin: 0;
}

.search_foot {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.search_view_all {
    text-decoration: none;
    color: #fff;
    background: var(--brand);
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    transition: all .25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search_view_all:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 122, 0, .25);
}

.search_view_all::after {
    content: "→";
    font-size: 16px;
    transition: transform .25s ease;
}

.search_view_all:hover::after {
    transform: translateX(4px);
}

/* Loading */
.search-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

.search-loading::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid var(--line);
    border-top: 2px solid var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty */
.search-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.search-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.search-empty h4 {
    font-size: 16px;
    color: var(--ink);
    margin: 0 0 6px 0;
    font-weight: 600;
}

.search-empty p {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* Scrollbar for search dropdown only */
.search_dropdown::-webkit-scrollbar { width: 4px; }
.search_dropdown::-webkit-scrollbar-track { background: transparent; }
.search_dropdown::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 2px;
}
.search_dropdown::-webkit-scrollbar-thumb:hover { background: #ccc; }
/* =========================
   INLINE SEARCH — premium look
========================= */

.header_search {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.header_search_hold {
    width: 100%;
    max-width: 520px;
    display: flex;
}

.header_search input {
    width: 100%;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-right: none;
    background: #f8fafc;
    padding: 0 16px;
    font-size: 14px;
    color: #0f172a;
    border-radius: 12px 0 0 12px;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.header_search input::placeholder { color: #94a3b8; }
.header_search input:focus {
    outline: none;
    background: #fff;
    border-color: #ff7a00;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .12);
}

.search_btn {
    width: 52px;
    height: 44px;
    border: none;
    background: #ff7a00;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s;
    position: relative;
}
.search_btn:hover  { background: #ea6e00; }
.search_btn:active { transform: scale(.97); }
.search_btn svg   { width: 20px; height: 20px; }
.search_btn .cls-1 { stroke: black; }

.search_btn.active { background: #e11d48; }
.search_btn.active svg { opacity: 0; }
.search_btn.active::after {
    content: "✕";
    position: absolute;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}