/**
 * WooCommerce Quick Search Modal v2.3
 * Premium CSS with dynamic category filters, blurry background, large modal
 */

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --wqs-primary: #1a1a1a;
    --wqs-primary-hover: #000000;
    --wqs-accent: #ff6b35;
    --wqs-accent-hover: #e85a2a;
    --wqs-text-dark: #1a1a1a;
    --wqs-text-medium: #555555;
    --wqs-text-light: #999999;
    --wqs-border: #e8e8e8;
    --wqs-border-light: #f0f0f0;
    --wqs-bg-light: #fafafa;
    --wqs-bg-white: #ffffff;
    --wqs-shadow-xl: 0 25px 80px rgba(0, 0, 0, 0.3);
    --wqs-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --wqs-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --wqs-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --wqs-radius-lg: 20px;
    --wqs-radius-md: 12px;
    --wqs-radius-sm: 8px;
    --wqs-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MODAL CONTAINER - HIGHEST Z-INDEX
   ============================================ */
.wqs-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.wqs-modal.active {
    display: block !important;
    animation: wqs-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BLURRY BACKGROUND OVERLAY
   ============================================ */
.wqs-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    z-index: 1 !important;
    cursor: pointer;
}

/* ============================================
   MODAL WRAPPER
   ============================================ */
.wqs-modal-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* iOS Safari support - accounts for address bar */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
    padding: 40px 20px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    pointer-events: none;
}

/* ============================================
   MODAL CONTENT
   ============================================ */
.wqs-modal-content {
    background: var(--wqs-bg-white);
    border-radius: var(--wqs-radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    box-shadow: var(--wqs-shadow-xl);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: wqs-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    z-index: 3;
}

/* ============================================
   CLOSE BUTTON
   ============================================ */
.wqs-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--wqs-bg-light);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--wqs-text-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--wqs-transition);
    padding: 0;
}

.wqs-close-btn:hover {
    background: var(--wqs-primary);
    color: white;
    transform: rotate(90deg);
}

.wqs-close-btn svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   MODAL HEADER
   ============================================ */
.wqs-modal-header {
    padding: 40px 40px 24px 40px;
    text-align: center;
    border-bottom: 1px solid var(--wqs-border-light);
}

.wqs-modal-title {
    margin: 0 0 8px 0 !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    color: var(--wqs-text-dark) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.5px;
}

.wqs-modal-subtitle {
    margin: 0 !important;
    font-size: 15px !important;
    color: var(--wqs-text-light) !important;
    font-weight: 400 !important;
}

/* ============================================
   SEARCH INPUT
   ============================================ */
.wqs-search-input-wrapper {
    padding: 24px 40px 16px 40px;
    background: var(--wqs-bg-white);
}

.wqs-search-input-inner {
    position: relative;
    width: 100%;
}

.wqs-search-input {
    width: 100% !important;
    padding: 18px 52px 18px 52px !important;
    border: 2px solid var(--wqs-border) !important;
    border-radius: var(--wqs-radius-md) !important;
    font-size: 17px !important;
    font-family: inherit !important;
    color: var(--wqs-text-dark) !important;
    background: var(--wqs-bg-white) !important;
    transition: var(--wqs-transition) !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
}

.wqs-search-input:focus {
    outline: none !important;
    border-color: var(--wqs-primary) !important;
    box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.08) !important;
}

.wqs-search-input::placeholder {
    color: var(--wqs-text-light) !important;
    opacity: 1;
}

/* Icons positioned inside the inner box (which wraps the input) */
.wqs-search-icon {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--wqs-text-light) !important;
    pointer-events: none;
    z-index: 1;
    width: 22px !important;
    height: 22px !important;
}

.wqs-clear-btn {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: var(--wqs-bg-light) !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: var(--wqs-text-medium) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--wqs-transition) !important;
    padding: 0 !important;
    z-index: 2;
}

.wqs-clear-btn:hover {
    background: var(--wqs-primary) !important;
    color: white !important;
}

/* ============================================
   CATEGORY FILTERS - DYNAMIC
   ============================================ */
