/* Search page specific styles */

/* Main content */
.main-content {
    padding: 20px 0;
}

.breadcrumbs {
    display: flex;
    margin-bottom: 20px;
    font-size: 14px;
    color: #777;
}

.breadcrumbs a {
    color: #777;
    margin-right: 8px;
}

.breadcrumbs span {
    margin: 0 8px;
}

.page-title {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: bold;
    margin-right: 15px;
}

.help-link {
    color: #4747ff;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.help-link i {
    margin-right: 5px;
}

/* Category filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    overflow-x: auto;
}

.category-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-right: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-width: 230px;
    transition: box-shadow 0.3s ease;
}

.category-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: #4747ff;
    font-size: 20px;
}

.category-name {
    font-weight: 500;
    font-size: 14px;
}

/* Search results container */
.search-container-main {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Filters sidebar */
.filters-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filter-box {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filter-title {
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-title .fa-chevron-down {
    font-size: 12px;
    color: #777;
    transition: transform 0.3s ease;
}

.price-inputs {
    display: flex;
    margin-bottom: 15px;
}

.price-input-box {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-right: 10px;
}

.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.checkbox-item input {
    margin-right: 10px;
}

/* Results container */
.results-container {
    flex: 1;
    min-width: 0; /* Prevent flex items from growing beyond container */
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.results-count {
    color: #777;
}

.sort-options {
    display: flex;
    align-items: center;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
    margin-left: 10px;
}

.view-options {
    display: flex;
    margin-left: 15px;
}

.view-option {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    margin-left: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.view-option.active {
    background-color: #4747ff;
    color: white;
}

/* Video previews */
.video-previews {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.video-card {
    flex: 1;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    height: 180px;
    cursor: pointer;
}

.video-title {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-weight: bold;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: white;
    font-size: 12px;
}

.video-views {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: white;
    font-size: 12px;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 30px;
}

/* Product list */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Product card specific styles with fixed layout */
.product-card {
    position: relative;
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 15px;
}

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

/* Updated grid layout with 4 columns - added column for actions */
.product-card-content {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 200px 40px;
    gap: 20px;
}

/* Styling for action buttons in their own column */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favorite-button, .compare-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #ddd;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.favorite-button:hover {
    color: #ff4d4d;
    transform: scale(1.1);
}

.compare-button:hover {
    color: #4747ff;
    transform: scale(1.1);
}

.product-image {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

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

.product-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-rating {
    display: inline-flex;
    align-items: center;
    background-color: #4cd964;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    width: fit-content;
}

.product-title {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.3;
}

.product-specs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 8px 20px;
}

.spec-item {
    font-size: 14px;
    color: #555;
}

.spec-label {
    font-weight: 500;
    color: #777;
}

.product-features, .product-security {
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
}

.product-price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
}

.product-price {
    font-weight: bold;
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
    text-align: right;
    width: 100%;
}

/* Updated styling for shop info area */
.shop-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 8px;
    width: 100%;
}

.shop-name {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.shop-name i {
    color: #4cd964;
}

.shop-rating {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    font-size: 14px;
    color: #777;
    width: 100%;
}

.shop-rating i {
    color: #ffcc00;
}

.shop-price {
    margin-left: 15px;
}

.delivery-info {
    font-size: 14px;
    color: #777;
    margin-bottom: 15px;
    text-align: right;
    width: 100%;
}

.compare-prices-button {
    background-color: #4747ff;
    color: white;
    border-radius: 5px;
    padding: 8px 15px;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.compare-prices-button:hover {
    background-color: #3a3ad1;
}

.compare-count {
    background-color: white;
    color: #333;
    border-radius: 3px;
    padding: 0 5px;
    margin-left: 5px;
}

/* Load more button */
.load-more {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.load-more-button {
    background-color: #f0f0f0;
    border: none;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

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

.pagination-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination-item:hover:not(.active) {
    background-color: #f0f0f0;
}

.pagination-item.active {
    background-color: #4747ff;
    color: white;
}

.pagination-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-arrow:hover {
    background-color: #e0e0e0;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    font-size: 14px;
}

/* Recently viewed section */
.recently-viewed {
    margin-top: 40px;
}

.section-title {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: bold;
}

.recent-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.recent-product-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #4cd964;
    color: white;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.favorite-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: #ddd;
    cursor: pointer;
    z-index: 1;
}

.favorite-icon:hover {
    color: #ff4d4d;
}

.recent-product-image {
    display: flex;
    justify-content: center;
    height: 180px;
    margin-bottom: 15px;
}

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

.recent-product-rating {
    background-color: #4cd964;
    color: white;
    border-radius: 3px;
    padding: 2px 5px;
    font-weight: bold;
    width: fit-content;
    margin-bottom: 5px;
    font-size: 14px;
}

.recent-product-reviews {
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
}

.recent-product-price {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

.recent-product-title {
    font-size: 14px;
    margin-bottom: 15px;
    color: #333;
    line-height: 1.4;
}

.recent-product-choices {
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
}

.recent-compare-button {
    display: block;
    background-color: #4747ff;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 5px;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 10px;
}

.recent-compare-count {
    background-color: white;
    color: #333;
    border-radius: 3px;
    padding: 0 5px;
    margin-left: 5px;
}

.recent-product-shops {
    font-size: 12px;
    color: #777;
    text-align: center;
}

.recent-product-shops i {
    color: #ffcc00;
}

/* View modes - list and grid */
.product-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.product-list.grid-view .product-card {
    height: 100%;
}

.product-list.grid-view .product-card-content {
    display: flex;
    flex-direction: column;
}

.product-list.grid-view .product-image {
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
}

.product-list.grid-view .product-info {
    width: 100%;
    padding-right: 0;
}

.product-list.grid-view .product-price-container {
    width: 100%;
    align-items: flex-start;
    margin-top: 15px;
}

.product-list.grid-view .product-actions {
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 10px;
}

.product-list.grid-view .shop-name,
.product-list.grid-view .shop-rating,
.product-list.grid-view .delivery-info,
.product-list.grid-view .product-price {
    justify-content: flex-start;
    text-align: left;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #333;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Responsive design */
@media (max-width: 1200px) {
    .product-card-content {
        grid-template-columns: 150px minmax(0, 1fr) 180px 40px;
    }
}

@media (max-width: 992px) {
    .search-container-main {
        flex-direction: column;
    }

    .filters-sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .filter-box {
        margin-bottom: 15px;
    }

    .recent-products {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .product-card-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-image {
        width: 100%;
        height: 200px;
        justify-content: center;
        margin: 0 auto;
    }

    .product-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .product-price-container {
        width: 100%;
        align-items: flex-start;
    }

    .shop-name, .shop-rating, .delivery-info, .product-price {
        text-align: left;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .video-previews {
        flex-direction: column;
    }

    .video-card {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .category-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .category-card {
        min-width: 200px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-options {
        margin-top: 10px;
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.product-tag {
    display: inline-block;
    background-color: #e7f3ff;
    color: #0077cc;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid #cce5ff;
    transition: background-color 0.2s;
}

.product-tag:hover {
    background-color: #d0e8ff;
    cursor: pointer;
}

.product-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-tag-more {
    display: inline-block;
    background-color: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid #ddd;
    cursor: help;
}

.product-tag-more:hover {
    background-color: #e6e6e6;
}