/* ════════════════════════════════════════════
   STORE SEARCH BAR — Responsive Final
   Works: Desktop · Tablet · Mobile · 360px
════════════════════════════════════════════ */

/* Wrapper — sits inside your header */
.store-search-wrapper {
    position: relative;
    flex: 1 1 200px;
    min-width: 0;
    margin: 8px 12px 8px 12px; /* breathing room from header edge */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── The bar ── */
.store-search-bar {
    display: flex;
    align-items: center;
    height: 46px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-search-bar:focus-within {
    border-color: #e8750a;
    box-shadow: 0 0 0 3px rgba(232, 117, 10, 0.15);
}

/* Left icon */
.store-search-bar__icon {
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    pointer-events: none;
    flex-shrink: 0;
}

.store-search-bar__icon svg {
    width: 17px;
    height: 17px;
}

/* Input — hard reset for theme conflicts */
#store-search {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;            /* lets flexbox control width */
    height: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 14px !important;
    color: #222 !important;
    padding: 0 6px 0 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    -webkit-appearance: none;
}

#store-search::placeholder {
    color: #bbb;
}

/* Button */
#store-search-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    padding: 0 18px;
    background: #e8750a;
    border: none !important;
    border-radius: 0 6px 6px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease;
    line-height: 1;
}

#store-search-btn:hover,
#store-search-btn:focus {
    background: #cf6809;
    outline: none;
}

#store-search-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Dropdown ── */
#store-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 99999;
}

#store-suggestions::-webkit-scrollbar { width: 4px; }
#store-suggestions::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

/* Result row */
.store-item-search {
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.12s ease;
}

.store-item-search:last-of-type { border-bottom: none; }

.store-item-search a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    text-decoration: none !important;
    color: inherit !important;
}

.store-item-search:hover,
.store-item-search.is-active {
    background: #fff8f3;
}

/* Logo box */
.store-image-search {
    flex: 0 0 56px;
    width: 56px;
    height: 38px;
    background: #f7f7f7;
    border: 1px solid #eee;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
    flex-shrink: 0;
}

.store-logo-search {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Text */
.store-details-search {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.store-title-search {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-title-search mark {
    background: #fff2cc;
    color: #111;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: 700;
}

.store-coupons-search {
    display: block;
    font-size: 12px;
    color: #e8750a;
    font-weight: 500;
}

/* Arrow */
.store-arrow-search {
    flex: 0 0 auto;
    color: #d0d0d0;
    font-size: 18px;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.store-item-search:hover .store-arrow-search,
.store-item-search.is-active .store-arrow-search {
    color: #e8750a;
    transform: translateX(2px);
}

/* Footer */
.store-search-footer {
    padding: 9px 14px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.store-search-all-link {
    font-size: 13px;
    color: #e8750a;
    text-decoration: none;
    font-weight: 500;
}

.store-search-all-link:hover { text-decoration: underline; }

/* Empty state */
.store-search-empty {
    padding: 26px 16px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* Loading dots */
.store-search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px;
}

.store-search-loading span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e8750a;
    opacity: 0.3;
    animation: ssdot 1.2s infinite ease-in-out;
}

.store-search-loading span:nth-child(2) { animation-delay: .2s; }
.store-search-loading span:nth-child(3) { animation-delay: .4s; }

@keyframes ssdot {
    0%, 80%, 100% { transform: scale(.55); opacity: .3; }
    40%           { transform: scale(1);   opacity: 1;  }
}

/* ════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
════════════════════════════════════════════ */

/* Tablet ≤ 768px */
@media (max-width: 768px) {
    .store-search-bar { height: 44px; }
    .store-search-bar__icon { flex: 0 0 38px; }
    #store-search-btn { padding: 0 14px; }
    .store-search-btn__text { display: none; }
    #store-search-btn svg { width: 16px; height: 16px; }
}

/* Mobile ≤ 480px */
@media (max-width: 480px) {
    .store-search-bar { height: 42px; border-radius: 7px; }
    .store-search-bar__icon { flex: 0 0 34px; }
    .store-search-bar__icon svg { width: 15px; height: 15px; }
    #store-search { font-size: 13px !important; }
    #store-search-btn { padding: 0 12px; border-radius: 0 5px 5px 0; }
    #store-search-btn svg { width: 15px; height: 15px; }
    .store-item-search a { padding: 8px 12px; gap: 10px; }
    .store-image-search { flex: 0 0 44px; width: 44px; height: 32px; }
    .store-title-search { font-size: 13px; }
    .store-coupons-search { font-size: 11px; }
    .store-arrow-search { display: none; }
}

/* Very small ≤ 360px */
@media (max-width: 360px) {
    .store-search-bar__icon { flex: 0 0 30px; }
    #store-search-btn { padding: 0 10px; }
    .store-image-search { flex: 0 0 38px; width: 38px; height: 28px; }
}
