/* Shop Products Widget Styles */
.sp-widget {
    width: 100%;
}

/* Top Bar */
.sp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

/* Category Dropdown */
.sp-cat-dropdown-wrap {
    position: relative;
}

.sp-cat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 18px;
    background-color: #00a0e9;
    color: #fff;
    border: 2px solid #00a0e9;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s, border-color 0.3s;
    position: relative;
    z-index: 101;
}

.sp-cat-btn svg {
    fill: #fff;
    transition: transform 0.3s;
}

.sp-cat-dropdown-wrap.open .sp-cat-btn svg {
    transform: rotate(90deg);
}

.sp-cat-btn:hover {
    opacity: 0.9;
}

.sp-cat-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    background: #333;
    border-radius: 0 0 4px 4px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
}

.sp-cat-dropdown-wrap.open .sp-cat-dropdown {
    display: block;
}

.sp-cat-dropdown-item {
    display: block;
    padding: 10px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
}

.sp-cat-dropdown-item:hover,
.sp-cat-dropdown-item.active {
    background-color: #444;
    color: #fff;
}

/* Search */
.sp-search-wrap {
    flex: 0 0 auto;
    position: relative;
}

.sp-search-form {
    display: flex;
    align-items: center;
}

.sp-search-input {
    padding: 0 15px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
    width: 280px;
    height: 42px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.sp-search-input:focus {
    border-color: #00a0e9;
}

/* Search Suggestions */
.sp-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 360px;
    overflow-y: auto;
}

.sp-suggestion-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 20px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.sp-suggestion-item:last-child {
    border-bottom: none;
}

.sp-suggestion-item:hover {
    background-color: #f0f0f0;
}

.sp-suggestion-img {
    width: 30%;
    flex: 0 0 30%;
    object-fit: cover;
    border-radius: 4px;
}

.sp-suggestion-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sp-search-btn {
    padding: 0 25px;
    background-color: #00a0e9;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    height: 42px;
    box-sizing: border-box;
    transition: background-color 0.3s;
}

.sp-search-btn:hover {
    opacity: 0.9;
}

/* Category Title */
.sp-cat-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

/* Category Description */
.sp-cat-desc-wrap {
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.sp-cat-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    overflow: hidden;
    text-align: left;
    position: relative;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.sp-cat-desc p {
    display: inline;
}

.sp-cat-desc p::before {
    content: '';
    display: block;
}

.sp-cat-desc p:first-child::before {
    display: none;
}

.sp-cat-desc a {
    color: #00a0e9;
    text-decoration: underline;
}

.sp-cat-desc strong {
    font-weight: 600;
}

.sp-cat-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.sp-cat-desc.expanded p {
    display: block;
    margin: 0 0 0.8em 0;
}

.sp-cat-desc.expanded p:last-child {
    margin-bottom: 0;
}

.sp-cat-desc.expanded ul,
.sp-cat-desc.expanded ol {
    margin: 0 0 0.8em 1.5em;
    padding: 0;
}

.sp-desc-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 30px;
    background: #00a0e9;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.3s;
}

.sp-desc-toggle:hover {
    background: #0090d0;
}

.sp-desc-toggle.visible {
    display: inline-flex;
}

.sp-desc-toggle svg,
.sp-desc-toggle i {
    font-size: 14px;
    transition: transform 0.3s;
}

.sp-desc-toggle.expanded svg,
.sp-desc-toggle.expanded i {
    transform: rotate(180deg);
}

/* Products Grid */
.sp-products-grid {
    display: grid;
    gap: 20px;
    margin-top: 40px;
}

.sp-products-grid.columns-1 { grid-template-columns: 1fr; }
.sp-products-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.sp-products-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.sp-products-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Product Card */
.sp-product-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s, transform 0.3s;
}

.sp-product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Product Image */
.sp-product-image {
    width: 200px;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-product-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Product Info */
.sp-product-info {
    flex: 1;
    min-width: 0;
}

.sp-product-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.sp-readmore-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: #00a0e9;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sp-readmore-btn {
    transition: background-color 0.3s, color 0.3s;
}

.sp-product-card:hover .sp-readmore-btn {
    background-color: #0080c0;
}

.sp-no-products {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

/* Pagination */
.sp-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.sp-pagination ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.sp-pagination ul li {
    margin: 0;
}

.sp-pagination ul li a,
.sp-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    background: #fff;
}

.sp-pagination ul li a:hover {
    background-color: #00a0e9;
    border-color: #00a0e9;
    color: #fff;
}

.sp-pagination ul li span.current {
    background-color: #00a0e9;
    border-color: #00a0e9;
    color: #fff;
}

.sp-pagination ul li .dots {
    border: none;
    background: none;
    color: #999;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .sp-products-grid[class*="columns-tablet-1"] { grid-template-columns: 1fr; }
    .sp-products-grid[class*="columns-tablet-2"] { grid-template-columns: repeat(2, 1fr); }
    .sp-products-grid[class*="columns-tablet-3"] { grid-template-columns: repeat(3, 1fr); }
    .sp-products-grid[class*="columns-tablet-4"] { grid-template-columns: repeat(4, 1fr); }

    .sp-search-input {
        width: 200px;
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    .sp-products-grid[class*="columns-mobile-1"] { grid-template-columns: 1fr; }
    .sp-products-grid[class*="columns-mobile-2"] { grid-template-columns: repeat(2, 1fr); }

    .sp-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .sp-search-input {
        width: 100%;
        flex: 1;
    }

    .sp-search-form {
        width: 100%;
    }

    .sp-product-card {
        padding: 15px;
        gap: 12px;
    }

    .sp-product-image {
        width: 120px;
        min-width: 120px;
    }

    .sp-product-title {
        font-size: 14px;
    }

    .sp-cat-title {
        font-size: 18px;
    }
}
