/* ─────────────────────────────────────────────
   DM Search – Frontend Styles v1.1
   Modern, attractive search bar for pvccardprinting.in
───────────────────────────────────────────── */

/* ── Wrapper ── */
.dm-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 620px;
    font-family: inherit;
    z-index: 9999;
}

.dm-search-form { position: relative; width: 100%; }

/* ── Input wrap – the main bar ── */
.dm-search-input-wrap {
    display: flex;
    align-items: center;
    position: relative;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 50px;
    box-shadow: 0 2px 12px rgba(0,0,0,.10), 0 0 0 1.5px #e2e8f0;
    transition: box-shadow .22s ease, border-color .22s ease;
    overflow: hidden;
    height: 52px;
}

.dm-search-input-wrap:focus-within {
    box-shadow: 0 4px 20px rgba(26,115,232,.18), 0 0 0 2px #1a73e8;
    border-color: transparent;
}

/* ── Search icon ── */
.dm-search-icon {
    display: flex;
    align-items: center;
    padding: 0 6px 0 18px;
    color: #1a73e8;
    flex-shrink: 0;
    pointer-events: none;
}

.dm-search-icon svg { width: 20px; height: 20px; stroke-width: 2.5; }

/* ── Input ── */
.dm-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 8px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #1a202c !important;
    letter-spacing: .01em;
    min-width: 0;
    height: 100%;
    -webkit-appearance: none;
}

.dm-search-input::placeholder { color: #94a3b8 !important; font-weight: 400; }
.dm-search-input::-webkit-search-cancel-button { display: none; }

/* ── Clear button ── */
.dm-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
    transition: background .15s, color .15s;
}
.dm-search-clear.visible { display: flex; }
.dm-search-clear:hover { background: #cbd5e1; color: #1e293b; }

/* ── Spinner ── */
.dm-search-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: dm-spin .7s linear infinite;
    margin-right: 10px;
    flex-shrink: 0;
}
.dm-search-spinner.visible { display: block; }
@keyframes dm-spin { to { transform: rotate(360deg); } }

/* ── Submit button – pill inside bar ── */
.dm-search-submit {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 0 22px;
    height: 40px;
    margin-right: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    border-radius: 40px;
    transition: background .18s, transform .12s;
    white-space: nowrap;
    flex-shrink: 0;
}
.dm-search-submit:hover { background: #1557b0; transform: scale(1.02); }
.dm-search-submit:active { transform: scale(0.98); }

/* ─────────────────────────────────────────────
   DROPDOWN
───────────────────────────────────────────── */

.dm-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06);
    z-index: 99999;
    overflow: hidden;
    display: flex;
    max-height: 560px;
}

.dm-dropdown-inner {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.dm-dropdown-inner::-webkit-scrollbar { width: 4px; }
.dm-dropdown-inner::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* ── Section labels ── */
.dm-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 12px 16px 4px;
}

/* ─────────────────────────────────────────────
   CATEGORY items
───────────────────────────────────────────── */

.dm-search-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    text-decoration: none !important;
    color: #374151 !important;
    font-size: 13px;
    transition: background .1s;
    border-bottom: 1px solid #f1f5f9;
}
.dm-search-cat-item:hover, .dm-search-cat-item.dm-active {
    background: #eff6ff; color: #1a73e8 !important;
}
.dm-cat-icon { font-size: 15px; }
.dm-cat-name { flex: 1; font-weight: 500; }
.dm-cat-count { color: #cbd5e1; font-size: 11px; }

/* ─────────────────────────────────────────────
   PRODUCT items
───────────────────────────────────────────── */

.dm-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: #1a202c !important;
    transition: background .1s;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
}
.dm-product-item:last-of-type { border-bottom: none; }
.dm-product-item:hover, .dm-product-item.dm-active { background: #f8faff; }
.dm-product-item[aria-selected="true"] { background: #eff6ff; }

/* Thumb */
.dm-product-thumb {
    flex-shrink: 0;
    width: 54px; height: 54px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dm-product-thumb img {
    width: 54px !important; height: 54px !important;
    object-fit: cover; display: block;
}

/* Info */
.dm-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dm-product-title {
    font-size: 13.5px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}
.dm-product-title mark {
    background: #fef9c3;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
.dm-product-cat {
    font-size: 11px;
    color: #1a73e8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dm-product-sku { font-size: 11px; color: #94a3b8; }

/* Right: price + badges */
.dm-product-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.dm-product-price {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}
.dm-product-price del { color: #94a3b8; font-weight: 400; font-size: 12px; margin-right: 3px; }
.dm-product-price ins { text-decoration: none; color: #e53935; }

.dm-sale-badge {
    background: linear-gradient(135deg, #ff4444, #e53935);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    letter-spacing: .06em;
}
.dm-oos-badge {
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 20px;
}

/* ─────────────────────────────────────────────
   SEE ALL
───────────────────────────────────────────── */

.dm-search-see-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 16px;
    background: #f8faff;
    border-top: 1px solid #e8eef8;
    color: #1a73e8 !important;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .12s;
    cursor: pointer;
}
.dm-search-see-all:hover { background: #eff6ff; }
.dm-total { color: #94a3b8; font-weight: 400; font-size: 13px; margin-left: 2px; }

/* ─────────────────────────────────────────────
   NO RESULTS
───────────────────────────────────────────── */

.dm-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 20px;
    color: #94a3b8;
    font-size: 14px;
}
.dm-no-results-icon { font-size: 30px; opacity: .5; }

/* ─────────────────────────────────────────────
   DETAILS BOX (hover preview)
───────────────────────────────────────────── */

.dm-details-box {
    width: 210px;
    flex-shrink: 0;
    border-left: 1px solid #f1f5f9;
    background: #fafbff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dm-details-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f1f5f9;
}
.dm-details-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.dm-details-body {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.dm-details-title { font-size: 12.5px; font-weight: 600; color: #0f172a; line-height: 1.4; }
.dm-details-cat { font-size: 10.5px; color: #1a73e8; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dm-details-sku { font-size: 11px; color: #94a3b8; }
.dm-details-price {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
}
.dm-details-price del { color: #94a3b8; font-size: 12px; font-weight: 400; }
.dm-details-price ins { text-decoration: none; color: #e53935; }
.dm-details-rating { font-size: 12px; color: #f59e0b; display: flex; align-items: center; gap: 3px; }
.dm-star { color: #e2e8f0; }
.dm-star.filled { color: #f59e0b; }
.dm-details-btn {
    display: block;
    margin-top: 10px;
    padding: 8px 12px;
    background: #1a73e8;
    color: #fff !important;
    text-align: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s;
}
.dm-details-btn:hover { background: #1557b0; }

/* ─────────────────────────────────────────────
   MOBILE OVERLAY
───────────────────────────────────────────── */

.dm-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 9998;
    backdrop-filter: blur(3px);
}
body.dm-search-open .dm-search-overlay { display: block; }

@media (max-width: 992px) {
    .dm-search-wrapper.dm-overlay-open {
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 99999;
        max-width: 100%;
        padding: 12px 14px;
        background: #fff;
        box-shadow: 0 4px 24px rgba(0,0,0,.12);
    }
    .dm-search-wrapper.dm-overlay-open .dm-search-dropdown {
        position: static;
        max-height: calc(100vh - 90px);
        border-radius: 12px;
        margin-top: 10px;
        flex-direction: column;
    }
    .dm-details-box {
        width: 100%;
        border-left: none;
        border-top: 1px solid #f1f5f9;
        flex-direction: row;
    }
    .dm-details-img { width: 90px; aspect-ratio: 1; flex-shrink: 0; }
}
