.n3d-pokemon-search-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.n3d-search-container {
    position: relative;
    margin-bottom: 2rem;
}

.n3d-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.n3d-search-input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.n3d-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.n3d-search-results.active {
    display: block;
}

.n3d-search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.n3d-search-result-item:hover {
    background-color: #f5f5f5;
}

.n3d-search-result-item strong {
    display: block;
    color: #333;
}

.n3d-search-result-item small {
    display: block;
    color: #999;
    margin-top: 4px;
}

/* ── Search bar section ─────────────────────────────────────────── */
.n3d-search-section { margin-bottom: 1rem; }

.n3d-filters {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.n3d-filters h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 16px;
    color: #333;
}

/* Filter row: wraps into a 2-column grid on mobile, inline on desktop */
.n3d-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 640px) {
    .n3d-filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-end;
    }
    .n3d-filter-group { flex: 1 1 140px; min-width: 120px; max-width: 200px; }
}

.n3d-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
}

.n3d-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

.n3d-filter-input,
.n3d-filter-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 13px;
    background-color: #fff;
    box-sizing: border-box;
}

.n3d-filter-input:focus,
.n3d-filter-select:focus { border-color: #ffaa33; outline: none; }

.n3d-filter-input--small { min-width: 0; }

/* Actions row — full width, side by side on all sizes */
.n3d-filter-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.n3d-filter-button {
    flex: 1;
    min-width: 100px;
    padding: 9px 16px;
    background-color: #ffaa33;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.n3d-filter-button:hover { background-color: #e69920; }

.n3d-filter-button.n3d-secondary {
    background-color: #e0e0e0;
    color: #333;
    flex: 0 1 auto;
}

.n3d-filter-button.n3d-secondary:hover { background-color: #ccc; }

.n3d-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.n3d-product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.n3d-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.n3d-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
}

.n3d-product-info {
    padding: 1rem;
}

.n3d-product-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.n3d-product-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 0.5rem;
}

.n3d-product-meta span {
    display: inline-block;
    margin-right: 1rem;
}

.n3d-product-type {
    display: inline-block;
    padding: 2px 8px;
    background: #ff6b6b;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.n3d-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
    margin: 0.5rem 0;
}

.n3d-product-button {
    width: 100%;
    padding: 10px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.n3d-product-button:hover {
    background-color: #ff5252;
}

.n3d-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.n3d-pagination a,
.n3d-pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.n3d-pagination a:hover {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.n3d-pagination .current {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

/* Tighter product grid on small screens */
@media (max-width: 768px) {
    .n3d-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}
/* filter-row/group defined in base styles above */
.n3d-filter-input {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
}
.n3d-filter-input--small { width: 72px; }
.n3d-dex-range {
    display: flex;
    align-items: center;
    gap: 6px;
}
.n3d-dex-separator { color: #666; }
.n3d-filter-actions { margin-top: 12px; }
.n3d-loading, .n3d-error, .n3d-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: #666;
}
.n3d-error { color: #c00; }
.n3d-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 12px; background: #eee; margin-right: 4px; }
.n3d-color-badge { background: #f0e8ff; }
.n3d-no-image { background: #f5f5f5; min-height: 160px; }

/* ── Official Pokémon type badge colours ─────────────────────────── */
.n3d-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; color:#fff; margin-right:4px; text-shadow:0 1px 2px rgba(0,0,0,.25); }

.n3d-type-normal    { background:#9fa19f; }
.n3d-type-fire      { background:#e62829; }
.n3d-type-water     { background:#2980ef; }
.n3d-type-electric  { background:#fac000; color:#333; text-shadow:none; }
.n3d-type-grass     { background:#3fa129; }
.n3d-type-ice       { background:#3dcef3; color:#333; text-shadow:none; }
.n3d-type-fighting  { background:#ff8000; }
.n3d-type-poison    { background:#9141cb; }
.n3d-type-ground    { background:#915121; }
.n3d-type-flying    { background:#81b9ef; color:#333; text-shadow:none; }
.n3d-type-psychic   { background:#ef4179; }
.n3d-type-bug       { background:#91a119; }
.n3d-type-rock      { background:#afa981; color:#333; text-shadow:none; }
.n3d-type-ghost     { background:#704170; }
.n3d-type-dragon    { background:#5060e1; }
.n3d-type-dark      { background:#624d4e; }
.n3d-type-steel     { background:#60a1b8; }
.n3d-type-fairy     { background:#ef70ef; }

/* ── Official Pokémon region colours (Bulbapedia palette) ───────── */
.n3d-region-kanto   { background:#e63f20; }
.n3d-region-johto   { background:#d4a020; color:#333; text-shadow:none; }
.n3d-region-hoenn   { background:#1a7dc4; }
.n3d-region-sinnoh  { background:#7038a8; }
.n3d-region-unova   { background:#545454; }
.n3d-region-kalos   { background:#3c5ebd; }
.n3d-region-alola   { background:#e8a333; color:#333; text-shadow:none; }
.n3d-region-galar   { background:#1e2d6b; }
.n3d-region-hisui   { background:#5b8a6e; }
.n3d-region-paldea  { background:#cb3434; }

/* ── Gallery thumbnails in listing ──────────────────────────────── */
.n3d-product-images { position:relative; }
.n3d-thumbs { display:flex; gap:4px; margin-top:4px; }
.n3d-thumb { width:calc(33.33% - 3px); aspect-ratio:1; object-fit:cover; border-radius:3px; border:1px solid #eee; cursor:pointer; transition:opacity .15s; }
.n3d-thumb:hover { opacity:.8; }


/* ── Card action buttons ─────────────────────────────────────────── */
/* "View Product" button — use Astra theme accent #ffaa33 */
.n3d-product-button {
    display: inline-block;
    background-color: #ffaa33 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 18px;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    transition: background-color .15s, opacity .15s;
    cursor: pointer;
}
.n3d-product-button:hover { background-color: #e69920 !important; opacity: 1 !important; }

/* "Add to Cart" button */
.n3d-add-to-cart {
    display: inline-block;
    background-color: #333 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color .15s;
}
.n3d-add-to-cart:hover { background-color: #555 !important; }
.n3d-add-to-cart:disabled { opacity: .6; cursor: default; }

.n3d-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── Price display ───────────────────────────────────────────────── */
.n3d-product-price {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin: 8px 0 4px;
}
/* WooCommerce wraps price in .woocommerce-Price-amount — inherit colour */
.n3d-product-price .woocommerce-Price-amount { color: inherit; }
.n3d-product-price .woocommerce-Price-currencySymbol { color: inherit; }

/* Bundle deal on listing card */
.n3d-bundle-price {
    font-size: 12px;
    color: #e07a00;
    font-weight: 600;
    margin-bottom: 6px;
}
.n3d-bundle-price .woocommerce-Price-amount { color: inherit; }

/* Bundle deal block on product page */
.n3d-bundle-deal {
    background: #fff8ee;
    border: 1px solid #ffaa33;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0 14px;
    font-size: 14px;
    color: #444;
}
.n3d-bundle-deal strong { color: #c47800; }
.n3d-bundle-icon { font-size: 16px; }

/* ── Clickable type/region badges ───────────────────────────────── */
.n3d-badge[data-filter-type] {
    cursor: pointer;
    transition: transform .1s, opacity .1s;
}
.n3d-badge[data-filter-type]:hover { opacity: .85; transform: scale(1.05); }


/* ── Rounded product images (5px) ───────────────────────────────── */
.n3d-product-image { border-radius: 10px; }
.n3d-thumb         { border-radius: 10px; }
.n3d-no-image      { border-radius: 10px; }

/* ── Evolution suggestion popup ─────────────────────────────────── */
/* Backdrop overlay for centered popup */
#n3d-evo-overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;
    background: rgba(0,0,0,.45);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
#n3d-evo-overlay.n3d-evo-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Popup centered on screen, same visual style as before */
#n3d-evo-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    z-index: 99999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
    padding: 22px 24px 16px;
    max-width: 360px;
    width: calc(100vw - 48px);
    /* Mobile: cap height and scroll the body if many evolutions don't fit.
       100vh fallback for older browsers; 100dvh handles iOS Safari URL bar. */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    font-size: 14px;
}
#n3d-evo-popup.n3d-evo-popup--visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
.n3d-evo-close {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0;
}
.n3d-evo-close:hover { color: #333; }
.n3d-evo-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 4px;
    padding-right: 20px;
}
.n3d-evo-subtitle {
    color: #666;
    font-size: 13px;
    margin: 0 0 10px;
}
.n3d-evo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.n3d-evo-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 5px 10px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
}
.n3d-evo-link:hover { background: #ffaa33; color: #fff; border-color: #ffaa33; }
.n3d-evo-dex { color: #999; font-weight: 400; font-size: 11px; }
.n3d-evo-link:hover .n3d-evo-dex { color: rgba(255,255,255,.75); }
.n3d-evo-timer {
    height: 3px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}
.n3d-evo-timer-bar {
    height: 100%;
    width: 100%;
    background: #ffaa33;
    border-radius: 2px;
}

@media (max-width: 480px) {
    #n3d-evo-popup { width: calc(100vw - 24px); max-width: none; padding: 18px 18px 14px; }
}

/* ── Variant dropdown + cart controls ───────────────────────────── */
.n3d-card-controls {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: stretch;
}

/* Variant select: white bg, black 2px border, rounded, black text */
.n3d-variant-select {
    flex: 1;
    max-width: 50%;
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 10px !important;
    color: #000000 !important;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    cursor: pointer;
    outline: none;
    appearance: auto;
}
.n3d-variant-select:focus { border-color: #ffaa33 !important; }

/* Add to Cart button on cards: black bg, white text, rounded, ~50% width of view product */
.n3d-card-controls .n3d-add-to-cart {
    flex: 1;
    max-width: 50%;
    background: #000000 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}
.n3d-card-controls .n3d-add-to-cart:hover   { background: #333333 !important; }
.n3d-card-controls .n3d-add-to-cart:disabled { opacity: .6; cursor: default; }

/* View Product button stays full-width in its own row */
.n3d-card-actions { margin-top: 8px; }
.n3d-card-actions .n3d-product-button { display: block; text-align: center; }


/* ── Back to Listing button (product pages) ──────────────────────── */
.n3d-back-to-listing {
    margin-bottom: 16px;
}
.n3d-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #555 !important;
    text-decoration: none !important;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #f8f8f8;
    transition: background .15s, border-color .15s, color .15s;
}
.n3d-back-btn:hover {
    background: #ffaa33 !important;
    border-color: #ffaa33 !important;
    color: #fff !important;
}

/* ── Loading skeleton shimmer ────────────────────────────────────── */
@keyframes n3d-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.n3d-skeleton-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.n3d-skel {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: n3d-shimmer 1.4s infinite linear;
    border-radius: 10px;
    margin-bottom: 10px;
}
.n3d-skel-img   { height: 160px; border-radius: 10px; }
.n3d-skel-title { height: 16px; width: 70%; }
.n3d-skel-meta  { height: 12px; width: 50%; }
.n3d-skel-price { height: 18px; width: 35%; }

/* ── Active filter chips ─────────────────────────────────────────── */
.n3d-active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; min-height: 0; padding-top: 10px; border-top: 1px solid #eee; }
.n3d-active-filters:not(.n3d-has-chips) { display: none; }
.n3d-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff8ee;
    border: 1px solid #ffaa33;
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #c47800;
}
.n3d-chip-remove {
    background: none;
    border: none;
    font-size: 15px;
    line-height: 1;
    color: #c47800;
    cursor: pointer;
    padding: 0;
    opacity: .7;
}
.n3d-chip-remove:hover { opacity: 1; }

/* ── Empty state with reset button ──────────────────────────────── */
.n3d-empty {
    text-align: center;
    padding: 2rem;
    color: #888;
    grid-column: 1 / -1;
}
.n3d-empty p   { margin-bottom: 12px; }
.n3d-empty-reset { margin: 0 auto; display: inline-block; }

/* ── Quantity selector ───────────────────────────────────────────── */
.n3d-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    height: 32px;
}
.n3d-qty-btn {
    background: #f5f5f5 !important;
    border: none !important;
    color: #333 !important;
    width: 28px;
    height: 100%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .12s;
}
.n3d-qty-btn:hover { background: #e0e0e0 !important; }
.n3d-qty-input {
    width: 36px;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    border-radius: 0 !important;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0 !important;
    height: 100%;
    -moz-appearance: textfield;
}
.n3d-qty-input::-webkit-inner-spin-button,
.n3d-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Search tooltip ──────────────────────────────────────────────── */
.n3d-search-tooltip {
    padding: 8px 14px;
    background: #fff8ee;
    border-bottom: 1px solid #ffe0a0;
    font-size: 11px;
    color: #9a6800;
    line-height: 1.4;
    border-radius: 10px 10px 0 0;
}
.n3d-search-tooltip kbd {
    display: inline-block;
    background: #f0e0c0;
    border: 1px solid #c8a060;
    border-radius: 4px;
    padding: 0 4px;
    font-size: 10px;
    font-family: inherit;
}

/* ── Add-to-cart toast notification ─────────────────────────────────── */
#n3d-cart-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #222;
    color: #fff;
    padding: 13px 16px 13px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
    font-size: 14px;
    max-width: 300px;
    transform: translateY(16px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    pointer-events: auto;
}
#n3d-cart-toast.n3d-cart-toast--visible {
    transform: translateY(0);
    opacity: 1;
}
.n3d-ct-icon { font-size: 18px; flex-shrink: 0; }
.n3d-ct-msg  { flex: 1; line-height: 1.3; }
.n3d-ct-msg strong { color: #ffaa33; }
.n3d-ct-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.n3d-ct-close:hover { color: #fff; }
@media (max-width: 480px) {
    #n3d-cart-toast { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: none; }
}

/* ── Evolution popup link images ────────────────────────────────── */
.n3d-evo-link img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}
