/* Search Modal Styles */

.modal-search {
    z-index: 1055;
}

.modal-search .modal-dialog {
    max-width: 800px;
    margin: 2rem auto;
}

.modal-search .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.modal-search .modal-content > div:first-child {
    margin-bottom: 1.5rem;
}

.modal-search .modal-content h5 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

.modal-search .icon-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: #6c757d;
    transition: color 0.3s ease;
}

.modal-search .icon-close:hover {
    color: #212529;
}

/* Search Form Styles */
.form-search {
    position: relative;
    margin-bottom: 2rem;
}

.form-search fieldset {
    margin: 0;
    padding: 0;
    border: none;
    position: relative;
}

.form-search .search-input {
    width: 100%;
    padding: 1rem 4rem 1rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-search .search-input:focus {
    border-color: var(--primary, #E43131);
    background: white;
    box-shadow: 0 0 0 3px rgba(228, 49, 49, 0.1);
}

.form-search .search-submit-btn {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary, #E43131);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-search .search-submit-btn:hover {
    background: color-mix(in srgb, var(--primary, #E43131) 85%, black);
    transform: translateY(-50%) scale(1.05);
}

.form-search .search-submit-btn svg path {
    stroke: white;
}

/* Search Results Styles */
.search-results {
    margin-bottom: 2rem;
}

.search-results-header h6 {
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
}

.search-suggestions {
    max-height: 400px;
    overflow-y: auto;
}

.search-no-results {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.search-no-results h6 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.search-no-results p {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Loading Styles */
.search-loading {
    padding: 2rem;
    color: #6c757d;
}

.search-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Keywords Section */
.search-keywords {
    margin-bottom: 2rem;
}

.search-keywords h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

.list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-tags li {
    margin: 0;
}

.list-tags .link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    text-decoration: none;
    color: #495057;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.list-tags .link:hover {
    background: var(--primary, #E43131);
    color: white;
    border-color: var(--primary, #E43131);
    transform: translateY(-1px);
}

/* Recent Products Section */
.search-recent-products h6 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

/* Grid Layout for Products */
.tf-grid-layout {
    display: grid;
    gap: 1rem;
}

.tf-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.lg-col-3 {
    grid-template-columns: repeat(2, 1fr);
}

.xl-col-4 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .lg-col-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .xl-col-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .xl-col-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Product Card Styles in Search */
.search-results .card-product,
.search-recent-products .card-product {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.search-results .card-product:hover,
.search-recent-products .card-product:hover {
    border-color: var(--primary, #E43131);
    box-shadow: 0 4px 12px rgba(228, 49, 49, 0.1);
    transform: translateY(-2px);
}

.search-results .card-product-wrapper,
.search-recent-products .card-product-wrapper {
    position: relative;
    padding: 1rem;
}

.search-results .product-img,
.search-recent-products .product-img {
    display: block;
    margin-bottom: 0.75rem;
}

.search-results .img-product,
.search-recent-products .img-product {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.search-results .on-sale-wrap,
.search-recent-products .on-sale-wrap {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 5;
}

.search-results .on-sale-item,
.search-recent-products .on-sale-item {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.search-results .list-product-btn,
.search-recent-products .list-product-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-results .card-product:hover .list-product-btn,
.search-recent-products .card-product:hover .list-product-btn {
    opacity: 1;
}

.search-results .box-icon,
.search-recent-products .box-icon {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    position: relative;
}

.search-results .box-icon:hover,
.search-recent-products .box-icon:hover {
    background: var(--primary, #E43131);
    color: white;
    border-color: var(--primary, #E43131);
}

.search-results .tooltip,
.search-recent-products .tooltip {
    position: absolute;
    inset-inline-end: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: #212529;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-results .box-icon:hover .tooltip,
.search-recent-products .box-icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.search-results .list-btn-main,
.search-recent-products .list-btn-main {
    margin-top: 0.5rem;
}

.search-results .btn-main-product,
.search-recent-products .btn-main-product {
    width: 100%;
    background: var(--primary, #E43131);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
}

.search-results .btn-main-product:hover,
.search-recent-products .btn-main-product:hover {
    background: color-mix(in srgb, var(--primary, #E43131) 85%, black);
    color: white;
}

.search-results .card-product-info,
.search-recent-products .card-product-info {
    padding: 0 1rem 1rem;
}

.search-results .title,
.search-recent-products .title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: #212529;
    display: block;
    line-height: 1.3;
}

.search-results .title:hover,
.search-recent-products .title:hover {
    color: var(--primary, #E43131);
}

.search-results .price,
.search-recent-products .price {
    font-weight: 600;
}

.search-results .old-price,
.search-recent-products .old-price {
    color: #6c757d;
    text-decoration: line-through;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

.search-results .current-price,
.search-recent-products .current-price {
    color: var(--primary, #E43131);
}

/* Load More Button */
.view-more-button {
    margin-top: 1.5rem;
}

.tf-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    color: var(--primary, #E43131);
    border: 1px solid var(--primary, #E43131);
}

.btn-outline:hover {
    background: var(--primary, #E43131);
    color: white;
}

.btn-reset {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.text-btn-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 767px) {
    .modal-search .modal-dialog {
        margin: 1rem;
        max-width: none;
    }
    
    .modal-search .modal-content {
        padding: 1.5rem;
    }
    
    .form-search .search-input {
        font-size: 1rem;
        padding: 0.875rem 3.5rem 0.875rem 1.25rem;
    }
    
    .form-search .search-submit-btn {
        width: 44px;
        height: 44px;
        inset-inline-end: 6px;
    }
    
    .tf-col-2 {
        grid-template-columns: 1fr;
    }
    
    .lg-col-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .xl-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-results .img-product,
    .search-recent-products .img-product {
        height: 120px;
    }
}

@media (max-width: 575px) {
    .modal-search .modal-content {
        padding: 1rem;
    }
    
    .lg-col-3,
    .xl-col-4 {
        grid-template-columns: 1fr;
    }
    
    .list-tags {
        gap: 0.25rem;
    }
    
    .list-tags .link {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Animation */
.modal-search.show .modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
