/* =========================================================
   SPADE — FIBOSEARCH MINI-CART STYLE DRAWER
   ========================================================= */

html.spade-search-lock,
html.spade-search-lock body {
    overflow: hidden !important;
}

/* The original Blocksy search modal is no longer used once our
   custom FiboSearch drawer is enabled. */
body.spade-fibo-search-enabled #search-modal {
    display: none !important;
}

.spade-search-drawer-root {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    visibility: hidden;
}

.spade-search-drawer-root.is-open {
    pointer-events: auto;
    visibility: visible;
}

.spade-search-drawer__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(10, 10, 12, 0.48);
    opacity: 0;
    cursor: default;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.28s ease;
}

.spade-search-drawer-root.is-open .spade-search-drawer__backdrop {
    opacity: 1;
}

.spade-search-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(460px, 100%);
    height: 100%;
    padding: 30px 28px 36px;
    background: #ffffff;
    color: #111111;
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.15);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(102%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
}

.spade-search-drawer-root.is-open .spade-search-drawer {
    transform: translateX(0);
}

.spade-search-drawer:focus {
    outline: none;
}

.spade-search-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.spade-search-drawer__eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--spade-pink, #e83d72);
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.spade-search-drawer__title {
    margin: 0;
    color: #111111;
    font-family: var(--spade-font-heading, "DM Serif Display", Georgia, serif);
    font-size: 31px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.spade-search-drawer__close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -7px -7px 0 0;
    padding: 0;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #111111 !important;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.spade-search-drawer__close:hover {
    background: #f7f7f7 !important;
    color: var(--spade-pink, #e83d72) !important;
    transform: rotate(90deg);
}

.spade-search-drawer__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

/* ---------------------------------------------------------
   FIBOSEARCH BAR
   --------------------------------------------------------- */

.spade-search-drawer__search,
.spade-search-drawer__search .dgwt-wcas-search-wrapp {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.spade-search-drawer__search .dgwt-wcas-sf-wrapp {
    position: relative !important;
    width: 100% !important;
    min-height: 58px !important;
    padding: 0 !important;
    border: 1px solid #dedede !important;
    border-radius: 3px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    overflow: hidden !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spade-search-drawer__search .dgwt-wcas-sf-wrapp:focus-within {
    border-color: var(--spade-pink, #e83d72) !important;
    box-shadow: 0 0 0 1px rgba(232, 61, 114, 0.07) !important;
}

.spade-search-drawer__search input[type="search"].dgwt-wcas-search-input {
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 0 58px 0 17px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #111111 !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.spade-search-drawer__search input[type="search"].dgwt-wcas-search-input::placeholder {
    color: #888888 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.spade-search-drawer__search .dgwt-wcas-search-submit {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    bottom: auto !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: #111111 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.spade-search-drawer__search .dgwt-wcas-search-submit:hover {
    background: var(--spade-pink, #e83d72) !important;
    transform: scale(0.96);
}

.spade-search-drawer__search .dgwt-wcas-search-submit svg {
    width: 18px !important;
    height: 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    color: #ffffff !important;
}

.spade-search-drawer__helper {
    margin: 10px 0 0;
    color: #8a8a8a;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 11px;
    line-height: 1.55;
}

/* ---------------------------------------------------------
   DEFAULT CONTENT BEFORE TYPING
   --------------------------------------------------------- */

.spade-search-defaults {
    margin-top: 28px;
    transition: opacity 0.18s ease;
}

body.spade-search-has-query .spade-search-defaults {
    display: none;
}

.spade-search-defaults__section {
    padding: 24px 0;
    border-top: 1px solid #eeeeee;
}

.spade-search-defaults__section:first-child {
    padding-top: 0;
    border-top: 0;
}

.spade-search-defaults__heading {
    margin: 0 0 14px;
    color: #111111;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.spade-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spade-search-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 100px;
    background: #ffffff;
    color: #333333 !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.spade-search-chip:hover {
    border-color: var(--spade-pink, #e83d72);
    background: #fff8fb;
    color: var(--spade-pink, #e83d72) !important;
}

.spade-search-link-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.spade-search-link-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    color: #222222 !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.spade-search-link-row:hover {
    color: var(--spade-pink, #e83d72) !important;
}

.spade-search-brand-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.spade-search-brand-link {
    position: relative;
    color: #333333 !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
}

.spade-search-brand-link::after {
    content: "";
    position: absolute;
    right: 100%;
    bottom: -3px;
    left: 0;
    height: 1px;
    background: var(--spade-pink, #e83d72);
    transition: right 0.2s ease;
}

.spade-search-brand-link:hover::after {
    right: 0;
}

.spade-search-defaults__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.spade-search-defaults__section-head .spade-search-defaults__heading {
    margin-bottom: 0;
}

.spade-search-defaults__view-all {
    color: var(--spade-pink, #e83d72) !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    text-transform: uppercase;
}

.spade-search-product-list {
    display: grid;
    gap: 0;
}

.spade-search-product {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 13px;
    padding: 12px 0;
    border-bottom: 1px solid #eeeeee;
    color: #111111 !important;
    text-decoration: none !important;
}

.spade-search-product:first-child {
    padding-top: 0;
}

.spade-search-product__image {
    width: 68px;
    height: 76px;
    display: block;
    overflow: hidden;
    background: #f7f7f7;
}

.spade-search-product__image img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
}

.spade-search-product__content {
    min-width: 0;
}

.spade-search-product__name {
    display: -webkit-box;
    margin-bottom: 6px;
    overflow: hidden;
    color: #111111;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.spade-search-product__price {
    display: block;
    color: #555555;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.spade-search-product__price del {
    margin-left: 4px;
    color: #999999;
    font-weight: 400;
}

.spade-search-product__arrow {
    color: #999999;
    font-size: 17px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.spade-search-product:hover .spade-search-product__arrow {
    color: var(--spade-pink, #e83d72);
    transform: translateX(3px);
}

/* ---------------------------------------------------------
   FIBOSEARCH LIVE RESULTS WHILE TYPING
   FiboSearch appends this wrapper to the document body.
   --------------------------------------------------------- */

body.spade-search-drawer-open .dgwt-wcas-suggestions-wrapp {
    z-index: 100020 !important;
    border: 1px solid #eeeeee !important;
    border-top: 0 !important;
    border-radius: 0 0 3px 3px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10) !important;
    overflow: auto !important;
}

body.spade-search-drawer-open .dgwt-wcas-suggestion {
    min-height: 66px !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #eeeeee !important;
    background: #ffffff !important;
    color: #111111 !important;
}

body.spade-search-drawer-open .dgwt-wcas-suggestion:hover,
body.spade-search-drawer-open .dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected {
    background: #fff8fb !important;
}

body.spade-search-drawer-open .dgwt-wcas-si {
    width: 54px !important;
    min-width: 54px !important;
}

body.spade-search-drawer-open .dgwt-wcas-si img {
    width: 48px !important;
    height: 54px !important;
    object-fit: cover !important;
    border: 0 !important;
}

body.spade-search-drawer-open .dgwt-wcas-st {
    color: #111111 !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

body.spade-search-drawer-open .dgwt-wcas-sp {
    color: #555555 !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

body.spade-search-drawer-open .dgwt-wcas-suggestion-more {
    color: var(--spade-pink, #e83d72) !important;
    font-family: var(--spade-font-body, Manrope, Arial, sans-serif) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
}

@media (max-width: 600px) {
    .spade-search-drawer {
        width: 100%;
        padding: 24px 18px 30px;
    }

    .spade-search-drawer__title {
        font-size: 27px;
    }

    .spade-search-link-list {
        grid-template-columns: 1fr;
    }

    .spade-search-product {
        grid-template-columns: 60px minmax(0, 1fr) 16px;
        gap: 12px;
    }

    .spade-search-product__image {
        width: 60px;
        height: 68px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spade-search-drawer,
    .spade-search-drawer__backdrop,
    .spade-search-drawer__close,
    .spade-search-product__arrow {
        transition: none !important;
    }
}
