/* Decanto AJAX Search Styles */

.decanto-search-container {
    position: relative;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.decanto-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 50px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 5px;
}

.decanto-search-input-wrapper:focus-within {
}

.decanto-search-input {
    flex: 1;
    padding: 12px 48px 12px 16px;
    border: none !important;
    font-size: 16px;
    line-height: 1.5;
    background: transparent;
    outline: none;
    min-width: 0;
}

.decanto-search-filter {
    width: 100px;
    padding: 6px 32px 6px 16px;
    border: none;
    background: #242e50;
    border-radius: 30px;
    font-size: 14px;
    color: #ffffff;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    flex-shrink: 0;
}


.decanto-search-icon {
    position: absolute;
    right: 16px;
    color: #6b7280;
    pointer-events: none;
    z-index: 1;
}

.decanto-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    z-index: 1000;
    overflow: hidden;
    max-height: 500px;
    overflow-y: auto;
}

/* Search Items */
.decanto-search-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.decanto-search-item:hover,
.decanto-search-item.selected {
    background-color: #f9fafb;
}

.decanto-search-item:last-child {
    border-bottom: none;
}

.decanto-search-item-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.decanto-search-item-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.decanto-search-item-image svg {
    max-width: 100%;
    max-height: 90%;
    width: auto;
    height: auto;
}

.decanto-search-item-image-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    color: #9ca3af;
}

.decanto-search-item-content {
    flex: 1;
    min-width: 0;
}

.decanto-search-item-title {
    font-weight: 600;
    font-size: 16px;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.decanto-search-item-type {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.decanto-search-item-cavatappi {
    margin-left: auto;
    padding-left: 12px;
    display: flex;
    align-items: center;
}

.decanto-search-loading {
    padding: 8px;
}

.decanto-search-loading-items {
}

.decanto-search-footer-skeleton {
    border-top: 1px solid #f3f4f6;
    padding: 12px 16px;
}

.decanto-search-button-skeleton {
    width: 100%;
    height: 36px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.decanto-search-item-skeleton {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    animation: none;
}

.decanto-search-item-image-skeleton {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-right: 12px;
    flex-shrink: 0;
}

.decanto-search-item-content-skeleton {
    flex: 1;
}

.decanto-search-item-title-skeleton {
    height: 18px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 75%;
}

.decanto-search-item-type-skeleton {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    width: 45%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Footer */
.decanto-search-footer {
    border-top: 1px solid #f3f4f6;
    padding: 12px 16px;
}

.decanto-search-show-all {
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    color: #8b1538;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.decanto-search-show-all:hover,
.decanto-search-show-all.selected {
    background: #8b1538;
    color: #fff;
    border-color: #8b1538;
}

/* No Results */
.decanto-search-no-results {
    text-align: center;
    padding: 32px 16px;
    color: #6b7280;
}

.decanto-search-no-results-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.decanto-search-no-results-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.decanto-search-no-results-query {
    font-size: 14px;
}

/* Error */
.decanto-search-error {
    text-align: center;
    padding: 24px 16px;
    color: #dc2626;
}

.decanto-search-error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.decanto-search-error-text {
    font-size: 16px;
    font-weight: 500;
}

.search-cavatappi-icons {
    display: inline-flex;
    flex-direction: row;
    gap:1px;
    padding-bottom: 0px;
    align-items: flex-end;
}

.search-cavatappi-icons svg {
    overflow: visible;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .decanto-search-container {
        max-width: 100%;
    }

    .decanto-search-input {
        padding: 14px 48px 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .decanto-search-filter {
        width: 90px;
        padding: 14px 28px 14px 12px;
        font-size: 13px;
    }

    .decanto-search-results {
        max-height: 400px;
    }

    .decanto-search-item {
        padding: 16px;
    }

    .decanto-search-item-image,
    .decanto-search-item-image-placeholder {
        width: 56px;
        height: 56px;
        margin-right: 16px;
    }

    .decanto-search-item-image-skeleton {
        width: 56px;
        height: 56px;
        margin-right: 16px;
    }

    .decanto-search-item-title {
        font-size: 17px;
    }

    .decanto-search-item-type {
        font-size: 15px;
    }

    .decanto-search-footer {
        padding: 16px;
    }

    .decanto-search-show-all {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .decanto-search-input {
        padding: 12px 44px 12px 16px;
    }

    .decanto-search-filter {
        width: 70px;
        padding: 12px 24px 12px 8px;
        font-size: 12px;
        background-size: 14px;
    }

    .decanto-search-icon {
        right: 14px;
    }

    .decanto-search-item-image,
    .decanto-search-item-image-placeholder {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }

    .decanto-search-item-image-skeleton {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .decanto-search-results {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }
}

/* Focus styles for better accessibility */
.decanto-search-show-all:focus {
    outline: 2px solid #8b1538;
    outline-offset: 2px;
}

/* Ensure proper contrast in dark mode */
@media (prefers-color-scheme: dark) {
    .decanto-search-input {
        /* background: #1f2937;
        border-color: #374151; */
        color: #f9fafb;
    }

    .decanto-search-input:focus {
        border-color: #8b1538;
        box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.2);
    }

    .decanto-search-results {
        background: #1f2937;
        border-color: #374151;
    }

    .decanto-search-item {
        border-color: #374151;
        color: #f9fafb;
    }

    .decanto-search-item:hover,
    .decanto-search-item.selected {
        background-color: #374151;
    }

    .decanto-search-item-title {
        color: #f9fafb;
    }

    .decanto-search-item-type {
        color: #9ca3af;
    }

    .decanto-search-footer {
        border-color: #374151;
    }
}