/**
 * Divi Ajax Search - Styles
 */

/* ===== DROPDOWN CONTAINER ===== */
.das-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 320px;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    margin-top: 8px;
}

.das-dropdown.das-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== LOADER ===== */
.das-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #666;
    font-size: 14px;
}

.das-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: das-spin 0.8s linear infinite;
}

@keyframes das-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== NO RESULTS ===== */
.das-no-results {
    padding: 24px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* ===== SECTIONS ===== */
.das-section {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.das-section:last-of-type {
    border-bottom: none;
}

.das-section-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    background-color: #fafafa;
}

/* ===== RESULT ITEM ===== */
.das-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.das-result-item:hover,
.das-result-item.das-active {
    background-color: #f5f8ff;
}

/* Thumbnail */
.das-thumbnail {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.das-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content */
.das-content {
    flex: 1;
    min-width: 0;
}

.das-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.das-excerpt {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PRICES ===== */
.das-price {
    font-size: 14px;
    font-weight: 600;
    color: #27ae60;
    margin-top: 2px;
}

.das-price .das-price-old,
.das-price .woocommerce-Price-amount del {
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 6px;
}

.das-price .das-price-sale,
.das-price ins {
    color: #e74c3c;
    text-decoration: none;
}

.das-price-current .woocommerce-Price-amount {
    color: #27ae60;
}

/* ===== VIEW ALL LINK ===== */
.das-view-all {
    display: block;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #2196F3;
    text-decoration: none;
    background-color: #f8fafc;
    border-top: 1px solid #f0f0f0;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.15s ease;
}

.das-view-all:hover {
    background-color: #eef4ff;
    color: #1976D2;
}

/* ===== TYPE BADGES ===== */
.das-type-product .das-thumbnail {
    border: 1px solid #e0e0e0;
}

.das-type-page .das-thumbnail {
    background-color: #e3f2fd;
}

.das-type-post .das-thumbnail {
    background-color: #fff3e0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .das-dropdown {
        min-width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
        border-radius: 0 0 8px 8px;
        max-height: 60vh;
    }

    .das-result-item {
        padding: 10px 12px;
    }

    .das-thumbnail {
        width: 45px;
        height: 45px;
    }

    .das-title {
        font-size: 13px;
    }
}

/* ===== DIVI SPECIFIC FIXES ===== */
.et_search_form_container {
    position: relative !important;
}

.et_search_form_container .das-dropdown {
    width: 350px;
    left: auto;
    right: 0;
}

.et_pb_search .das-dropdown {
    left: 0;
    right: 0;
    width: auto;
}

/* ===== NOUVEAU SYSTÈME DIVI THEME BUILDER ===== */
.et_pb_menu__search-container {
    position: relative !important;
}

.et_pb_menu__search {
    position: relative !important;
}

.et_pb_menu__search-container .das-dropdown,
.et_pb_menu__search .das-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: 400px;
    max-width: 90vw;
    margin-top: 5px;
}

.et_pb_searchform {
    position: relative !important;
}

.et_pb_searchform .das-dropdown {
    width: 100%;
    min-width: 300px;
}

/* Fix z-index Divi */
#main-header .das-dropdown,
.et-fixed-header .das-dropdown,
.et_pb_menu .das-dropdown {
    z-index: 9999999;
}

/* ===== SCROLLBAR ===== */
.das-dropdown::-webkit-scrollbar {
    width: 6px;
}

.das-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.das-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.das-dropdown::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
