:root {
    --wdc-primary        : #195B3C;
    --wdc-primary-light  : #2a7a52;
    --wdc-primary-dark   : #0f3a26;
    --wdc-glass-bg       : rgba(255, 255, 255, 0.75);
    --wdc-glass-border   : rgba(255, 255, 255, 0.9);
    --wdc-blur           : 20px;
    --wdc-dropdown-bg    : rgba(25, 91, 60, 0.82);
    --wdc-dropdown-border: rgba(42, 122, 82, 0.4);
    --wdc-radius         : 50px;
    --wdc-radius-results : 20px;
    --wdc-text           : #1d1d1f;
    --wdc-result-hover   : rgba(255, 255, 255, 0.12);
    --wdc-height         : 52px;
    --wdc-font           : -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
 
/* Wrapper */
.wdc-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    font-family: var(--wdc-font);
    -webkit-font-smoothing: antialiased;
}
 
/* Barra de busqueda */
.wdc-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wdc-glass-bg);
    border-radius: var(--wdc-radius);
    backdrop-filter: blur(var(--wdc-blur));
    -webkit-backdrop-filter: blur(var(--wdc-blur));
    padding: 0 18px;
    height: var(--wdc-height);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 0 0 1px rgba(25, 91, 60, 0.18),
        0 8px 32px rgba(25, 91, 60, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(25, 91, 60, 0.08);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
 
.wdc-search-bar:focus-within {
    border-color: rgba(42, 122, 82, 0.6);
    box-shadow:
        0 0 0 3px rgba(25, 91, 60, 0.15),
        0 0 0 1px rgba(42, 122, 82, 0.45),
        0 12px 40px rgba(25, 91, 60, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(25, 91, 60, 0.12);
}
 
/* Brillo de borde tipo Apple */
.wdc-search-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--wdc-radius);
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(42, 122, 82, 0.4) 40%,
        rgba(25, 91, 60, 0.6) 60%,
        rgba(255, 255, 255, 0.7) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
 
/* Icono lupa */
.wdc-search-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--wdc-primary-light);
    transition: color 0.2s;
}
 
.wdc-search-bar:focus-within .wdc-search-icon {
    color: var(--wdc-primary);
}
 
/* Input */
.wdc-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--wdc-font);
    font-size: 16px;
    font-weight: 400;
    color: var(--wdc-text);
    line-height: 1;
    caret-color: var(--wdc-primary);
}
 
.wdc-search-input::placeholder {
    color: #9a9a9f;
}
 
/* Boton limpiar */
.wdc-search-clear {
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(25, 91, 60, 0.12);
    border-radius: 50%;
    cursor: pointer;
    color: var(--wdc-primary);
    font-size: 14px;
    line-height: 1;
    transition: background 0.18s;
    padding: 0;
}
 
.wdc-search-clear:hover {
    background: rgba(25, 91, 60, 0.22);
}
 
.wdc-search-clear.visible {
    display: flex;
}
 
/* Spinner */
.wdc-spinner {
    flex-shrink: 0;
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(25, 91, 60, 0.2);
    border-top-color: var(--wdc-primary);
    border-radius: 50%;
    animation: wdc-spin 0.7s linear infinite;
}
 
.wdc-spinner.visible {
    display: block;
}
 
@keyframes wdc-spin {
    to { transform: rotate(360deg); }
}
 
/* Dropdown resultados */
.wdc-results-dropdown {
    position: absolute;
    top: calc(var(--wdc-height) + 8px);
    left: 0;
    right: 0;
    background: var(--wdc-dropdown-bg);
    border: 1px solid var(--wdc-dropdown-border);
    border-radius: var(--wdc-radius-results);
    box-shadow:
        0 20px 60px rgba(25, 91, 60, 0.35),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
 
.wdc-results-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
 
/* Lista resultados */
.wdc-results-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
 
.wdc-results-list::-webkit-scrollbar {
    width: 4px;
}
 
.wdc-results-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
 
/* Item resultado */
.wdc-result-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    text-decoration: none;
    color: #ffffff;
    transition: background 0.15s;
}
 
.wdc-result-item a:hover,
.wdc-result-item.focused a {
    background: var(--wdc-result-hover);
}
 
.wdc-result-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
 
.wdc-result-item .wdc-result-info {
    flex: 1;
    min-width: 0;
}
 
.wdc-result-item .wdc-result-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    margin: 0 0 2px;
}
 
.wdc-result-item .wdc-result-price {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}
 
/* Sin resultados y footer */
.wdc-no-results,
.wdc-results-footer {
    padding: 14px 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}
 
.wdc-results-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
 
.wdc-results-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
}
 
.wdc-results-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}
 
/* Media query - mobile pequeno (max 479px) */
@media (max-width: 479px) {
    :root {
        --wdc-height: 46px;
        --wdc-radius: 16px;
        --wdc-blur: 12px;
    }
    .wdc-search-wrapper {
        max-width: 100%;
        padding: 0 8px;
    }
    .wdc-search-bar {
        padding: 0 14px;
        gap: 8px;
    }
    .wdc-search-input {
        font-size: 15px;
    }
    .wdc-results-dropdown {
        border-radius: 16px;
        left: -8px;
        right: -8px;
    }
    .wdc-results-list {
        max-height: 280px;
    }
    .wdc-result-item a {
        padding: 8px 14px;
        gap: 10px;
    }
    .wdc-result-item img {
        width: 38px;
        height: 38px;
    }
}
 
/* Media query - mobile (480px a 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    :root {
        --wdc-height: 48px;
        --wdc-radius: 28px;
    }
    .wdc-search-wrapper {
        max-width: 100%;
    }
}
 
/* Media query - tablet (768px a 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --wdc-height: 50px;
    }
    .wdc-search-wrapper {
        max-width: 520px;
    }
}
 
/* Media query - desktop (1024px a 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .wdc-search-wrapper {
        max-width: 580px;
    }
}
 
/* Media query - large desktop (1440px en adelante) */
@media (min-width: 1440px) {
    :root {
        --wdc-height: 56px;
    }
    .wdc-search-wrapper {
        max-width: 680px;
    }
    .wdc-search-input {
        font-size: 17px;
    }
}
 
/* Reducir animaciones */
@media (prefers-reduced-motion: reduce) {
    .wdc-results-dropdown,
    .wdc-search-bar {
        transition: none;
    }
    .wdc-spinner {
        animation: none;
    }
}