/* ===================================
   WooCommerce Advanced Search Modal
   =================================== */

/* --- Overlay --- */
.was-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

.was-overlay.was-open {
    display: flex;
    animation: wasOverlayIn 0.2s ease;
}

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

/* --- Modal Box --- */
.was-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 820px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: wasModalIn 0.22s cubic-bezier(0.4,0,0.2,1);
}

@keyframes wasModalIn {
    from { transform: translateY(-18px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* --- Search Bar --- */
.was-search-bar {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid #e9e9e9;
    gap: 10px;
    flex-shrink: 0;
    background: #fff;
}

.was-search-icon {
    color: #888;
    flex-shrink: 0;
}

.was-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: inherit;
    padding: 18px 0;
    background: transparent;
    color: #222;
}

.was-input::placeholder {
    color: #aaa;
}

.was-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.was-close-btn:hover {
    background: #f0f0f0;
    color: #222;
}

/* --- Body Layout --- */
.was-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Sidebar --- */
.was-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid #e9e9e9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

.was-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #222;
    padding: 16px 18px 10px;
    margin: 0;
    text-transform: uppercase;
}

.was-brand-search-wrap {
    display: flex;
    align-items: center;
    margin: 0 12px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    gap: 6px;
    background: #fff;
}

.was-brand-search-wrap svg {
    color: #aaa;
    flex-shrink: 0;
}

#was-brand-filter {
    border: none;
    outline: none;
    font-size: 12px;
    width: 100%;
    background: transparent;
    font-family: inherit;
    color: #333;
}

#was-brand-filter::placeholder {
    color: #bbb;
}

/* Brand List */
.was-brand-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 16px;
    overflow-y: auto;
    flex: 1;
}

.was-brand-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 18px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}

.was-brand-list li:hover {
    background: #f0f0f0;
}

.was-brand-list li input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #1a73e8;
    cursor: pointer;
    flex-shrink: 0;
}

.was-brand-list li label {
    cursor: pointer;
    flex: 1;
    user-select: none;
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.was-brand-count {
    color: #aaa;
    font-size: 11px;
    flex-shrink: 0;
}

.was-brand-loading {
    padding: 14px 18px;
    font-size: 12px;
    color: #aaa;
}

/* --- Results Panel --- */
.was-results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.was-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 1px solid #efefef;
    flex-shrink: 0;
    font-size: 13px;
    color: #666;
    background: #fff;
}

.was-view-all {
    font-size: 12px;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.was-view-all:hover {
    text-decoration: underline;
}

/* Product List */
.was-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.was-product-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #f3f3f3;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    cursor: pointer;
}

.was-product-item:hover {
    background: #f7f7f7;
}

.was-product-image {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
    background: #fafafa;
}

.was-product-info {
    flex: 1;
    min-width: 0;
}

.was-product-brand {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}

.was-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.was-product-sku {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
}

.was-product-price {
    font-size: 13px;
    color: #1a73e8;
    font-weight: 600;
}

.was-product-price ins {
    text-decoration: none;
}

.was-product-price del {
    color: #bbb;
    font-weight: 400;
    margin-left: 4px;
    font-size: 11px;
}

/* Stock badge */
.was-product-stock {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.was-in-stock  { background: #e8f5e9; color: #2e7d32; }
.was-out-stock { background: #fce4ec; color: #c62828; }

/* --- No Results --- */
.was-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ccc;
    gap: 12px;
    padding: 40px;
}

.was-no-results p {
    margin: 0;
    font-size: 14px;
    color: #aaa;
}

/* --- Spinner --- */
.was-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.was-spin {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: wasSpin 0.7s linear infinite;
}

@keyframes wasSpin {
    to { transform: rotate(360deg); }
}

/* --- Trigger Search Bar (shortcode / Elementor) --- */
.was-trigger-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1e2433;
    color: #9099b0;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
}

.was-trigger-bar:hover {
    background: #252c3d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.was-trigger-bar:focus {
    outline: 2px solid #e8a84c;
    outline-offset: 2px;
}

.was-trigger-bar__icon {
    color: #e8a84c;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.was-trigger-bar__placeholder {
    color: #9099b0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Legacy button (kept for backwards compat if used directly) */
.was-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    font-family: inherit;
}

.was-trigger-btn:hover {
    background: #1558b0;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .was-overlay {
        padding-top: 0;
        align-items: flex-start;
    }

    .was-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 0 0 14px 14px;
        max-height: 90vh;
    }

    .was-sidebar {
        display: none;
    }
}