.wqs-filters-wrapper {
    padding: 0 40px 16px 40px;
    border-bottom: 1px solid var(--wqs-border-light);
}

.wqs-filters-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--wqs-text-medium) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 0 10px 0 !important;
}

.wqs-filters-label svg {
    color: var(--wqs-text-light);
    flex-shrink: 0;
}

.wqs-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px;
}

.wqs-filter-chip,
button.wqs-filter-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    background: var(--wqs-bg-light) !important;
    background-color: var(--wqs-bg-light) !important;
    background-image: none !important;
    border: 1.5px solid transparent !important;
    border-radius: 24px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--wqs-text-medium) !important;
    cursor: pointer !important;
    transition: var(--wqs-transition) !important;
    white-space: nowrap !important;
    font-family: inherit !important;
    line-height: 1 !important;
    user-select: none !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wqs-filter-chip:hover {
    background: var(--wqs-border) !important;
    color: var(--wqs-text-dark) !important;
    transform: translateY(-1px);
}

.wqs-filter-chip.active {
    background: var(--wqs-primary) !important;
    color: white !important;
    border-color: var(--wqs-primary) !important;
}

.wqs-filter-chip.active:hover {
    background: var(--wqs-primary-hover) !important;
}

.wqs-filter-chip-count {
    font-size: 11px !important;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.wqs-filter-chip.active .wqs-filter-chip-count {
    background: rgba(255, 255, 255, 0.2);
}

.wqs-filters-chips::-webkit-scrollbar {
    width: 4px;
}

.wqs-filters-chips::-webkit-scrollbar-track {
    background: transparent;
}

.wqs-filters-chips::-webkit-scrollbar-thumb {
    background: var(--wqs-border);
    border-radius: 2px;
}

/* ============================================
   RESULTS CONTAINER
   ============================================ */
.wqs-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px 24px 40px;
    min-height: 300px;
    max-height: 450px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.wqs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    text-align: center;
    padding: 40px 20px;
}

.wqs-empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--wqs-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wqs-text-light);
    margin-bottom: 20px;
}

.wqs-empty-title {
    margin: 0 0 8px 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--wqs-text-dark) !important;
}

.wqs-empty-text {
    margin: 0 !important;
    font-size: 14px !important;
    color: var(--wqs-text-light) !important;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.wqs-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.wqs-product-card {
    background: var(--wqs-bg-white);
    border: 1px solid var(--wqs-border-light);
    border-radius: var(--wqs-radius-md);
    overflow: hidden;
    transition: var(--wqs-transition);
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.wqs-product-card:hover {
    box-shadow: var(--wqs-shadow-lg);
    border-color: var(--wqs-primary);
    transform: translateY(-4px);
    text-decoration: none !important;
}

.wqs-product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--wqs-bg-light);
    overflow: hidden;
}

.wqs-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wqs-product-card:hover .wqs-product-image {
    transform: scale(1.08);
}

.wqs-product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--wqs-accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.wqs-product-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wqs-product-category {
    font-size: 11px !important;
    color: var(--wqs-text-light) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 0 6px 0 !important;
    font-weight: 600 !important;
}

.wqs-product-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--wqs-text-dark) !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wqs-product-price {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--wqs-text-dark) !important;
    margin-top: auto !important;
}

.wqs-product-price del {
    color: var(--wqs-text-light) !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    margin-right: 6px !important;
}

.wqs-product-price ins {
    text-decoration: none !important;
    color: var(--wqs-accent) !important;
}

.wqs-product-rating {
    font-size: 12px !important;
    color: var(--wqs-text-medium) !important;
    margin-top: 4px !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   NO RESULTS - WITH X ICON
   ============================================ */
.wqs-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    text-align: center;
    padding: 40px 20px;
}

.wqs-no-results-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--wqs-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wqs-text-light);
    margin-bottom: 20px;
}

.wqs-no-results-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

.wqs-no-results-title {
    margin: 0 0 8px 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--wqs-text-dark) !important;
}

.wqs-no-results-text {
    margin: 0 !important;
    font-size: 14px !important;
    color: var(--wqs-text-light) !important;
    max-width: 320px;
}

