/* Ageka Search - Frontend Styles */

.ageka-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    z-index: 9999;
}

/* ── BASE THEME (modern) ── */
.ageka-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 6px 6px 16px;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ageka-search-box:focus-within {
    border-color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(26,26,46,0.12);
}

.ageka-search-icon { color: #94a3b8; display: flex; align-items: center; flex-shrink: 0; transition: color 0.2s; }
.ageka-search-box:focus-within .ageka-search-icon { color: #1a1a2e; }

.ageka-search-input {
    flex: 1; border: none !important; outline: none !important;
    background: transparent !important; font-size: 15px !important;
    color: #1a1a2e !important; padding: 8px 0 !important; margin: 0 !important;
    box-shadow: none !important; font-family: inherit !important; min-width: 0;
}
.ageka-search-input::placeholder { color: #94a3b8; }

.ageka-search-clear {
    background: none; border: none; cursor: pointer; color: #94a3b8;
    display: flex; align-items: center; padding: 4px; border-radius: 50%;
    transition: background 0.2s, color 0.2s; flex-shrink: 0;
}
.ageka-search-clear:hover { background: #f1f5f9; color: #1a1a2e; }

.ageka-search-btn {
    border: none; border-radius: 8px; padding: 10px 20px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s, transform 0.1s; white-space: nowrap;
    flex-shrink: 0; font-family: inherit; letter-spacing: 0.3px;
}
.ageka-search-btn:hover { opacity: 0.85; }
.ageka-search-btn:active { transform: scale(0.97); }

/* ── THEME: minimal ── */
.ageka-theme-minimal .ageka-search-box {
    border-radius: 4px; border: 1px solid #d1d5db; box-shadow: none;
}
.ageka-theme-minimal .ageka-search-btn { border-radius: 3px; }
.ageka-theme-minimal .ageka-search-box:focus-within { border-color: #374151; box-shadow: none; }

/* ── THEME: rounded ── */
.ageka-theme-rounded .ageka-search-box { border-radius: 40px; padding-left: 20px; }
.ageka-theme-rounded .ageka-search-btn { border-radius: 40px; padding: 10px 24px; }

/* ── THEME: sharp ── */
.ageka-theme-sharp .ageka-search-box { border-radius: 0; border: 2px solid #000; box-shadow: 4px 4px 0 #000; }
.ageka-theme-sharp .ageka-search-btn { border-radius: 0; }
.ageka-theme-sharp .ageka-search-box:focus-within { box-shadow: 4px 4px 0 #000; }

/* ── THEME: glass ── */
.ageka-theme-glass .ageka-search-box {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.ageka-theme-glass .ageka-search-input { color: #1a1a2e !important; }
.ageka-theme-glass .ageka-search-icon { color: rgba(255,255,255,0.6); }

/* ── DROPDOWN ── */
.ageka-search-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12); overflow: hidden;
    animation: ageka-in 0.15s ease; z-index: 99999;
}

@keyframes ageka-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ageka-search-dropdown-inner {
    max-height: 480px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent;
}
.ageka-search-dropdown-inner::-webkit-scrollbar { width: 4px; }
.ageka-search-dropdown-inner::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.ageka-section-header {
    padding: 10px 16px 6px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px; color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
}

/* Categories */
.ageka-category-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 14px; }

.ageka-category-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 20px;
    padding: 5px 12px 5px 6px; font-size: 13px; color: #374151;
    text-decoration: none; cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.ageka-category-chip:hover {
    background: #1a1a2e; border-color: #1a1a2e; color: #fff;
    text-decoration: none; transform: translateY(-1px);
}
.ageka-category-chip-img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.ageka-category-chip-icon {
    width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
}

/* Product items */
.ageka-product-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    text-decoration: none; color: inherit; transition: background 0.12s;
    border-bottom: 1px solid #f8fafc; cursor: pointer;
}
.ageka-product-item:last-child { border-bottom: none; }
.ageka-product-item:hover, .ageka-product-item.highlighted { background: #f8fafc; text-decoration: none; color: inherit; }

.ageka-product-thumb {
    width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
    background: #f1f5f9; flex-shrink: 0; border: 1px solid #e2e8f0;
}

.ageka-product-info { flex: 1; min-width: 0; }
.ageka-product-name {
    font-size: 14px; font-weight: 500; color: #1a1a2e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.ageka-product-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.ageka-product-sku {
    font-size: 11px; color: #94a3b8; font-family: 'SF Mono', monospace;
    background: #f1f5f9; padding: 1px 6px; border-radius: 4px;
}
.ageka-product-price { font-size: 13px; font-weight: 600; color: #059669; }
.ageka-product-price .amount { font-size: 13px !important; }

/* Blog items */
.ageka-blog-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 16px;
    text-decoration: none; color: inherit; transition: background 0.12s;
    border-bottom: 1px solid #f8fafc;
}
.ageka-blog-item:hover { background: #f8fafc; text-decoration: none; color: inherit; }
.ageka-blog-icon {
    width: 32px; height: 32px; background: #fef3c7; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #d97706;
}
.ageka-blog-title { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* No results */
.ageka-no-results { padding: 24px 16px; text-align: center; color: #94a3b8; font-size: 14px; }
.ageka-no-results-icon { font-size: 32px; margin-bottom: 8px; display: block; }

/* View all */
.ageka-view-all {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px; background: #f8fafc; border-top: 1px solid #e2e8f0;
    text-decoration: none; font-size: 13px; font-weight: 600; color: #1a1a2e;
    transition: background 0.15s; cursor: pointer;
}
.ageka-view-all:hover { background: #1a1a2e; color: #fff; text-decoration: none; }

/* Loading */
.ageka-loading { padding: 20px; text-align: center; color: #94a3b8; font-size: 13px; }
.ageka-loading-spinner {
    display: inline-block; width: 18px; height: 18px; border: 2px solid #e2e8f0;
    border-top-color: #1a1a2e; border-radius: 50%; animation: ageka-spin 0.6s linear infinite;
    margin-right: 8px; vertical-align: middle;
}
@keyframes ageka-spin { to { transform: rotate(360deg); } }

/* Highlight */
.ageka-highlight { background: #fef9c3; border-radius: 2px; font-weight: 600; color: #92400e; }

@media (max-width: 600px) {
    .ageka-search-btn { padding: 10px 14px; font-size: 13px; }
    .ageka-product-price { display: none; }
}
