.powertire-search-container {
    position: relative;
    display: inline-block;
    text-align: center;
}
.powertire-search-icon {
    background-color: #fe0519 !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 50px;
    height: 40px;
    display: flex
;
    align-items: center;
    justify-content: center;
    color: #fafafa !important;
    font-size: 18px;
    transition: background-color 0.3s ease;
}
.powertire-search-icon.active {
    background-color: #b30805;
}
.powertire-search-icon:hover {
    background-color: #b30805;
}

/* CRITICAL: Modal container styles for hiding/showing */
.powertire-search-form-container {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.powertire-search-form-container.powertire-modal-visible {
    visibility: visible;
    opacity: 1;
    display: flex;
}

.powertire-search-modal {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 90%;
    width: 100%;
    max-width: 800px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.powertire-search-form-container.powertire-modal-visible .powertire-search-modal {
    transform: scale(1);
}

.powertire-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.powertire-modal-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}
.powertire-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.powertire-close-btn:hover {
    color: #333;
    background-color: #f5f5f5;
}
.powertire-search-form {
    width: 100%;
}
.powertire-search-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.powertire-input-group {
    flex: 1;
    min-width: 150px;
    position: relative;
}
.powertire-input-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}
.powertire-form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}
.powertire-form-control:focus {
    outline: none;
    border-color: #e00a06;
    box-shadow: 0 0 0 3px rgba(224, 10, 6, 0.1);
}
.powertire-form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}
.powertire-search-button {
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    background-color: #e00a06;
    border: 2px solid #e00a06;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}
.powertire-search-button:hover:not(:disabled) {
    background-color: #000000;
    border-color: #b30805;
    color: white;
}
.powertire-search-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.powertire-error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    list-style: none;
    padding: 0;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.ui-autocomplete li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.ui-autocomplete li:hover {
    background: #f8f8f8;
}
.ui-autocomplete li:last-child {
    border-bottom: none;
}
@media (max-width: 768px) {
    .powertire-search-inputs {
        flex-direction: column;
        gap: 15px;
    }
    .powertire-input-group {
        min-width: 100%;
    }
    .powertire-search-modal {
        margin: 20px;
        padding: 20px;
        max-width: calc(100% - 40px);
    }
}
/* Shop page specific fix - adjust page-id based on your shop page ID */
body.page-id-123 .powertire-search-form-container {
    z-index: 10001 !important;
}