/**
 * Standalone Variable Product Search Stylesheet
 *
 * All classes scoped with .evp-vps- to prevent style leaks.
 *
 * @package EVP_VPS
 */

/* ==========================================================================
   1. Search Input & Form Wrap
   ========================================================================== */
.evp-vps-search-wrap {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    font-family: inherit;
    box-sizing: border-box;
}

.evp-vps-search-wrap * {
    box-sizing: border-box;
}

.evp-vps-search-form {
    position: relative;
    width: 100%;
    margin: 0;
}

.evp-vps-input-group {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 46px;
    background: #ffffff;
    border: 1.5px solid #2d3748;
    border-radius: 9999px;
    padding: 0 8px 0 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.evp-vps-input-group:focus-within {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.evp-vps-search-input {
    flex: 1;
    height: 100%;
    padding: 0 8px 0 0;
    border: none !important;
    background: transparent !important;
    font-size: 15px;
    color: #1e293b;
    outline: none !important;
    box-shadow: none !important;
}

.evp-vps-search-input::placeholder {
    color: #4b5563;
    opacity: 0.9;
}

.evp-vps-search-input::-webkit-search-decoration,
.evp-vps-search-input::-webkit-search-cancel-button,
.evp-vps-search-input::-webkit-search-results-button,
.evp-vps-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

.evp-vps-search-input::-ms-clear,
.evp-vps-search-input::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

.evp-vps-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 4px;
    padding: 0;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.evp-vps-clear-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.evp-vps-loader {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: evp-vps-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes evp-vps-spin {
    to { transform: rotate(360deg); }
}

.evp-vps-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent !important;
    color: #374151;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.evp-vps-submit-btn svg {
    display: block;
    width: 19px;
    height: 19px;
}

.evp-vps-submit-btn:hover {
    color: #000000;
    transform: scale(1.08);
}

/* ==========================================================================
   2. Live Search Dropdown Container
   ========================================================================== */
.evp-vps-dropdown-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-height: 480px;
    overflow-y: auto;
    z-index: 99999;
}

.evp-vps-no-exact-header {
    padding: 10px 16px;
    background: #fefce8;
    border-bottom: 1px solid #fef08a;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.evp-vps-notice-text {
    font-size: 13px;
    color: #854d0e;
}

.evp-vps-notice-sub {
    font-size: 12px;
    color: #a16207;
}

.evp-vps-items-list {
    display: flex;
    flex-direction: column;
}

.evp-vps-item {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.evp-vps-item:last-child {
    border-bottom: none;
}

.evp-vps-item:hover,
.evp-vps-item.evp-vps-active {
    background-color: #f8fafc;
}

.evp-vps-item-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none !important;
    color: inherit;
    gap: 14px;
}

.evp-vps-item-thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
}

.evp-vps-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.evp-vps-item-info {
    flex: 1;
    min-width: 0;
}

.evp-vps-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evp-vps-item-title strong {
    color: #2563eb;
    font-weight: 700;
}

.evp-vps-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.evp-vps-item-sku {
    font-size: 12px;
    color: #64748b;
}

.evp-vps-item-colour-badge {
    display: inline-block;
    padding: 1px 7px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.evp-vps-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #059669;
}

.evp-vps-dropdown-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.evp-vps-view-all-link {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb !important;
    text-decoration: none !important;
}

.evp-vps-view-all-link:hover {
    text-decoration: underline !important;
}

.evp-vps-empty {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ==========================================================================
   3. Search Results Page Grid & Layout
   ========================================================================== */
.evp-vps-results-wrapper {
    width: 100%;
    margin: 30px auto;
    max-width: 1200px;
    padding: 0 15px;
}

.evp-vps-results-header {
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.evp-vps-results-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.evp-vps-results-count {
    font-size: 14px;
    color: #64748b;
}

.evp-vps-no-exact-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-left: 4px solid #eab308;
    border-radius: 6px;
    margin-bottom: 24px;
}

.evp-vps-alert-icon {
    color: #ca8a04;
    flex-shrink: 0;
}

.evp-vps-alert-content {
    font-size: 14px;
    color: #713f12;
    line-height: 1.4;
}

.evp-vps-alert-content strong {
    display: block;
    margin-bottom: 2px;
}

.evp-vps-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.evp-vps-product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.evp-vps-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
}

.evp-vps-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: #f8fafc;
    overflow: hidden;
}

.evp-vps-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.evp-vps-product-card:hover .evp-vps-card-thumbnail img {
    transform: scale(1.04);
}

.evp-vps-colour-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.evp-vps-card-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.evp-vps-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.evp-vps-card-title a {
    color: #0f172a;
    text-decoration: none !important;
}

.evp-vps-card-title a:hover {
    color: #2563eb;
}

.evp-vps-card-sku {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.evp-vps-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 14px;
    margin-top: auto;
}

.evp-vps-card-action .evp-vps-view-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 9px 12px;
    background: #0f172a;
    color: #ffffff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.evp-vps-card-action .evp-vps-view-btn:hover {
    background: #2563eb;
}

.evp-vps-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.evp-vps-pagination ul.page-numbers {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
}

.evp-vps-pagination ul.page-numbers li a,
.evp-vps-pagination ul.page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #1e293b;
    background: #ffffff;
}

.evp-vps-pagination ul.page-numbers li span.current {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.evp-vps-empty-results,
.evp-vps-no-query-message {
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    border-radius: 8px;
    color: #64748b;
    margin: 30px 0;
}
