/**
 * Search Page Styles - BudMarket
 * Стилі для сторінки результатів пошуку
 */

/* ===== Page Layout ===== */
.search-page {
    background: #f8f9fa;
    min-height: 100vh;
}

/* ===== Search Header ===== */
.search-header {
    background: #fff;
    padding: 40px 0;
    border-bottom: 1px solid #e5e5e5;
}

.search-header-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Breadcrumbs */
.search-header .breadcrumbs {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-header .breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-header .breadcrumbs a:hover {
    color: #E21E25;
}

.search-header .breadcrumbs .separator {
    color: #ccc;
}

.search-header .breadcrumbs .current {
    color: #333;
}

/* Search Title */
.search-title {
    font-size: 36px;
    font-weight: 700;
    color: #1E1E1E;
    margin: 0;
    line-height: 1.2;
}

.search-title .search-query {
    color: #E21E25;
    font-style: italic;
}

/* Search Stats */
.search-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 15px;
    color: #666;
}

.search-stats .total-count {
    font-weight: 500;
    color: #333;
}

.search-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 13px;
}

.search-stats .stat-item strong {
    color: #E21E25;
}

/* Inline Search Form */
.search-form-inline {
    max-width: 500px;
}

.search-form-inline form {
    display: flex;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-form-inline form:focus-within {
    border-color: #E21E25;
    background: #fff;
}

.search-form-inline input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
}

.search-form-inline input::placeholder {
    color: #999;
}

.search-form-inline button {
    padding: 12px 16px;
    background: #E21E25;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form-inline button:hover {
    background: #c41b22;
}

/* ===== Search Content ===== */
.search-content {
    padding: 50px 0 80px;
}

/* Section Header */
.search-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    gap: 20px;
}

.search-section .section-header {
    margin-bottom: 30px;
}

.search-section .section-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #1E1E1E;
    margin: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e5;
}

.search-section .section-header h2 svg {
    color: #E21E25;
    flex-shrink: 0;
}

.search-section .section-header h2 .count {
    font-weight: 400;
    color: #999;
    font-size: 18px;
}

/* ===== Products Grid ===== */
.search-section .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Product Card */
.search-section .product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e5e5;
}

.search-section .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border-color: #E21E25;
}

/* Product Image */
.search-section .product-card .product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f9f9f9;
}

.search-section .product-card .product-image a {
    display: block;
    height: 100%;
}

.search-section .product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    padding: 10px;
}

.search-section .product-card:hover .product-image img {
    transform: scale(1.08);
}

/* Sale Badge */
.search-section .product-card .sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #E21E25;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
}

/* Product Actions (Wishlist) */
.search-section .product-card .product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.search-section .product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.search-section .product-card .wishlist-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    color: #666;
}

.search-section .product-card .wishlist-btn:hover {
    background: #E21E25;
    color: #fff;
    transform: scale(1.1);
}

.search-section .product-card .wishlist-btn.active {
    background: #E21E25;
    color: #fff;
}

.search-section .product-card .wishlist-btn.active svg {
    fill: #fff;
}

/* Product Info */
.search-section .product-card .product-info {
    padding: 20px;
}

.search-section .product-card .product-category {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.search-section .product-card .product-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-section .product-card .product-title a {
    color: #1E1E1E;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-section .product-card .product-title a:hover {
    color: #E21E25;
}

/* Product Rating */
.search-section .product-card .product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.search-section .product-card .product-rating .star-rating {
    font-size: 13px;
}

.search-section .product-card .product-rating .rating-count {
    font-size: 12px;
    color: #999;
}

/* Product Price */
.search-section .product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: #E21E25;
    margin-bottom: 15px;
}

.search-section .product-card .product-price del {
    font-size: 14px;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

.search-section .product-card .product-price ins {
    text-decoration: none;
}

/* Add to Cart Button */
.search-section .product-card .product-cart {
    margin-top: auto;
}

.search-section .product-card .add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #E21E25;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.search-section .product-card .add-to-cart:hover {
    background: #c41b22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(226, 30, 37, 0.3);
    color: #fff;
}

.search-section .product-card .add-to-cart.added {
    background: #28a745;
}

.search-section .product-card .out-of-stock {
    display: block;
    text-align: center;
    padding: 12px;
    background: #f5f5f5;
    color: #999;
    border-radius: 8px;
    font-size: 14px;
}

/* ===== Posts Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* Post Card */
.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.post-card .post-image {
    height: 200px;
    overflow: hidden;
}

.post-card .post-image a {
    display: block;
    height: 100%;
}

.post-card .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-card .post-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.post-card .post-type {
    background: #2B2B2B;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}

.post-card .post-date {
    color: #999;
}

.post-card .post-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
}

.post-card .post-title a {
    color: #1E1E1E;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card .post-title a:hover {
    color: #E21E25;
}

.post-card .post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

.post-card .read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #E21E25;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-card .read-more:hover {
    gap: 12px;
}

