/**
 * Yoda Smart Search - Supersearch Widget Styles
 *
 * Layout like multisearch.io with OpenCart default colors
 *
 * @package    YodaSearch
 * @author     Yoda
 * @license    GNU General Public License version 3
 */

/* CSS Variables - OpenCart default theme colors */
.yodasearch-container.yodasearch-supersearch {
    --ss-primary: #23a1d1;
    --ss-primary-hover: #1a8bb8;
    --ss-text: #333;
    --ss-text-muted: #999;
    --ss-price: #444;
    --ss-special: #b12704;
    --ss-bg: #fff;
    --ss-bg-sidebar: #fff;
    --ss-border: #e5e5e5;
    --ss-hover-bg: #f5f5f5;
}

/* Main wrapper - two columns */
.yodasearch-supersearch .yodasearch-ss-wrapper {
    display: flex;
    min-height: 350px;
    max-height: 70vh;
    background: var(--ss-bg);
    border: 1px solid var(--ss-border);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Left sidebar - categories */
.yodasearch-ss-sidebar {
    width: 200px;
    min-width: 200px;
    border-right: 1px solid var(--ss-border);
    padding: 10px 0;
    overflow-y: auto;
    background: var(--ss-bg-sidebar);
}

.yodasearch-ss-cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    text-decoration: none;
    color: var(--ss-text);
    font-size: 13px;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.yodasearch-ss-cat-item:hover {
    background-color: var(--ss-hover-bg);
    color: var(--ss-primary);
    text-decoration: none;
}

.yodasearch-ss-cat-all {
    font-weight: 600;
    border-bottom: 1px solid var(--ss-border);
    margin-bottom: 5px;
    padding-bottom: 10px;
}

.yodasearch-ss-cat-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.yodasearch-ss-cat-count {
    background: var(--ss-border);
    color: #666;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.yodasearch-ss-cat-count-all {
    background: var(--ss-primary);
    color: #fff;
}

/* Section titles in sidebar */
.yodasearch-ss-section-title {
    padding: 10px 15px 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--ss-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Right content - products grid */
.yodasearch-ss-content {
    flex: 1;
    display: flex;
    padding: 15px;
    gap: 15px;
    overflow-x: auto;
    background: var(--ss-bg);
}

/* Category column */
.yodasearch-ss-column {
    flex: 1;
    min-width: 180px;
    max-width: 250px;
}

/* Column header */
.yodasearch-ss-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-text);
    text-decoration: none;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--ss-border);
}

.yodasearch-ss-col-header:hover {
    color: var(--ss-primary);
    text-decoration: none;
}

.yodasearch-ss-arrow {
    color: var(--ss-text-muted);
    font-size: 12px;
}

.yodasearch-ss-col-header:hover .yodasearch-ss-arrow {
    color: var(--ss-primary);
}

/* Products list */
.yodasearch-ss-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Single product */
.yodasearch-ss-product {
    display: flex;
    gap: 10px;
    padding: 6px;
    text-decoration: none;
    color: var(--ss-text);
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.yodasearch-ss-product:hover {
    background-color: var(--ss-hover-bg);
    text-decoration: none;
    color: var(--ss-text);
}

/* Product image wrapper */
.yodasearch-ss-img-wrap {
    position: relative;
    flex-shrink: 0;
    background: #fafafa;
    border-radius: 3px;
    overflow: hidden;
}

.yodasearch-ss-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Badges */
.yodasearch-ss-badge {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
}

.yodasearch-ss-badge-sale {
    background: #b12704;
    color: #fff;
}

.yodasearch-ss-badge-new {
    background: #28a745;
    color: #fff;
}

.yodasearch-ss-badge-hit {
    background: var(--ss-primary);
    color: #fff;
}

/* Product info */
.yodasearch-ss-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.yodasearch-ss-name {
    font-size: 12px;
    line-height: 1.3;
    color: var(--ss-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}

.yodasearch-ss-product:hover .yodasearch-ss-name {
    text-decoration: underline;
}

/* Price */
.yodasearch-ss-price {
    font-size: 12px;
    color: var(--ss-price);
}

.yodasearch-ss-old {
    color: #999;
    text-decoration: line-through;
    font-size: 11px;
}

.yodasearch-ss-new {
    color: var(--ss-special);
    font-weight: 600;
}

/* More link */
.yodasearch-ss-more {
    display: block;
    margin-top: 10px;
    padding: 6px;
    text-align: center;
    color: var(--ss-primary);
    font-size: 12px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.yodasearch-ss-more:hover {
    background-color: var(--ss-hover-bg);
    text-decoration: none;
}

/* Responsive - mobile */
@media (max-width: 768px) {
    .yodasearch-supersearch .yodasearch-ss-wrapper {
        flex-direction: column;
        max-height: 85vh;
    }

    .yodasearch-ss-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--ss-border);
        max-height: 120px;
        overflow-y: auto;
    }

    .yodasearch-ss-content {
        flex-direction: column;
        gap: 20px;
    }

    .yodasearch-ss-column {
        max-width: 100%;
    }
}