/* ============================================
   LOADING STATE
   ============================================ */
.wqs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 40px;
}

.wqs-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--wqs-border);
    border-top-color: var(--wqs-primary);
    border-radius: 50%;
    animation: wqs-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.wqs-loading-text {
    color: var(--wqs-text-light) !important;
    font-size: 14px !important;
    margin: 0 !important;
}

/* ============================================
   RESULTS COUNT
   ============================================ */
.wqs-results-count {
    font-size: 13px !important;
    color: var(--wqs-text-light) !important;
    margin: 0 0 16px 0 !important;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wqs-border-light);
}

.wqs-results-count strong {
    color: var(--wqs-text-dark) !important;
    font-weight: 600 !important;
}

/* ============================================
   FOOTER
   ============================================ */
.wqs-modal-footer {
    padding: 16px 40px;
    border-top: 1px solid var(--wqs-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--wqs-bg-light);
}

.wqs-footer-shortcuts {
    display: flex;
    gap: 16px;
    align-items: center;
}

.wqs-shortcut {
    font-size: 12px !important;
    color: var(--wqs-text-light) !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wqs-shortcut kbd {
    background: var(--wqs-bg-white) !important;
    border: 1px solid var(--wqs-border) !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    font-family: inherit !important;
    color: var(--wqs-text-medium) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.wqs-view-all-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--wqs-primary) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: var(--wqs-transition);
}

.wqs-view-all-link:hover {
    color: var(--wqs-accent) !important;
    gap: 10px;
}

/* ============================================
   TRIGGER ICON - JUST AN ICON, NO BUTTON
   ============================================ */
.wqs-trigger-btn,
span.wqs-trigger-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.wqs-trigger-btn:hover {
    opacity: 0.65 !important;
    transform: scale(1.1) !important;
}

.wqs-trigger-btn:active {
    transform: scale(0.95) !important;
    opacity: 1 !important;
}

.wqs-trigger-btn svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    fill: #000000 !important;
}

.wqs-trigger-btn svg path {
    fill: #000000 !important;
}

/* ============================================
   ELEMENTOR BUTTON WRAPPER OVERRIDE
   If shortcode is placed inside an Elementor button widget,
   strip the button's background/padding so only the icon shows
   ============================================ */
.elementor-button-wrapper:has(.wqs-trigger-btn),
.elementor-widget-button:has(.wqs-trigger-btn) .elementor-button-wrapper,
.elementor-widget-button:has(.wqs-trigger-btn) .elementor-button,
.elementor-button:has(.wqs-trigger-btn),
a.elementor-button:has(.wqs-trigger-btn),
.elementor-button-link:has(.wqs-trigger-btn),
.elementor-button-content-wrapper:has(.wqs-trigger-btn),
.elementor-button-text:has(.wqs-trigger-btn) {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto !important;
    height: auto !important;
    fill: transparent !important;
}

/* Fallback for browsers without :has() support - use parent classes */
.elementor-widget-button .elementor-button-wrapper .wqs-trigger-btn,
.elementor-button .wqs-trigger-btn {
    /* Force icon to display cleanly inside any wrapper */
    background: transparent !important;
}

/* If wrapped in any Elementor button structure, neutralize it */
.elementor-button-content-wrapper .wqs-trigger-btn,
.elementor-button-text .wqs-trigger-btn {
    display: inline-flex !important;
    background: transparent !important;
}