.post-card .read-more svg {
    transition: transform 0.3s ease;
}

.post-card .read-more:hover svg {
    transform: translateX(4px);
}

/* ===== Pagination ===== */
.search-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.search-pagination .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 6px;
}

.search-pagination .page-numbers:hover,
.search-pagination .page-numbers.current {
    background: #E21E25;
    border-color: #E21E25;
    color: #fff;
}

.search-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    color: #999;
}

.search-pagination .page-numbers.dots:hover {
    background: transparent;
    color: #999;
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 60px 20px 80px;
    max-width: 600px;
    margin: 0 auto;
}

.no-results-icon {
    margin-bottom: 30px;
}

.no-results-icon svg {
    color: #ddd;
}

.no-results h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1E1E1E;
    margin: 0 0 15px;
}

.no-results > p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 30px;
}

.no-results strong {
    color: #E21E25;
}

/* Tips Section */
.no-results-tips {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: left;
    border: 1px solid #e5e5e5;
}

.no-results-tips h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1E1E1E;
    margin: 0 0 15px;
}

.no-results-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.no-results-tips ul li {
    padding: 8px 0 8px 28px;
    position: relative;
    color: #666;
    font-size: 14px;
}

.no-results-tips ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: #E21E25;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Large Search Form */
.search-form-large {
    margin-bottom: 40px;
}

.search-form-large form {
    display: flex;
    max-width: 450px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-form-large input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e5e5e5;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form-large input:focus {
    border-color: #E21E25;
}

.search-form-large button {
    padding: 16px 28px;
    background: #E21E25;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form-large button:hover {
    background: #c41b22;
}

/* Popular Categories */
.popular-categories {
    margin-bottom: 40px;
}

.popular-categories h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1E1E1E;
    margin: 0 0 20px;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 25px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: #E21E25;
    border-color: #E21E25;
    color: #fff;
    transform: translateY(-2px);
}

.category-tag .cat-count {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    transition: all 0.3s ease;
}

.category-tag:hover .cat-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Back to Shop Button */
.back-to-shop .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: #E21E25;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-to-shop .btn-primary:hover {
    background: #c41b22;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(226, 30, 37, 0.3);
    color: #fff;
}

/* ===== Responsive Styles ===== */

@media (max-width: 1200px) {
    .search-section .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .search-section .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .search-header {
        padding: 30px 0;
    }

    .search-title {
        font-size: 26px;
    }

    .search-stats {
        gap: 12px;
    }

    .search-content {
        padding: 40px 0 60px;
    }

    .search-section .section-header h2 {
        font-size: 20px;
    }

    .search-section .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .search-section .product-card .product-image {
        height: 160px;
    }

    .search-section .product-card .product-info {
        padding: 12px;
    }

    .search-section .product-card .product-category {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .search-section .product-card .product-title {
        font-size: 13px;
        height: 36px;
        margin-bottom: 8px;
    }

    .search-section .product-card .product-price {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .search-section .product-card .add-to-cart {
        padding: 10px 12px;
        font-size: 13px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card .post-image {
        height: 180px;
    }

    .post-card .post-title {
        font-size: 16px;
    }

    .search-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        font-size: 13px;
    }

    .no-results h2 {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .search-header {
        padding: 20px 0;
    }

    .search-title {
        font-size: 20px;
    }

    .search-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .search-form-inline {
        max-width: 100%;
    }

    .search-section .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .search-section .product-card .product-image {
        height: 140px;
    }

    .search-section .product-card .product-info {
        padding: 10px;
    }

    .search-section .product-card .product-category {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .search-section .product-card .product-title {
        font-size: 12px;
        height: 32px;
        margin-bottom: 6px;
    }

    .search-section .product-card .product-price {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .search-section .product-card .add-to-cart {
        padding: 8px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .search-section .product-card .add-to-cart span {
        display: none;
    }

    .search-section .product-card .wishlist-btn {
        width: 32px;
        height: 32px;
    }

    .search-section .product-card .wishlist-btn svg {
        width: 14px;
        height: 14px;
    }

    .post-card .post-content {
        padding: 16px;
    }

    .no-results {
        padding: 40px 15px 60px;
    }

    .no-results h2 {
        font-size: 22px;
    }

    .search-form-large form {
        flex-direction: column;
    }

    .search-form-large input {
        border-right: 2px solid #e5e5e5;
        border-radius: 8px 8px 0 0;
        border-bottom: none;
    }

    .search-form-large button {
        border-radius: 0 0 8px 8px;
    }

    .categories-list {
        gap: 8px;
    }

    .category-tag {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ===== WooCommerce Rating Stars Fix ===== */
.search-section .product-card .star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 14px;
    width: 5.4em;
    font-family: star;
}

.search-section .product-card .star-rating::before {
    content: "sssss";
    color: #d3d3d3;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.search-section .product-card .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.search-section .product-card .star-rating span::before {
    content: "SSSSS";
    top: 0;
    position: absolute;
    left: 0;
    color: #f5c518;
}