/* Mobile Search Modal Product Cards - Reference Design Implementation */
/* Only apply styles on mobile devices ≤ 1088px */

@media (max-width: 1088px) {
    /* CSS Custom Properties for consistent theming */
    .search-products-container {
        --brand-orange: #f47920;
        --text-dark: #2b2f3a;
        --muted: #9aa3af;
        --link-muted: #5f6b7a;
        --old-gray: #b7bdc8;
        --row-border: #f0f0f0;
    }
    
    /* Enhanced single-column layout - override desktop grid completely */
    .search-products-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        margin-top: 12px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Mobile search result card - clean single-line layout */
    .search-product-item {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border: none;
        border-bottom: none; /* Remove border - using internal separator */
        border-radius: 0;
        margin: 0 !important;
        padding: 12px 0; /* Match reference padding */
        transition: background-color 0.2s ease;
        flex: none !important;
        float: none !important;
        clear: both !important;
        position: relative;
        box-sizing: border-box;
    }
    

    .search-product-item:last-child {
        border-bottom: none;
    }
    
    /* Reference Design: sr-link (Product anchor) */
    .search-product-item .product-link {
        display: block;
        text-decoration: none;
        color: inherit;
        padding: 0;
        margin-bottom: 0;
    }
    
    /* Reference Design: sr-head (Inline head: image | title+prices) */
    .search-product-item .sr-head {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }
    
    /* Reference Design: sr-thumb (56x56px thumbnail) */
    .search-product-item .product-image-wrapper,
    .search-product-item .sr-thumb {
        width: 56px;
        height: 56px;
        border-radius: 4px; /* Match reference exactly */
        overflow: hidden;
        background: #f2f2f2; /* Match reference background */
        flex: 0 0 auto; /* No grow/shrink */
        position: relative;
    }
    
    .search-product-item .product-image,
    .search-product-item .sr-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    
    /* Badge for product variants (5 in 1, etc.) */
    .search-product-item .product-badge {
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--brand-orange);
        color: white;
        font-size: 9px;
        font-weight: 600;
        padding: 2px 6px;
        border-radius: 2px;
        white-space: nowrap;
        z-index: 2;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    /* Reference Design: sr-content (Flex container for title+price) */
    .search-product-item .product-info,
    .search-product-item .sr-content {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* Reference Design: sr-top (Title and price alignment) */
    .search-product-item .sr-top {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }
    
    /* Reference Design: sr-title (2-line clamp title) */
    .search-product-item .product-name,
    .search-product-item .sr-title {
        margin: 0;
        color: var(--text-dark);
        font-size: 14px;
        font-weight: 600; /* Match reference weight */
        line-height: 1.25; /* Match reference line-height */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* Reference Design: sr-price (Right-aligned price stack) */
    .search-product-item .product-price,
    .search-product-item .sr-price {
        text-align: right;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Reference Design: sr-old (Strikethrough old price) */
    .search-product-item .price-regular,
    .search-product-item .sr-old {
        display: block;
        color: var(--old-gray);
        text-decoration: line-through;
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    /* Reference Design: sr-new (Bold orange new price) */
    .search-product-item .price-special,
    .search-product-item .price-current,
    .search-product-item .sr-new {
        display: block;
        color: var(--brand-orange);
        font-weight: 700;
        font-size: 14px;
    }
    
    /* Reference Design: sr-cats (Category section with separator) */
    .search-product-item .product-categories,
    .search-product-item .sr-cats {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--row-border);
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* Reference Design: sr-caps (Category label) */
    .search-product-item .categories-label,
    .search-product-item .sr-caps {
        color: var(--muted);
        margin-right: 4px;
        display: inline;
    }
    
    /* Reference Design: sr-cat (Category link) */
    .search-product-item .category-link,
    .search-product-item .sr-cat {
        color: var(--link-muted);
        text-decoration: none;
        font-size: 12px;
        display: inline;
        padding: 2px 4px;
        border-radius: 2px;
        transition: all 0.2s ease;
    }
    
    .search-product-item .category-link:hover,
    .search-product-item .category-link:active,
    .search-product-item .sr-cat:hover,
    .search-product-item .sr-cat:active {
        text-decoration: underline;
        background-color: rgba(95, 107, 122, 0.1);
    }
    
    /* Hide desktop-specific elements on mobile */
    .search-product-item .product-sku {
        display: none;
    }
    
    .search-product-item .relevance-badge {
        display: none;
    }
    
    /* Loading and empty states adjustments */
    .search-loading {
        padding: 40px 20px;
        text-align: center;
    }
    
    .search-no-results {
        padding: 40px 20px;
        text-align: center;
    }
}

/* Accessibility improvements */
@media (max-width: 1088px) {
    /* Focus styles for touch devices */
    .search-product-item .product-link:focus {
        outline: 2px solid #ED6F26;
        outline-offset: 2px;
        background-color: #f9f9f9;
    }
    
    .search-product-item .category-link:focus {
        outline: 1px solid #ED6F26;
        outline-offset: 1px;
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        .search-product-item,
        .search-product-item .product-link,
        .search-product-item .category-link {
            transition: none;
        }
    }
}

/* Enhanced responsive breakpoints */

/* Larger mobile devices (768px to 1088px) - tablets */
@media (min-width: 768px) and (max-width: 1088px) {
    .search-product-item {
        padding: 16px 0; /* More breathing room on tablets */
    }
    
    .search-product-item .product-link {
        gap: 16px; /* Increased gap for tablets */
    }
    
    .search-product-item .product-image-wrapper {
        width: 60px; /* Slightly larger for tablets */
        height: 60px;
        border-radius: 8px;
    }
    
    .search-product-item .product-name {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .search-product-item .price-special,
    .search-product-item .price-current {
        font-size: 15px;
    }
    
    .search-product-item .product-categories {
        margin-top: 8px;
    }
}

/* Very small mobile devices (≤ 480px) - compact layout */
@media (max-width: 480px) {
    .search-product-item {
        padding: 12px 0; /* Maintain touch targets */
    }
    
    .search-product-item .product-link {
        gap: 12px; /* Consistent gap */
    }
    
    .search-product-item .product-image-wrapper {
        width: 50px; /* Smaller for tight spaces */
        height: 50px;
        border-radius: 6px;
    }
    
    .search-product-item .product-name {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .search-product-item .price-special,
    .search-product-item .price-current {
        font-size: 13px;
    }
    
    .search-product-item .price-regular {
        font-size: 10px;
    }
    
    .search-product-item .category-link {
        font-size: 10px;
        min-height: 18px;
    }
}