/* ===================================================
   Totoland Shop Enhancements - Phase 8.2 AJAX Search
=================================================== */

.totoland-search-wrap,
.totoland-header-search,
.totoland-search-form {
    position: relative;
}

.totoland-ajax-search {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 10000;
}

.totoland-ajax-search-results {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,.14);
    overflow: hidden;
}

.totoland-ajax-search-inner {
    padding: 10px;
}

.totoland-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.totoland-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    text-decoration: none;
    background: #ffffff;
    transition: background .2s ease, transform .2s ease;
}

.totoland-search-result:hover,
.totoland-search-result.is-active {
    background: #f7fbff;
    transform: translateX(3px);
}

.totoland-search-result-image {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 14px;
    background: #f7fbff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #eeeeee;
}

.totoland-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.totoland-search-result-content {
    flex: 1;
    min-width: 0;
}

.totoland-search-result-title {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 4px;
}

.totoland-search-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    color: #666666;
    font-size: 12px;
}

.totoland-search-result-category {
    color: #00AEEF;
    font-weight: 800;
}

.totoland-search-result-price {
    color: #FF5AA5;
    font-weight: 900;
}

.totoland-search-result-action {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #00AEEF;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.totoland-search-view-all {
    margin-top: 10px;
    min-height: 44px;
    border-radius: 14px;
    background: #FFC83D;
    color: #111827;
    text-decoration: none;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totoland-search-state {
    padding: 18px;
    text-align: center;
    color: #555555;
}

.totoland-search-state i {
    font-size: 28px;
    color: #00AEEF;
    margin-bottom: 10px;
}

.totoland-search-state p {
    margin: 0 0 4px;
    color: #111827;
    font-weight: 900;
}

.totoland-search-state span {
    font-size: 13px;
}

.totoland-search-skeleton {
    height: 62px;
    border-radius: 14px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: totolandSearchSkeleton 1.3s ease infinite;
}

@keyframes totolandSearchSkeleton {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

.totoland-search-result:focus,
.totoland-search-view-all:focus {
    outline: 2px solid #FFC83D;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .totoland-ajax-search {
        left: 0;
        right: 0;
    }

    .totoland-search-result {
        align-items: flex-start;
    }

    .totoland-search-result-action {
        display: none;
    }
}
/* Phase 8.2 search dropdown polish */
.totoland-product-search {
    position: relative;
}

.totoland-ajax-search {
    width: 100%;
}

.totoland-ajax-search-results {
    max-height: 420px;
    overflow-y: auto;
}

.totoland-search-state-loading[hidden],
.totoland-search-state-empty[hidden],
.totoland-search-state-error[hidden],
.totoland-search-view-all[hidden] {
    display: none !important;
}

.totoland-search-state-loading {
    display: block;
}
/* Phase 8.2 final search polish */

.totoland-ajax-search-results {
    max-height: 420px;
    overflow-y: auto;
}

.totoland-search-result {
    min-height: 74px;
}

.totoland-search-result-title {
    margin-bottom: 3px;
}

.totoland-search-result-price del {
    color: #888;
    margin-right: 5px;
}

.totoland-search-result-price ins {
    color: #FF5AA5;
    text-decoration: none;
}

.totoland-search-view-all {
    margin-top: 8px;
}

@media (max-width: 767px) {
    .totoland-ajax-search {
        left: 0;
        right: 0;
    }

    .totoland-ajax-search-results {
        max-height: 360px;
    }
}
/* ===================================================
   Phase 8.6 Shop Toolbar
=================================================== */

.totoland-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.05);
}

.totoland-shop-toolbar-left,
.totoland-shop-toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.totoland-filter-toggle {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    background: #00AEEF;
    color: #ffffff;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    cursor: pointer;
}

.totoland-shop-count {
    margin: 0;
    color: #555555;
    font-size: 14px;
    font-weight: 700;
}

.totoland-shop-view-modes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.totoland-view-mode {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #F7FBFF;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.totoland-view-mode.is-active {
    background: #FFC83D;
}

.totoland-shop-sorting select,
.totoland-shop-sorting .orderby {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 0 12px;
}

/* ===================================================
   Phase 8.6 Smart Filters
=================================================== */

.totoland-shop-filters {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.05);
}

.totoland-filter-section {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.totoland-filter-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.totoland-filter-heading {
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.totoland-filter-heading i {
    transition: transform .25s ease;
}

.totoland-filter-section.is-open .totoland-filter-heading i {
    transform: rotate(180deg);
}

.totoland-filter-content {
    margin-top: 14px;
}

.totoland-filter-section:not(.is-open) .totoland-filter-content {
    display: none;
}

.totoland-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.totoland-filter-list li {
    margin-bottom: 8px;
}

.totoland-filter-list a {
    color: #555555;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: color .25s ease, transform .25s ease;
}

.totoland-filter-list a:hover {
    color: #00AEEF;
    transform: translateX(3px);
}

.totoland-filter-list small {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #EAF9FE;
    color: #00AEEF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.totoland-filter-placeholder,
.totoland-filter-empty {
    margin: 0;
    color: #777777;
    font-size: 14px;
    line-height: 1.6;
}

/* ===================================================
   Phase 8.6 Active Filter Chips
=================================================== */

.totoland-active-filters {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #F7FBFF;
    border: 1px solid #EAF1F7;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.totoland-active-filter-label {
    color: #111827;
    font-size: 14px;
    font-weight: 900;
}

.totoland-active-filter-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.totoland-filter-chip,
.totoland-clear-filters {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
}

.totoland-filter-chip {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.totoland-filter-chip:hover {
    color: #00AEEF;
}

.totoland-clear-filters {
    background: #FF5AA5;
    color: #ffffff;
}

.totoland-clear-filters:hover {
    background: #111827;
    color: #ffffff;
}

/* ===================================================
   Phase 8.6 Mobile Filter Drawer
=================================================== */

.totoland-filter-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.totoland-filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 88vw;
    height: 100vh;
    background: #ffffff;
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 35px rgba(0,0,0,.18);
    overflow-y: auto;
}

body.totoland-filter-open .totoland-filter-drawer-overlay {
    opacity: 1;
    visibility: visible;
}

body.totoland-filter-open .totoland-filter-drawer {
    transform: translateX(0);
}

/* ===================================================
   Phase 8.6 Responsive
=================================================== */

@media (min-width: 1200px) {
    .totoland-filter-toggle {
        display: none;
    }
}

@media (max-width: 767px) {
    .totoland-shop-toolbar {
        align-items: stretch;
    }

    .totoland-shop-toolbar-left,
    .totoland-shop-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .totoland-shop-sorting {
        width: 100%;
    }

    .totoland-shop-sorting select,
    .totoland-shop-sorting .orderby {
        width: 100%;
    }
}