/**
 * Vehicle Search - Minimal Design with Overlapping Labels
 */

.troykeys-vehicle-search {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.troykeys-vehicle-search-form {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.troykeys-search-container {
    background: #ffffff;
    border: 1px solid #0073e6;
    border-radius: 8px;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.troykeys-search-label {
    font-size: 16px !important;
    font-weight: 700;
    color: #333333;
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 5px;
    line-height: 1;
    margin: 0;
}

.troykeys-field-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    padding-top: 8px;
}

.troykeys-field-label {
    font-size: 10px !important;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    position: absolute;
    top: 0;
    left: 10px;
    background: #ffffff;
    padding: 0 4px;
    z-index: 1;
    margin: 0;
    line-height: 1;
}

.troykeys-select {
    width: 100%;
    padding: 10px 32px 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-height: 40px;
    box-sizing: border-box;
}

.troykeys-select:hover:not(:disabled) {
    border-color: #999999;
}

.troykeys-select:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.1);
}

.troykeys-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.troykeys-select.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%230073e6' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%230073e6' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3C/svg%3E");
    background-size: 14px;
    animation: troykeys-spin 1s linear infinite;
}

@keyframes troykeys-spin {
    0% { background-position: right 12px center; }
    100% { background-position: right 12px center; }
}

.troykeys-search-button {
    flex-shrink: 0;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: #FF5C00;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
    min-width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    box-sizing: border-box;
    margin-left: auto;
}

.troykeys-search-button:hover {
    background: #e55200;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 92, 0, 0.3);
}

.troykeys-search-button:active {
    transform: translateY(0);
    background: #cc4a00;
}

.troykeys-search-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.2);
}

/* Tablet - Keep in one row but adjust spacing */
@media (max-width: 1024px) {
    .troykeys-search-container {
        padding: 18px 15px;
        gap: 10px;
    }
    
    .troykeys-search-label {
        font-size: 15px;
        padding-right: 3px;
    }
    
    .troykeys-field-group {
        flex: 1 1 0;
        min-width: 0;
    }
    
    .troykeys-select {
        font-size: 13px;
        padding: 9px 30px 9px 11px;
        min-height: 38px;
    }
    
    .troykeys-search-button {
        min-width: 120px;
        padding: 10px 20px;
        font-size: 14px;
        min-height: 38px;
    }
}

/* Mobile - Stack vertically */
@media (max-width: 768px) {
    .troykeys-search-container {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 15px;
    }
    
    .troykeys-search-label {
        width: 100%;
        padding-right: 0;
        margin-bottom: 0;
        text-align: left;
    }
    
    .troykeys-field-group {
        width: 100%;
        flex: none;
        padding-top: 8px;
    }
    
    .troykeys-search-button {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
        min-width: auto;
    }
    
    .troykeys-select {
        font-size: 16px;
        min-height: 44px;
    }
    
    .troykeys-search-button {
        min-height: 44px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .troykeys-search-container {
        padding: 12px;
    }
    
    .troykeys-search-label {
        font-size: 14px;
    }
    
    .troykeys-field-label {
        font-size: 9px;
    }
    
    .troykeys-select {
        padding: 9px 30px 9px 11px;
        min-height: 42px;
        font-size: 15px;
    }
    
    .troykeys-search-button {
        padding: 10px 18px;
        min-height: 42px;
        font-size: 15px;
    }
}

.troykeys-select:focus-visible {
    outline: 2px solid #0073e6;
    outline-offset: 2px;
}

.troykeys-search-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media print {
    .troykeys-vehicle-search {
        display: none;
    }
}

/* Shop Page Filters */
.troykeys-shop-filters-wrapper {
    width: 100%;
    margin-bottom: 30px;
    padding: 0;
}

.troykeys-shop-filters {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.troykeys-filters-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.troykeys-filter-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 150px;
    position: relative;
    padding-top: 8px;
}

.troykeys-filter-label {
    font-size: 11px !important;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    position: absolute;
    top: 0;
    left: 10px;
    background: #ffffff;
    padding: 0 4px;
    z-index: 1;
    margin: 0;
    line-height: 1;
}

.troykeys-filter-select {
    width: 100%;
    padding: 10px 32px 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-height: 40px;
    box-sizing: border-box;
}

.troykeys-filter-select:hover:not(:disabled) {
    border-color: #999999;
}

.troykeys-filter-select:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.1);
}

.troykeys-filter-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.troykeys-filter-select.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%230073e6' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%230073e6' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3C/svg%3E");
    background-size: 14px;
    animation: troykeys-spin 1s linear infinite;
}

.troykeys-clear-filters {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
    white-space: nowrap;
    box-sizing: border-box;
}

.troykeys-clear-filters:hover {
    background: #e8e8e8;
    border-color: #999;
    color: #333;
}

.troykeys-clear-filters:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Products container filtering state */
.products.troykeys-filtering,
ul.products.troykeys-filtering,
.wc-block-grid__products.troykeys-filtering {
    transition: opacity 0.3s ease;
}

/* Responsive styles for shop filters */
@media (max-width: 768px) {
    .troykeys-filters-container {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 15px;
    }
    
    .troykeys-filter-group {
        width: 100%;
        flex: none;
        min-width: auto;
    }
    
    .troykeys-clear-filters {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .troykeys-filters-container {
        padding: 12px;
    }
    
    .troykeys-filter-label {
        font-size: 10px;
    }
    
    .troykeys-filter-select {
        padding: 9px 30px 9px 11px;
        min-height: 42px;
        font-size: 15px;
    }
    
    .troykeys-clear-filters {
        padding: 10px 18px;
        min-height: 42px;
        font-size: 15px;
    }
}