/* Override any link styling around the icon */
a:has(> .wqs-trigger-btn),
a:has(> svg + .wqs-trigger-btn) {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes wqs-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wqs-slide-up {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wqs-spin {
    to { transform: rotate(360deg); }
}

@keyframes wqs-card-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wqs-product-card {
    animation: wqs-card-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.wqs-product-card:nth-child(1) { animation-delay: 0.05s; }
.wqs-product-card:nth-child(2) { animation-delay: 0.1s; }
.wqs-product-card:nth-child(3) { animation-delay: 0.15s; }
.wqs-product-card:nth-child(4) { animation-delay: 0.2s; }
.wqs-product-card:nth-child(5) { animation-delay: 0.25s; }
.wqs-product-card:nth-child(6) { animation-delay: 0.3s; }
.wqs-product-card:nth-child(7) { animation-delay: 0.35s; }
.wqs-product-card:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.wqs-results::-webkit-scrollbar {
    width: 8px;
}

.wqs-results::-webkit-scrollbar-track {
    background: var(--wqs-bg-light);
    border-radius: 4px;
}

.wqs-results::-webkit-scrollbar-thumb {
    background: var(--wqs-border);
    border-radius: 4px;
}

.wqs-results::-webkit-scrollbar-thumb:hover {
    background: var(--wqs-text-light);
}

/* ============================================
   BODY LOCK
   ============================================ */
body.wqs-modal-open {
    overflow: hidden !important;
}

/* ============================================
   RESPONSIVE - TABLET (max-width: 968px)
   ============================================ */
@media (max-width: 968px) {
    .wqs-modal-content {
        max-width: 95%;
    }
    
    .wqs-modal-header {
        padding: 32px 24px 20px 24px;
    }
    
    .wqs-modal-title {
        font-size: 26px !important;
    }
    
    .wqs-search-input-wrapper {
        padding: 20px 24px 14px 24px;
    }
    
    .wqs-filters-wrapper {
        padding: 0 24px 14px 24px;
    }
    
    .wqs-results {
        padding: 18px 24px 24px 24px;
    }
    
    .wqs-modal-footer {
        padding: 14px 24px;
    }
    
    .wqs-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max-width: 640px)
   ============================================ */
@media (max-width: 640px) {
    .wqs-modal-wrapper {
        padding: 12px 10px !important;
    }
    
    .wqs-modal-content {
        max-width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 16px;
    }
    
    /* Header */
    .wqs-modal-header {
        padding: 24px 56px 14px 20px; /* extra right padding for close button */
        text-align: left;
    }
    
    .wqs-modal-title {
        font-size: 20px !important;
        margin: 0 0 4px 0 !important;
    }
    
    .wqs-modal-subtitle {
        font-size: 13px !important;
    }
    
    /* Close button */
    .wqs-close-btn {
        width: 36px !important;
        height: 36px !important;
        top: 14px !important;
        right: 14px !important;
    }
    
    .wqs-close-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* Search input */
    .wqs-search-input-wrapper {
        padding: 14px 16px 10px 16px;
    }
    
    .wqs-search-input {
        font-size: 16px !important; /* 16px prevents iOS zoom on focus */
        padding: 14px 46px 14px 44px !important;
    }
    
    .wqs-search-icon {
        left: 14px !important;
        width: 18px !important;
        height: 18px !important;
    }
    
    .wqs-clear-btn {
        right: 8px !important;
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Category filters - make chips fully visible on mobile */
    .wqs-filters-wrapper {
        padding: 0 16px 12px 16px;
    }
    
    .wqs-filters-label {
        font-size: 11px !important;
        margin: 0 0 8px 0 !important;
    }
    
    .wqs-filters-chips {
        gap: 6px;
    }
    
    .wqs-filter-chip {
        padding: 9px 14px !important; /* Larger for touch */
        font-size: 13px !important;
        min-height: 36px;
    }
    
    .wqs-filter-chip-count {
        font-size: 11px !important;
        padding: 2px 6px !important;
    }
    
    /* Results */
    .wqs-results {
        padding: 12px 16px 16px 16px;
        max-height: none;
        min-height: 200px;
    }
    
    .wqs-results-count {
        font-size: 12px !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px;
    }
    
    /* Products grid */
    .wqs-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .wqs-product-info {
        padding: 10px;
    }
    
    .wqs-product-category {
        font-size: 10px !important;
        margin: 0 0 4px 0 !important;
    }
    
    .wqs-product-title {
        font-size: 13px !important;
        margin: 0 0 6px 0 !important;
    }
    
    .wqs-product-price {
        font-size: 14px !important;
    }
    
    .wqs-product-rating {
        font-size: 11px !important;
    }
    
    .wqs-product-badge {
        font-size: 9px !important;
        padding: 3px 6px !important;
    }
    
    /* Empty / No results / Loading */
    .wqs-empty-state,
    .wqs-no-results,
    .wqs-loading {
        min-height: 200px;
        padding: 24px 16px;
    }
    
    .wqs-empty-icon,
    .wqs-no-results-icon {
        width: 72px;
        height: 72px;
        margin-bottom: 14px;
    }
    
    .wqs-empty-icon svg,
    .wqs-no-results-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .wqs-empty-title,
    .wqs-no-results-title {
        font-size: 17px !important;
    }
    
    .wqs-empty-text,
    .wqs-no-results-text {
        font-size: 13px !important;
    }
    
    /* Footer - hide keyboard shortcuts on mobile (no physical keyboards) */
    .wqs-modal-footer {
        padding: 12px 16px;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        align-items: center;
        min-height: 0;
    }
    
    .wqs-footer-shortcuts {
        display: none !important; /* Hidden on mobile - no keyboards */
    }
    
    .wqs-view-all-link {
        font-size: 13px !important;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
    .wqs-modal-wrapper {
        padding: 8px 6px !important;
    }
    
    .wqs-modal-content {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 12px;
    }
    
    .wqs-modal-header {
        padding: 20px 50px 12px 16px;
    }
    
    .wqs-modal-title {
        font-size: 18px !important;
    }
    
    .wqs-modal-subtitle {
        font-size: 12px !important;
    }
    
    .wqs-search-input-wrapper {
        padding: 12px 14px 8px 14px;
    }
    
    .wqs-filters-wrapper {
        padding: 0 14px 10px 14px;
    }
    
    .wqs-results {
        padding: 10px 14px 14px 14px;
    }
    
    .wqs-modal-footer {
        padding: 10px 14px;
    }
    
    /* On very small screens, stick with 2 columns but smaller */
    .wqs-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .wqs-product-info {
        padding: 8px;
    }
    
    .wqs-product-title {
        font-size: 12px !important;
        -webkit-line-clamp: 2;
    }
    
    .wqs-product-price {
        font-size: 13px !important;
    }
}

/* ============================================
   LANDSCAPE PHONES (height-constrained)
   ============================================ */
@media (max-width: 900px) and (max-height: 500px) {
    .wqs-modal-wrapper {
        padding: 8px !important;
    }
    
    .wqs-modal-content {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
    
    .wqs-modal-header {
        padding: 14px 50px 10px 16px;
    }
    
    .wqs-modal-title {
        font-size: 16px !important;
    }
    
    .wqs-modal-subtitle {
        display: none; /* Save space in landscape */
    }
    
    .wqs-search-input-wrapper {
        padding: 10px 16px 8px 16px;
    }
    
    .wqs-search-input {
        padding: 10px 44px 10px 42px !important;
        font-size: 15px !important;
    }
    
    .wqs-filters-wrapper {
        padding: 0 16px 8px 16px;
    }
    
    .wqs-filters-label {
        margin: 0 0 6px 0 !important;
    }
    
    .wqs-results {
        padding: 8px 16px 12px 16px;
        min-height: 120px;
    }
    
    .wqs-empty-state,
    .wqs-no-results,
    .wqs-loading {
        min-height: 120px;
        padding: 16px;
    }
    
    .wqs-empty-icon,
    .wqs-no-results-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 8px;
    }
    
    .wqs-empty-icon svg,
    .wqs-no-results-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .wqs-empty-title,
    .wqs-no-results-title {
        font-size: 14px !important;
    }
    
    .wqs-empty-text,
    .wqs-no-results-text {
        font-size: 12px !important;
    }
    
    .wqs-modal-footer {
        padding: 8px 16px;
    }
}

/* ============================================
   THEME COMPATIBILITY
   ============================================ */
.wqs-modal * {
    box-sizing: border-box;
}

.wqs-modal button {
    font-family: inherit;
}

.wqs-modal h2,
.wqs-modal h3,
.wqs-modal p {
    font-family: inherit;
}

.wqs-modal a {
    text-decoration: none;
}
