/* ==================== SEARCH MODAL: MODERN COMMAND PALETTE ==================== */

:root {
    --search-surface: #ffffff;
    --search-surface-soft: #f6f8fb;
    --search-surface-muted: #edf2f7;
    --search-border: #d9e2ec;
    --search-border-strong: #bfd0e2;
    --search-text: #122033;
    --search-text-muted: #5a6b7f;
    --search-text-soft: #8293a8;
    --search-brand: #0e5aa7;
    --search-brand-deep: #0a467f;
    --search-brand-soft: #eaf3ff;
    --search-success: #0f8f5f;
    --search-shadow-lg: 0 28px 70px rgba(10, 24, 40, 0.2);
    --search-shadow-md: 0 14px 34px rgba(10, 24, 40, 0.12);
    --search-radius-xl: 28px;
    --search-radius-lg: 20px;
    --search-radius-md: 14px;
    --search-radius-sm: 10px;
}

/* VisionPlus retail search refresh */
.search-modal-overlay { padding: 72px 24px 32px; background: rgba(15, 23, 42, .48); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.search-modal-container { width: min(1080px, 100%); max-height: calc(100dvh - 104px); border: 0; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(15, 23, 42, .22); }
.search-modal-header { align-items: center; padding: 22px 28px 14px; border-bottom: 0; background: #fff; }
.search-modal-title { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.02em; }
.search-modal-subtitle { margin-top: 4px; font-size: .86rem; }
.search-modal-close { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f5f6f8; }
.search-modal-content { gap: 14px; padding: 10px 28px 28px; }
.search-input-shell { border: 1.5px solid #172554; border-radius: 12px; background: #fff; box-shadow: none; }
.search-input-shell:focus-within { border-color: #135da6; box-shadow: 0 0 0 3px rgba(19, 93, 166, .1); }
.search-modal-input { height: 56px; border-radius: 12px; font-size: .96rem; }
.search-helper-status { padding: 0; background: transparent; color: #64748b; }
.search-controls { padding: 2px 0; }
.search-sort-btn { padding: 8px 13px; border-radius: 8px; }
.search-sort-btn.active { background: #172554; border-color: #172554; box-shadow: none; }
.search-results-list { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.search-results-list:empty { display: none !important; }
.search-product-item { grid-template-columns: 112px minmax(0, 1fr); min-height: 136px; padding: 10px; border-color: #e7eaf0; border-radius: 12px; box-shadow: none; }
.search-product-item:hover { border-color: #a9bfd8; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 35, 64, .08); }
.search-product-image { width: 112px; border-radius: 9px; background: #f6f7f9; }
.search-product-name { font-size: .94rem; }
.search-product-trailing { display: none; }
.search-popular-products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.search-popular-item { padding: 9px; border-radius: 12px; box-shadow: none; }
.search-popular-item-media { aspect-ratio: 4 / 3; border-radius: 9px; background: #f6f7f9; }
.search-suggestions { border-radius: 12px; box-shadow: 0 16px 36px rgba(15, 23, 42, .14); }

@media (max-width: 767px) {
    .search-modal-overlay { align-items: flex-end; padding: 0; background: rgba(15, 23, 42, .42); }
    .search-modal-container { width: 100%; height: min(94dvh, 820px); max-height: 94dvh; border-radius: 20px 20px 0 0; }
    .search-modal-header { padding: 18px 18px 10px; }
    .search-modal-header-copy { padding-right: 42px; }
    .search-modal-title { font-size: 1.18rem; }
    .search-modal-subtitle { font-size: .78rem; }
    .search-modal-header-actions { top: 16px; right: 16px; }
    .search-modal-content { padding: 10px 16px 20px; }
    .search-results-list { grid-template-columns: 1fr; }
    .search-product-item { grid-template-columns: 86px minmax(0, 1fr); min-height: 106px; }
    .search-product-image { width: 86px; }
    .search-popular-products { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44vw); grid-template-columns: none; }
}

@keyframes searchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes searchRiseIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes searchSkeletonPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

body.search-modal-open {
    overflow: hidden;
}

.search-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px 24px;
    background:
        radial-gradient(circle at top center, rgba(17, 83, 155, 0.16), transparent 34%),
        rgba(5, 15, 27, 0.62);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: searchFadeIn 0.2s ease;
}

.search-modal-overlay.active {
    display: flex;
}

.search-modal-container {
    width: min(980px, 100%);
    max-height: calc(100vh - 72px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 249, 252, 0.98));
    color: var(--search-text);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--search-radius-xl);
    box-shadow: var(--search-shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: searchRiseIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 28px 18px;
    border-bottom: 1px solid rgba(191, 208, 226, 0.5);
    background:
        linear-gradient(180deg, rgba(14, 90, 167, 0.06), rgba(14, 90, 167, 0)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.96));
}

.search-modal-header-copy {
    min-width: 0;
}

.search-modal-kicker {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--search-brand-soft);
    color: var(--search-brand);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.search-modal-title {
    margin: 0;
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    line-height: 1.05;
    font-weight: 700;
    color: var(--search-text);
}

.search-modal-subtitle {
    margin: 10px 0 0;
    max-width: 620px;
    color: var(--search-text-muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.search-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-modal-shortcuts {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--search-text-soft);
    font-size: 0.78rem;
}

.search-modal-shortcuts span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-modal-shortcuts kbd {
    min-width: 28px;
    padding: 4px 7px;
    border-radius: 8px;
    border: 1px solid var(--search-border);
    background: #fff;
    color: var(--search-text);
    font-size: 0.76rem;
    font-weight: 700;
    box-shadow: inset 0 -2px 0 rgba(18, 32, 51, 0.06);
}

.search-modal-close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--search-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--search-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.search-modal-close:hover {
    transform: translateY(-1px);
    border-color: var(--search-brand);
    color: var(--search-brand);
    background: #fff;
}

.search-modal-content {
    padding: 22px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.search-input-wrapper {
    position: relative;
}

.search-input-shell {
    position: relative;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98));
    border: 1px solid rgba(191, 208, 226, 0.85);
    box-shadow:
        0 14px 30px rgba(10, 24, 40, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.search-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--search-brand);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.search-modal-input {
    width: 100%;
    height: 64px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: transparent;
    color: var(--search-text);
    font-size: 1rem;
    font-weight: 500;
    padding: 0 56px 0 54px;
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-modal-input::placeholder {
    color: #8ca0b8;
}

.search-modal-input:focus {
    outline: none;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.search-input-shell:focus-within {
    border-color: rgba(14, 90, 167, 0.42);
    box-shadow:
        0 0 0 4px rgba(14, 90, 167, 0.1),
        0 18px 34px rgba(10, 24, 40, 0.12);
}

.search-input-shell:focus-within .search-input-icon {
    color: var(--search-brand-deep);
    transform: translateY(-50%) scale(1.04);
}

.search-modal-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--search-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.search-modal-clear:hover {
    background: rgba(18, 32, 51, 0.06);
    color: var(--search-text);
}

.search-helper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.search-helper-text {
    color: var(--search-text-muted);
    font-size: 0.88rem;
}

.search-helper-text strong {
    color: var(--search-brand-deep);
    font-weight: 700;
}

.search-helper-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--search-surface-soft);
    color: var(--search-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(191, 208, 226, 0.8);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.985);
    box-shadow: 0 22px 40px rgba(10, 24, 40, 0.16);
    z-index: 10001;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-suggestions.active {
    display: flex;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--search-text-muted);
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.search-suggestion-item:hover,
.search-suggestion-item.is-active {
    background: linear-gradient(180deg, #f6fbff, #eef6ff);
    border-color: rgba(14, 90, 167, 0.18);
    color: var(--search-brand-deep);
    transform: translateX(2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.search-suggestion-item i {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #f3f7fb;
    color: var(--search-brand);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-suggestion-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.search-suggestion-text {
    color: var(--search-text);
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.3;
}

.search-suggestion-meta {
    color: var(--search-text-soft);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.3;
}

.search-controls {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 0 4px;
}

.search-controls label {
    margin: 0;
    color: var(--search-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.search-sort-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-sort-btn {
    border: 1px solid var(--search-border);
    background: #fff;
    color: var(--search-text-muted);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.search-sort-btn:hover {
    border-color: var(--search-brand);
    color: var(--search-brand);
    transform: translateY(-1px);
}

.search-sort-btn.active {
    background: var(--search-brand);
    border-color: var(--search-brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(14, 90, 167, 0.22);
}

.search-results-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 240px;
}

.search-empty-state,
.search-no-results {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 8px 0 0;
}

.search-empty-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--search-border);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, var(--search-surface-soft));
}

.search-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #edf5ff, #dfeeff);
    color: var(--search-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.35rem;
}

.search-empty-hero p,
.search-no-results p {
    margin: 0;
    color: var(--search-text);
    font-size: 1.02rem;
    font-weight: 700;
}

.search-empty-hero small,
.search-no-results small {
    display: block;
    margin-top: 4px;
    color: var(--search-text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.search-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.search-section-heading span {
    color: var(--search-text);
    font-size: 0.9rem;
    font-weight: 700;
}

.search-text-action {
    border: none;
    background: transparent;
    color: var(--search-brand);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.search-recent-list,
.search-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-recent-chip,
.search-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--search-border);
    border-radius: 999px;
    background: #fff;
    color: var(--search-text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.search-recent-chip:hover,
.search-category-chip:hover {
    border-color: var(--search-brand);
    color: var(--search-brand-deep);
    background: var(--search-brand-soft);
    transform: translateY(-1px);
}

.search-category-chip.is-accent {
    background: var(--search-brand);
    border-color: var(--search-brand);
    color: #fff;
}

.search-popular-products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.search-popular-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--search-border);
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.search-popular-item:hover {
    transform: translateY(-2px);
    border-color: var(--search-border-strong);
    box-shadow: var(--search-shadow-md);
}

.search-popular-item-media {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--search-surface-soft);
}

.search-popular-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-popular-item-name {
    color: var(--search-text);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.search-popular-item-price {
    color: var(--search-brand);
    font-size: 0.84rem;
    font-weight: 700;
}

.search-loading-state {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-skeleton {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--search-border);
    border-radius: 18px;
    background: #fff;
}

.search-skeleton-image,
.search-skeleton-line {
    background: linear-gradient(90deg, #e8edf3, #f4f7fa, #e8edf3);
    background-size: 200% 100%;
    animation: searchSkeletonPulse 1.2s ease-in-out infinite;
}

.search-skeleton-image {
    width: 92px;
    height: 92px;
    border-radius: 16px;
    flex-shrink: 0;
}

.search-skeleton-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.search-skeleton-line {
    height: 14px;
    border-radius: 999px;
}

.search-skeleton-line.short {
    width: 56%;
}

.search-skeleton-line.tiny {
    width: 32%;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-product-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--search-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-product-item:hover {
    transform: translateY(-2px);
    border-color: var(--search-border-strong);
    box-shadow: var(--search-shadow-md);
}

.search-product-image {
    position: relative;
    width: 108px;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--search-surface-soft);
}

.search-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-product-badges {
    position: absolute;
    inset: 8px auto auto 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    max-width: calc(100% - 16px);
}

.search-product-badge {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(10, 24, 40, 0.14);
}

.search-product-badge.new { background: #0f8f5f; }
.search-product-badge.bestseller { background: #d97706; }
.search-product-badge.sale,
.search-product-badge.trending { background: #0e5aa7; }

.search-product-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-product-overline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-product-category {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--search-surface-soft);
    color: var(--search-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.search-product-stock {
    color: var(--search-success);
    font-size: 0.74rem;
    font-weight: 700;
}

.search-product-name {
    margin: 0;
    color: var(--search-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.search-product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.search-product-price {
    color: var(--search-brand);
    font-size: 1rem;
    font-weight: 800;
}

.search-product-price-original {
    color: var(--search-text-soft);
    font-size: 0.84rem;
    text-decoration: line-through;
}

.search-product-caption {
    color: var(--search-text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.search-product-trailing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--search-brand-soft);
    color: var(--search-brand);
    font-size: 1rem;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.search-product-item:hover .search-product-trailing {
    transform: translateX(2px);
    background: var(--search-brand);
    color: #fff;
}

.search-no-results {
    align-items: flex-start;
}

.search-category-links-inline {
    margin-top: 4px;
}

.search-modal-content::-webkit-scrollbar {
    width: 8px;
}

.search-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.search-modal-content::-webkit-scrollbar-thumb {
    background: rgba(130, 147, 168, 0.5);
    border-radius: 999px;
}

.search-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(90, 107, 127, 0.7);
}

@media (max-width: 991px) {
    .search-modal-overlay {
        align-items: flex-end;
        padding: 12px 12px 0;
    }

    .search-modal-container {
        width: 100%;
        max-height: calc(100vh - 12px);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .search-modal-header {
        padding: 22px 20px 16px;
    }

    .search-modal-content {
        padding: 18px 20px 22px;
    }

    .search-popular-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .search-modal-overlay {
        padding: 14px 10px;
        align-items: center;
        justify-content: center;
    }

    .search-modal-container {
        width: min(100%, 560px);
        max-width: 560px;
        height: min(88dvh, 780px);
        max-height: min(88dvh, 780px);
        min-height: 0;
        border-radius: 24px;
    }

    .search-modal-header {
        align-items: flex-start;
        gap: 0;
        padding: 12px 14px 8px;
        position: relative;
    }

    .search-modal-header::before {
        display: none;
    }

    .search-modal-header-copy {
        width: 100%;
        padding-right: 52px;
    }

    .search-modal-kicker {
        display: none;
    }

    .search-modal-header-actions {
        position: absolute;
        top: 14px;
        right: 14px;
        justify-content: flex-end;
        align-items: flex-start;
    }

    .search-modal-shortcuts {
        display: none;
    }

    .search-modal-title {
        font-size: 1.15rem;
        line-height: 1.15;
    }

    .search-modal-subtitle {
        margin-top: 4px;
        max-width: 260px;
        font-size: 0.76rem;
        line-height: 1.35;
    }

    .search-modal-content {
        flex: 1;
        padding: 10px 14px 14px;
        gap: 10px;
    }

    .search-modal-input {
        height: 56px;
        border-radius: 16px;
        font-size: 16px;
        padding: 0 50px 0 46px;
    }

    .search-input-icon {
        left: 16px;
    }

    .search-modal-clear {
        right: 9px;
        width: 34px;
        height: 34px;
    }

    .search-suggestions {
        top: calc(100% + 8px);
        padding: 8px;
        border-radius: 16px;
        max-height: min(38vh, 260px);
        overflow-y: auto;
    }

    .search-helper-row {
        align-items: flex-start;
        gap: 6px;
    }

    .search-helper-text,
    .search-helper-status {
        width: 100%;
    }

    .search-helper-text {
        display: none;
    }

    .search-helper-status {
        justify-content: center;
        text-align: center;
        padding: 6px 10px;
        font-size: 0.74rem;
    }

    .search-controls {
        gap: 8px;
    }

    .search-controls label {
        width: auto;
        margin-right: 2px;
        font-size: 0.72rem;
        letter-spacing: 0.08em;
    }

    .search-sort-group {
        display: flex;
        flex: 1;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .search-sort-group::-webkit-scrollbar {
        display: none;
    }

    .search-sort-btn {
        flex: 0 0 auto;
        min-width: max-content;
        padding: 10px 14px;
        border-radius: 999px;
        font-size: 0.8rem;
        box-shadow: none;
    }

    .search-empty-hero {
        display: none;
    }

    .search-popular-products {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(148px, 42vw);
        grid-template-columns: none;
        gap: 10px;
        overflow-x: auto;
        padding: 2px 2px 8px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .search-popular-products::-webkit-scrollbar {
        display: none;
    }

    .search-popular-item {
        gap: 8px;
        min-height: 100%;
        padding: 10px;
        border-radius: 16px;
        scroll-snap-align: start;
    }

    .search-popular-item-media {
        border-radius: 12px;
    }

    .search-popular-item-name {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .search-popular-item-price {
        font-size: 0.78rem;
    }

    .search-product-item {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
        align-items: flex-start;
        border-radius: 16px;
    }

    .search-product-image {
        width: 72px;
        border-radius: 12px;
    }

    .search-product-badges {
        inset: 6px auto auto 6px;
        gap: 3px;
        max-width: calc(100% - 12px);
    }

    .search-product-badge {
        padding: 3px 6px;
        font-size: 0.54rem;
        box-shadow: 0 6px 12px rgba(10, 24, 40, 0.12);
    }

    .search-product-trailing {
        display: none;
    }

    .search-product-name {
        font-size: 0.88rem;
    }

    .search-product-caption {
        font-size: 0.75rem;
    }

    .search-product-category {
        min-height: 24px;
        padding: 0 8px;
        font-size: 0.65rem;
    }

    .search-product-stock {
        font-size: 0.67rem;
    }

    .search-product-price {
        font-size: 0.9rem;
    }

    .search-skeleton {
        gap: 12px;
        padding: 12px;
    }

    .search-skeleton-image {
        width: 78px;
        height: 78px;
        border-radius: 14px;
    }
}

@media (max-width: 479px) {
    .search-modal-overlay {
        padding: 12px 8px;
    }

    .search-modal-container {
        width: min(100%, 520px);
        max-width: 520px;
        height: min(90dvh, 760px);
        max-height: min(90dvh, 760px);
        min-height: 0;
        border-radius: 22px;
    }

    .search-modal-header {
        padding: 12px 12px 10px;
    }

    .search-modal-header-copy {
        padding-right: 46px;
    }

    .search-modal-content {
        padding: 10px 12px 14px;
    }

    .search-modal-title {
        font-size: 1.06rem;
    }

    .search-modal-subtitle {
        max-width: 220px;
        font-size: 0.72rem;
    }

    .search-modal-close {
        width: 34px;
        height: 34px;
    }

    .search-helper-text {
        font-size: 0.82rem;
    }

    .search-helper-status {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .search-controls {
        align-items: center;
    }

    .search-controls label {
        width: 100%;
        margin-right: 0;
    }

    .search-sort-group {
        gap: 6px;
    }

    .search-results-container {
        min-height: 0;
    }

    .search-recent-list,
    .search-category-links {
        gap: 8px;
    }

    .search-recent-chip,
    .search-category-chip {
        min-height: 36px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .search-empty-icon {
        width: 50px;
        height: 50px;
        border-radius: 16px;
        font-size: 1.2rem;
    }

    .search-empty-hero p,
    .search-no-results p {
        font-size: 0.95rem;
    }

    .search-empty-hero small,
    .search-no-results small {
        font-size: 0.82rem;
    }

    .search-popular-products {
        grid-auto-columns: minmax(134px, 52vw);
    }

    .search-product-item {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 9px;
    }

    .search-product-image {
        width: 64px;
    }

    .search-product-badge {
        font-size: 0.5rem;
    }

    .search-product-category {
        min-height: 24px;
        padding: 0 8px;
        font-size: 0.67rem;
    }

    .search-product-stock {
        font-size: 0.7rem;
    }

    .search-product-price {
        font-size: 0.92rem;
    }

    .search-product-price-original,
    .search-product-caption {
        font-size: 0.78rem;
    }
}

/* Final overrides intentionally scoped after the legacy search theme. */
#searchModalOverlay.search-modal-overlay { padding: 72px 24px 32px; background: rgba(15, 23, 42, .48); backdrop-filter: blur(8px); }
#searchModalOverlay .search-modal-container { width: min(1080px, 100%); max-height: calc(100dvh - 104px); border: 0; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(15, 23, 42, .22); }
#searchModalOverlay .search-modal-header { align-items: center; padding: 22px 28px 14px; border-bottom: 0; background: #fff; }
#searchModalOverlay .search-modal-title { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.02em; }
#searchModalOverlay .search-modal-subtitle { margin-top: 4px; font-size: .86rem; }
#searchModalOverlay .search-modal-close { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f5f6f8; }
#searchModalOverlay .search-modal-content { gap: 14px; padding: 10px 28px 28px; }
#searchModalOverlay .search-input-shell { border: 1.5px solid #172554; border-radius: 12px; background: #fff; box-shadow: none; }
#searchModalOverlay .search-input-shell:focus-within { border-color: #135da6; box-shadow: 0 0 0 3px rgba(19, 93, 166, .1); }
#searchModalOverlay .search-modal-input { height: 56px; border-radius: 12px; font-size: .96rem; }
#searchModalOverlay .search-helper-status { padding: 0; background: transparent; color: #64748b; }
#searchModalOverlay .search-sort-btn { padding: 8px 13px; border-radius: 8px; }
#searchModalOverlay .search-sort-btn.active { background: #172554; border-color: #172554; box-shadow: none; }
#searchModalOverlay .search-results-list { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#searchModalOverlay .search-results-list:empty { display: none !important; }
#searchModalOverlay .search-product-item { grid-template-columns: 112px minmax(0, 1fr); min-height: 136px; padding: 10px; border-color: #e7eaf0; border-radius: 12px; box-shadow: none; }
#searchModalOverlay .search-product-item:hover { border-color: #a9bfd8; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 35, 64, .08); }
#searchModalOverlay .search-product-image { width: 112px; border-radius: 9px; background: #f6f7f9; }
#searchModalOverlay .search-product-trailing { display: none; }
#searchModalOverlay .search-popular-products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#searchModalOverlay .search-popular-item { padding: 9px; border-radius: 12px; box-shadow: none; }
#searchModalOverlay .search-popular-item-media { aspect-ratio: 4 / 3; border-radius: 9px; background: #f6f7f9; }
#searchModalOverlay .search-suggestion-image { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 8px; object-fit: contain; background: #f5f6f8; }
#searchModalOverlay .search-suggestion-type { margin-left: auto; color: #135da6; font-size: .72rem; font-weight: 700; }

@media (max-width: 767px) {
    #searchModalOverlay.search-modal-overlay { align-items: flex-end; padding: 0; }
    #searchModalOverlay .search-modal-container { width: 100%; height: min(94dvh, 820px); max-height: 94dvh; border-radius: 20px 20px 0 0; }
    #searchModalOverlay .search-modal-header { padding: 18px 18px 10px; }
    #searchModalOverlay .search-modal-header-copy { padding-right: 42px; }
    #searchModalOverlay .search-modal-title { font-size: 1.18rem; }
    #searchModalOverlay .search-modal-subtitle { font-size: .78rem; }
    #searchModalOverlay .search-modal-header-actions { top: 16px; right: 16px; }
    #searchModalOverlay .search-modal-content { padding: 10px 16px 20px; }
    #searchModalOverlay .search-results-list { grid-template-columns: 1fr; }
    #searchModalOverlay .search-product-item { grid-template-columns: 86px minmax(0, 1fr); min-height: 106px; }
    #searchModalOverlay .search-product-image { width: 86px; }
    #searchModalOverlay .search-popular-products { grid-auto-columns: minmax(150px, 44vw); grid-template-columns: none; }
}
